diff --git a/.gitignore b/.gitignore index fdb61f164..72a73506a 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ .pydevproject .review/ .vscode/ +.cursor/ /.obdev /.settings/ BROWSE @@ -255,6 +256,7 @@ tools/deploy/single.yaml tools/deploy/tpchobp_test.yaml tools/deploy/bmsqlobp_test.yaml tools/deploy/oci_test.yaml +tools/deploy/mirror_create tools/log_parser/slog_parser tools/log_tool/log_statistics tools/log_tool/log_tool @@ -314,13 +316,11 @@ tools/deploy/single-with-proxy.yaml tools/deploy/single.yaml tools/docker/standalone/boot tools/docker/standalone/init_store_for_fast_start.py -tools/systemd/profile/oceanbase-service.sh tools/systemd/profile/pre_install.sh tools/systemd/profile/post_install.sh tools/systemd/profile/pre_uninstall.sh tools/systemd/profile/post_uninstall.sh tools/systemd/profile/telemetry.sh -tools/systemd/profile/oceanbase.service tools/systemd/profile/preinst tools/systemd/profile/postinst tools/systemd/profile/prerm diff --git a/CMakeLists.txt b/CMakeLists.txt index 8551247c7..4e5d0cad2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,12 +3,12 @@ cmake_minimum_required(VERSION 3.20) include(cmake/Utils.cmake) include(cmake/Env.cmake) -project("OceanBase_CE" - VERSION 4.3.5.3 - DESCRIPTION "OceanBase distributed database system" - HOMEPAGE_URL "https://open.oceanbase.com/" +project("OceanBase" + VERSION 1.0.0.0 + DESCRIPTION "OceanBase Lite database system" + HOMEPAGE_URL "https://open.oceanbase.com" LANGUAGES CXX C ASM) -message(STATUS "open source build enabled") + if(ENABLE_COMPILE_DLL_MODE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCOMPILE_DLL_MODE") diff --git a/LICENSE b/LICENSE index ee074d8bc..261eeb9e9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,188 +1,201 @@ -木兰公共许可证, 第2版 - -2021年5月 http://license.coscl.org.cn/MulanPubL-2.0 - -您对“贡献”的复制、使用、修改及分发受木兰公共许可证,第2版(以下简称“本许可证”)的如下条款的约束: - -0. 定义 - -“贡献” 是指由“贡献者”许可在“本许可证”下的受版权法保护的作品,包括最初“贡献者”许可在“本许可证”下的作品及后续“贡献者”许可在“本许可证”下的“衍生作品”。 - -“贡献者” 是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。 - -“法人实体” 是指提交贡献的机构及其“关联实体”。 - -“关联实体” 是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的“控制”是指拥有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。 - -“衍生作品” 是指基于“贡献”创作的作品,具体包括对全部或部分“贡献”进行修改、重写、翻译、注释、组合或与之链接(包括动态链接或静态链接)而形成的作品。仅与“贡献”进行进程间通信或系统调用的作品是独立作品,不属于“衍生作品”。 - -“对应源代码” 是指生成、安装和(对于可执行作品)运行目标代码所需的所有源文件和与之关联的接口定义文件,以及控制这些活动的脚本,但不包括编译环境、编译工具、云服务平台(如果有)。 - -“分发” 是指通过任何媒介向他人提供“贡献”或“衍生作品”的行为,以及利用“贡献”或“衍生作品”通过网络远程给用户提供服务的行为,例如:通过利用“贡献”或“衍生作品”搭建的云服务平台提供在线服务的行为。 - -1. 授予版权许可 - -每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、“分发”其“贡献”或“衍生作品”,不论修改与否。 - -2. 授予专利许可 - -每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销的情形除外)专利许可,供您使用、制造、委托制造、销售、许诺销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”中的专利权利要求,而不包括仅因您对“贡献”的修改而将必然会侵犯到的专利权利要求。如果您或您的“关联实体”直接或间接地,就“贡献”对任何人发起专利侵权诉讼(包括在诉讼中提出反诉请求或交叉请求)或发起其他专利维权行动,则“贡献者”根据“本许可证”授予您的专利许可自您发起专利诉讼或专利维权行动之日终止。 - -3. 无商标许可 - -“贡献者”在“本许可证”下不提供对其商品名称、商标、服务标识或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用的情形除外。 - -4. 分发限制 - -您可以将您接收到的“贡献”或您的“衍生作品”以源程序形式或可执行形式重新“分发”,但必须满足下列条件: - -(1)您必须向接收者提供“本许可证”的副本,并保留“贡献”中的版权、商标、专利及免责声明;并且, - -(2)如果您“分发”您接收到的“贡献”,您必须使用“本许可证”提供该“贡献”的源代码副本;如果您 “分发”您的“衍生作品”,您必须: - -(i)随“衍生作品”提供使用“本许可证”“分发”的您的“衍生作品”的“对应源代码”。如果您通过下载链接提供前述“对应源代码”,则您应将下载链接地址置于“衍生作品”或其随附文档中的明显位置,有效期自该“衍生作品”“分发”之日起不少于三年,并确保接收者可以获得“对应源代码”;或者, - -(ii)随“衍生作品”向接收者提供一个书面要约,表明您愿意提供根据“本许可证”“分发”的您“衍生作品”的“对应源代码”。该书面要约应置于“衍生作品”中的明显位置,并确保接收者根据书面要约可获取“对应源代码”的时间从您接到该请求之日起不得超过三个月,且有效期自该“衍生作品”“分发”之日起不少于三年。 - -5. 违约与终止 - -如果您违反“本许可证”,任何“贡献者”有权书面通知您终止其根据“本许可证”授予您的许可。该“贡献者”授予您的许可自您接到其终止通知之日起终止。仅在如下两种情形下,即使您收到“贡献者”的通知也并不终止其授予您的许可: - -(1)您在接到该终止通知之前已停止所有违反行为; - -(2)您是首次收到该“贡献者”根据“本许可证”发出的书面终止通知,并且您在收到该通知后30天内已停止所有违反行为。 - -只要您下游的接收者遵守“本许可证”的相关规定,即使您在“本许可证”下被授予的许可终止,不影响下游的接收者根据“本许可证”享有的权利。 - -6. 例外 - -如果您将“贡献”与采用GNU AFFERO GENERAL PUBLIC LICENSE Version 3(以下简称“AGPLv3”)或其后续版本的作品结合形成新的“衍生作品”,且根据“AGPLv3”或其后续版本的要求您有义务将新形成的“衍生作品”以“AGPLv3”或其后续版本进行许可的,您可以根据“AGPLv3”或其后续版本进行许可,只要您在“分发”该“衍生作品”的同时向接收者提供“本许可证”的副本,并保留“贡献”中的版权、商标、专利及免责声明。但任何“贡献者”不会因您选择“AGPLv3”或其后续版本而授予该“衍生作品”的接收者更多权利。 - -7. 免责声明与责任限制 - -“贡献”在提供时不带有任何明示或默示的担保。在任何情况下,“贡献者”或版权人不对任何人因使用“贡献”而引发的任何直接或间接损失承担任何责任,不论该等损失因何种原因导致或者基于何种法律理论,即使其曾被告知有该等损失的可能性。 - -8. 语言 - -“本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何不一致,以中文版为准。 - -条款结束 - -如何将木兰公共许可证,第2版,应用到您的软件 - -如果您希望将木兰公共许可证,第2版,应用到您的软件,为了方便接收者查阅,建议您完成如下三步: - -1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字; - -2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中; - -3, 请将如下声明文本放入每个源文件的头部注释中。 - -``` -Copyright (c) [Year] [name of copyright holder] -[Software Name] is licensed under Mulan PubL v2. -You can use this software according to the terms and conditions of the Mulan PubL v2. -You may obtain a copy of Mulan PubL v2 at: - http://license.coscl.org.cn/MulanPubL-2.0 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PubL v2 for more details. -``` - - - - -Mulan Public License,Version 2 (Mulan PubL v2) - -May 2021 http://license.coscl.org.cn/MulanPubL-2.0 - -Your reproduction, use, modification and Distribution of the Contribution shall be subject to Mulan Public License, Version 2 (this License) with following terms and conditions: - -0. Definition - -Contribution means the copyrightable work licensed by a particular Contributor under this License, including the work licensed by the initial Contributor under this License and its Derivative Work licensed by any subsequent Contributor under this License. - -Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License. - -Legal Entity means the entity making a Contribution and all its Affiliates. - -Affiliates mmeans entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity. - -Derivative Work means works created based on Contribution, specifically including works formed by modifying, rewriting, translating, annotating, combining or linking to all or part of Contribution (including dynamic linking or static linking). Works which only communicate with Contribution through inter-process communication or system call, are independent works, rather than Derivative Work. - -Corresponding Source Code means all the source code needed to generate, install, and (for an executable work) run the object code including the interface definition files associated with source files for the work, and scripts to control those activities, excluding of compilation environment and compilation tools, cloud services platform (if any). - -Distribute (or Distribution) means the act of making the Contribution or Derivative Work available to others through any medium, and using the Contribution or Derivative Work to provide online services to users, such as the act of providing online services through a cloud service platform built using Contributions or Derivative Works. - -1. Grant of Copyright License - -Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or Distribute its Contribution or Derivative Work, with modification or not. - -2. Grant of Patent License - -Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to use, make, have made, sell, offer for sale, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, excluding of any patent claims solely be infringed by your modification. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that any Contribution infringes patents, then any patent license granted to you under this License for the Contribution shall terminate as of the date such litigation or activity is filed or taken. - -3. No Trademark License - -No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in Section 4. - -4. Distribution Restriction - -You may Distribute the Contribution you received or your Derivative Work, whether in source or executable forms, provided that you meet the following conditions: - -1) You must provide recipients with a copy of this License and retain copyright, trademark, patent and disclaimer statements in the Contribution; and, - -2) If you Distribute the Contribution you received, you must provide copies of the Contribution’s source code under this License; - -If you Distribute your Derivative Work, you have to: - -(i) accompanying the Derivative work, provide recipients with Corresponding Source Code of your Derivative Work under this License. If you provide the Corresponding Source Code through a download link, you should place such link address prominently in the Derivative Work or its accompanying documents, and be valid no less than three years from your Distribution of the particular Derivative Work, and ensure that the recipients can acquire the Corresponding Source Code through the link; or, - -(ii) accompanying the Derivative Work, provide recipients with a written offer indicating your willingness to provide the Corresponding Source Code of the Derivative Work licensed under this License. Such written offer shall be placed prominently in the Derivative Work or its accompanying documents. Without reasonable excuse, the recipient shall be able to acquire the Corresponding Source code of the Derivative work for no more than three months from your receipt of a valid request, and be valid no less than three years from your Distribution of the particular Derivative Work. - -5. Breach and Termination - -If you breach this License, any Contributor has the right to notify you in writing to terminate its license granted to you under this License. The license granted to you by such Contributor terminates upon your receipt of such notice of termination. Notwithstanding the foregoing, your license will not be terminated even if you receive a notice of termination from Contributor, provided that: - -1) you have cured all the breaches prior to receiving such notice of termination; or, - -2) it’s your first time to receive a notice of termination from such Contributor pursuant to this License, and you have cured all the breaches within 30 days of receipt of such notice. - -Termination of your license under this License shall not affect the downstream recipient's rights under this License, provided that the downstream recipient complies with this License. - -6. Exceptions - -If you combine Contribution or your Derivative Work with a work licensed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3 (hereinafter referred to as “AGPLv3”) or its subsequent versions, and according to the AGPLv3 or its subsequent versions, you have an obligation to make the combined work to be licensed under the corresponding license, you can license such combined work under the license, provided that when you Distribute the combined work, you also provide a copy of this License to the recipients, and retain copyright, trademarks, patents, and disclaimer statements in the Contribution. No Contributor will grant additional rights to the recipients of the combined work for your license under AGPLv3 or its subsequent versions. - -7. Disclaimer of Warranty and Limitation of liability - -CONTRIBUTION ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE CONTRIBUTION, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -8. Language - -THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL. - -END OF THE TERMS AND CONDITIONS - -How to apply the Mulan Public License,Version 2 (Mulan PubL v2), to your software - -To apply the Mulan Public License,Version 2 to your work, for easy identification by recipients, you are suggested to complete following three steps: - -Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner; - -Create a file named “LICENSE” which contains the whole context of this License in the first directory of your software package; - -Attach the statement to the appropriate annotated syntax at the beginning of each source file. - -``` -Copyright (c) [Year] [name of copyright holder] -[Software Name] is licensed under Mulan PubL v2. -You can use this software according to the terms and conditions of the Mulan PubL v2. -You may obtain a copy of Mulan PubL v2 at: - http://license.coscl.org.cn/MulanPubL-2.0 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PubL v2 for more details. -``` + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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. diff --git a/cmake/DEB.cmake b/cmake/DEB.cmake index 3decb284a..a50f6e0cb 100644 --- a/cmake/DEB.cmake +++ b/cmake/DEB.cmake @@ -35,7 +35,7 @@ endif() set(CPACK_DEBIAN_PACKAGE_NAME ${CPACK_PACKAGE_NAME}) set(CPACK_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION}) -set(CPACK_PACKAGE_CONTACT "${OceanBase_CE_HOMEPAGE_URL}") +set(CPACK_PACKAGE_CONTACT "${OceanBase_HOMEPAGE_URL}") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "OceanBase") set(CPACK_DEBIAN_PACKAGE_SECTION "database") set(CPACK_DEBIAN_PACKAGE_PRIORITY "Optional") diff --git a/cmake/Env.cmake b/cmake/Env.cmake index d4f8aaafa..745bbdd6c 100644 --- a/cmake/Env.cmake +++ b/cmake/Env.cmake @@ -150,7 +150,13 @@ endif() if(BUILD_CDC_ONLY) add_definitions(-DOB_BUILD_CDC_DISABLE_VSAG) else() - add_definitions(-DENABLE_INITIAL_EXEC_TLS_MODEL) + if(NOT BUILD_EMBED_MODE) + add_definitions(-DENABLE_INITIAL_EXEC_TLS_MODEL) + endif() +endif() + +if(BUILD_EMBED_MODE) + add_definitions(-DOB_BUILD_EMBED_MODE) endif() set(OB_OBJCOPY_BIN "${DEVTOOLS_DIR}/bin/objcopy") diff --git a/cmake/Pack.cmake b/cmake/Pack.cmake index 32563b3a2..346252fa0 100644 --- a/cmake/Pack.cmake +++ b/cmake/Pack.cmake @@ -4,11 +4,11 @@ set(CPACK_PACKAGE_VENDOR "OceanBase Inc.") set(CPACK_PACKAGE_DESCRIPTION "OceanBase is a distributed relational database") set(CPACK_COMPONENTS_ALL server sql-parser) -set(CPACK_PACKAGE_NAME "oceanbase-ce") -set(CPACK_PACKAGE_VERSION "${OceanBase_CE_VERSION}") -set(CPACK_PACKAGE_VERSION_MAJOR "${OceanBase_CE_VERSION_MAJOR}") -set(CPACK_PACKAGE_VERSION_MINOR "${OceanBase_CE_VERSION_MINOR}") -set(CPACK_PACKAGE_VERSION_PATCH "${OceanBase_CE_VERSION_PATCH}") +set(CPACK_PACKAGE_NAME "oceanbase-lite") +set(CPACK_PACKAGE_VERSION "${OceanBase_VERSION}") +set(CPACK_PACKAGE_VERSION_MAJOR "${OceanBase_VERSION_MAJOR}") +set(CPACK_PACKAGE_VERSION_MINOR "${OceanBase_VERSION_MINOR}") +set(CPACK_PACKAGE_VERSION_PATCH "${OceanBase_VERSION_PATCH}") ## TIPS # @@ -16,16 +16,13 @@ set(CPACK_PACKAGE_VERSION_PATCH "${OceanBase_CE_VERSION_PATCH}") set(BITCODE_TO_ELF_LIST "") -# systemd define on package -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/systemd/profile/oceanbase-service.sh.template -${CMAKE_CURRENT_SOURCE_DIR}/tools/systemd/profile/oceanbase-service.sh -@ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/systemd/profile/telemetry.sh.template ${CMAKE_CURRENT_SOURCE_DIR}/tools/systemd/profile/telemetry.sh @ONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/systemd/profile/oceanbase.service.template -${CMAKE_CURRENT_SOURCE_DIR}/tools/systemd/profile/oceanbase.service -@ONLY) + +set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION + "/usr" "/usr/lib" "/usr/lib/systemd" "/usr/lib/systemd/system" "/usr/libexec" "/etc" +) ## server - Install to proper directory structure @@ -57,20 +54,12 @@ install(PROGRAMS COMPONENT server) install(PROGRAMS - tools/systemd/profile/oceanbase-service.sh + tools/systemd/profile/oceanbase_systemd_pre + tools/systemd/profile/oceanbase_systemd_start tools/systemd/profile/telemetry.sh DESTINATION usr/libexec/oceanbase/scripts COMPONENT server) -# Install post/pre install scripts -install(PROGRAMS - tools/systemd/profile/post_install.sh - tools/systemd/profile/post_uninstall.sh - tools/systemd/profile/pre_install.sh - tools/systemd/profile/pre_uninstall.sh - DESTINATION usr/libexec/oceanbase/scripts - COMPONENT server) - # Install configuration files to /etc/oceanbase set(INSTALL_EXTRA_FILES "") @@ -85,7 +74,6 @@ install(FILES tools/upgrade/deps_compat.yml ${CMAKE_BINARY_DIR}/src/share/ob_system_variable_init.json ${INSTALL_EXTRA_FILES} - ${CMAKE_BINARY_DIR}/ob_all_available_parameters.json tools/systemd/profile/oceanbase.cnf tools/systemd/profile/oceanbase-pre.json tools/systemd/profile/telemetry-pre.json @@ -166,16 +154,6 @@ install(FILES DESTINATION usr/include COMPONENT sql-parser) - ## oceanbase-libs -list(APPEND CPACK_COMPONENTS_ALL libs) -install(PROGRAMS - deps/3rd/usr/local/oceanbase/deps/devel/lib/libaio.so.1 - deps/3rd/usr/local/oceanbase/deps/devel/lib/libaio.so.1.0.1 - deps/3rd/usr/local/oceanbase/deps/devel/lib/libaio.so - DESTINATION usr/libexec/oceanbase/lib - COMPONENT libs -) - if(OB_BUILD_OBADMIN) ## oceanbase-utils list(APPEND CPACK_COMPONENTS_ALL utils) diff --git a/cmake/RPM.cmake b/cmake/RPM.cmake index e264dce7b..41a9ae254 100644 --- a/cmake/RPM.cmake +++ b/cmake/RPM.cmake @@ -27,7 +27,7 @@ if (OB_DISABLE_LSE) message(STATUS "CPACK_RPM_PACKAGE_RELEASE: ${CPACK_RPM_PACKAGE_RELEASE}") endif() -set(CPACK_RPM_PACKAGE_URL "${OceanBase_CE_HOMEPAGE_URL}") +set(CPACK_RPM_PACKAGE_URL "${OceanBase_HOMEPAGE_URL}") set(CPACK_RPM_PACKAGE_RELEASE_DIST ON) ## set relocation path install prefix for each component set(CPACK_RPM_DEVEL_PACKAGE_PREFIX /usr) @@ -36,9 +36,7 @@ list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr") set(CPACK_RPM_PACKAGE_GROUP "Applications/Databases") set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION}) -set(CPACK_RPM_PACKAGE_LICENSE "Mulan PubL v2.") -set(CPACK_RPM_DEFAULT_USER "admin") -set(CPACK_RPM_DEFAULT_GROUP "admin") +set(CPACK_RPM_PACKAGE_LICENSE "Apache 2.0") if (NOT BUILD_CDC_ONLY OR OB_BUILD_STANDALONE) set(DEBUG_INSTALL_POST "mv $RPM_BUILD_ROOT/../server/usr/bin/obshell %{_builddir}/obshell; %{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} %{_builddir}/%{?buildsubdir}; mv %{_builddir}/obshell $RPM_BUILD_ROOT/../server/usr/bin/obshell; %{nil}") else() @@ -52,13 +50,13 @@ set(CPACK_RPM_SPEC_MORE_DEFINE %undefine __brp_mangle_shebangs %global __requires_exclude ^\(/bin/bash\|/usr/bin/\.*\)$ %define __debug_install_post ${DEBUG_INSTALL_POST} -%if \\\"%name\\\" != \\\"oceanbase-ce-sql-parser\\\" && \\\"%name\\\" != \\\"oceanbase-sql-parser\\\" +%if \\\"%name\\\" != \\\"oceanbase-lite-sql-parser\\\" && \\\"%name\\\" != \\\"oceanbase-sql-parser\\\" %debug_package %endif ") # systemd define on rpm -set(CPACK_RPM_SERVER_PACKAGE_REQUIRES "oceanbase-ce-libs = ${CPACK_PACKAGE_VERSION}, systemd") +set(CPACK_RPM_SERVER_PACKAGE_REQUIRES "libaio, systemd") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/systemd/profile/pre_install.sh.template ${CMAKE_CURRENT_SOURCE_DIR}/tools/systemd/profile/pre_install.sh @@ -92,7 +90,7 @@ install(FILES if (BUILD_CDC_ONLY) message(STATUS "oceanbase build cdc only") set(CPACK_COMPONENTS_ALL cdc) - set(CPACK_PACKAGE_NAME "oceanbase-ce-cdc") + set(CPACK_PACKAGE_NAME "oceanbase-lite-cdc") else() add_custom_target(bitcode_to_elf ALL DEPENDS ${BITCODE_TO_ELF_LIST}) diff --git a/deps/easy/src/include/easy_atomic.h b/deps/easy/src/include/easy_atomic.h index 848f23bf3..b3e1ecb9a 100644 --- a/deps/easy/src/include/easy_atomic.h +++ b/deps/easy/src/include/easy_atomic.h @@ -6,7 +6,7 @@ #include /** - * 原子操作 + * atomic operation */ EASY_CPP_START diff --git a/deps/easy/src/include/easy_define.h b/deps/easy/src/include/easy_define.h index d56dc2596..909e66d4e 100644 --- a/deps/easy/src/include/easy_define.h +++ b/deps/easy/src/include/easy_define.h @@ -2,7 +2,7 @@ #define EASY_DEFINE_H_ /** - * 定义一些编译参数 + * Define some compile parameters */ #ifdef __cplusplus diff --git a/deps/easy/src/include/easy_list.h b/deps/easy/src/include/easy_list.h index ec73a83d5..d0fd27b00 100644 --- a/deps/easy/src/include/easy_list.h +++ b/deps/easy/src/include/easy_list.h @@ -2,7 +2,7 @@ #define EASY_LIST_H_ /** - * 列表,参考kernel上的list.h + * list, reference kernel's list.h */ #include "easy_define.h" diff --git a/deps/easy/src/io/easy_baseth_pool.h b/deps/easy/src/io/easy_baseth_pool.h index 588f3bc11..0f9cf79ac 100644 --- a/deps/easy/src/io/easy_baseth_pool.h +++ b/deps/easy/src/io/easy_baseth_pool.h @@ -4,7 +4,7 @@ #include "easy_define.h" /** - * base pthread线程池 + * base pthread thread pool */ EASY_CPP_START @@ -15,8 +15,7 @@ EASY_CPP_START for((th) = (typeof(*(th))*)&(tp)->data[offset]; \ (char*)(th) < (tp)->last; \ th = (typeof(*th)*)(((char*)th) + (tp)->member_size)) - -// 第n个 +// the nth static inline void *easy_thread_pool_index(easy_thread_pool_t *tp, int n) { if (n < 0 || n >= tp->thread_count) diff --git a/deps/easy/src/io/easy_io.h b/deps/easy/src/io/easy_io.h index bd0d29f9b..518b9ceda 100644 --- a/deps/easy/src/io/easy_io.h +++ b/deps/easy/src/io/easy_io.h @@ -9,12 +9,11 @@ #include "io/easy_log.h" #include "io/easy_summary.h" /** - * IO文件头 + * IO file header */ EASY_CPP_START - -// 接口函数 +// interface function /////////////////////////////////////////////////////////////////////////////////////////////////// // easy_io_t extern easy_io_t *easy_eio_create(easy_io_t *eio, int io_thread_count); @@ -192,8 +191,7 @@ extern int easy_ssl_client_authenticate(easy_ssl_t *ssl, SSL *conn, const void * #define easy_io_dispatch(addr,s) easy_client_dispatch(&easy_io_var,addr,s) #define easy_io_send(addr,s) easy_client_send(&easy_io_var,addr,s); #endif - -// 变量 +// variable extern __thread easy_baseth_t *easy_baseth_self; extern easy_io_t easy_io_var; extern struct easy_tx_session_pool_t global_tx_session_pool; diff --git a/deps/easy/src/io/easy_io_struct.h b/deps/easy/src/io/easy_io_struct.h index c430ada21..9ab442532 100644 --- a/deps/easy/src/io/easy_io_struct.h +++ b/deps/easy/src/io/easy_io_struct.h @@ -10,7 +10,7 @@ #include /** - * IO结构定义 + * IO structure definition */ EASY_CPP_START @@ -213,9 +213,7 @@ struct easy_io_handler_pt { //otherthan create ssl connection_t after connect succ }; - - -// 处理IO的线程 +// Thread for handling IO struct easy_io_thread_t { EASY_BASETH_DEFINE @@ -242,8 +240,7 @@ struct easy_io_thread_t { easy_atomic32_t tx_conn_count; easy_atomic32_t rx_conn_count; }; - -// 处理任务的线程 +// The thread processing the task struct easy_request_thread_t { EASY_BASETH_DEFINE @@ -255,8 +252,7 @@ struct easy_request_thread_t { easy_request_process_pt *process; void *args; }; - -// 保存client +// save client struct easy_client_t { easy_addr_t addr; easy_connection_t *c; @@ -332,8 +328,7 @@ struct easy_ratelimitor_t { void *update_s2r_map_cb_args; easy_region_ratelimitor_t region_rlmtrs[RL_MAX_REGION_COUNT]; }; - -// 对应一个SOCKET连接 +// Corresponds to a SOCKET connection struct easy_connection_t { #ifdef EASY_DEBUG_MAGIC uint64_t magic; @@ -415,7 +410,7 @@ struct easy_connection_t { }; // Todo: add response size, ratelimit and bg/fg flags. -// ipacket放进来的包, opacket及出去的包 +// ipacket incoming packet, opacket outgoing packet struct easy_request_t { #ifdef EASY_DEBUG_DOING uint64_t uuid; @@ -485,8 +480,7 @@ struct easy_message_session_t { #endif EASY_MESSAGE_SESSION_HEADER(list_node); }; - -// 用于接收, 一个或多个easy_request_t +// Used to receive, one or more easy_request_t struct easy_message_t { #ifdef EASY_DEBUG_MAGIC uint64_t magic; @@ -503,8 +497,7 @@ struct easy_message_t { void *user_data; int enable_trace; }; - -//用于统计流量rt信息 +// Used for statistics of traffic rt information struct easy_summary_t { int max_fd; ev_tstamp time; @@ -520,8 +513,7 @@ struct easy_summary_node_t { uint64_t in_byte, out_byte; ev_tstamp rt_total; }; - -// 用于发送, 只带一个easy_request_t +// Used for sending, only with one easy_request_t struct easy_session_t { #ifdef EASY_DEBUG_MAGIC uint64_t magic; @@ -565,8 +557,7 @@ struct easy_tx_session_pool_t { easy_atomic_t session_total_count; easy_atomic_t session_avail; }; - -// 监听列表 +// listen list #define EASY_LISTEN_HEADER \ int fd; \ int8_t cur, old; \ @@ -593,8 +584,7 @@ struct easy_listen_t { easy_listen_t *next; ev_io read_watcher[0]; }; - -// 用于统计处理速度 +// Used for statistics processing speed struct easy_io_stat_t { int64_t last_cnt; ev_tstamp last_time; @@ -603,8 +593,7 @@ struct easy_io_stat_t { easy_io_stat_process_pt *process; easy_io_t *eio; }; - -// easy_io对象 +// easy_io object struct easy_io_t { easy_pool_t *pool; easy_list_t eio_list_node; diff --git a/deps/easy/src/io/easy_log.h b/deps/easy/src/io/easy_log.h index 0c63a06f0..5433b1cdd 100644 --- a/deps/easy/src/io/easy_log.h +++ b/deps/easy/src/io/easy_log.h @@ -2,7 +2,7 @@ #define EASY_LOG_H_ /** - * 简单的log输出 + * simple log output */ #include "easy_define.h" #include "util/easy_string.h" @@ -42,7 +42,7 @@ typedef enum { #define easy_debug_log(format, args...) easy_common_log(EASY_LOG_DEBUG, format, ## args) #define easy_trace_log(format, args...) easy_common_log(EASY_LOG_TRACE, format, ## args) #define SYS_ERROR(format...) easy_error_log(format) -// 打印backtrace +// print backtrace #define EASY_PRINT_BT(format, args...) \ {easy_log_format(EASY_LOG_OFF, __FILE__, __LINE__, __FUNCTION__, "%s" format, easy_lbt(), ## args);} diff --git a/deps/easy/src/io/easy_summary.h b/deps/easy/src/io/easy_summary.h index 73c068689..b7712959a 100644 --- a/deps/easy/src/io/easy_summary.h +++ b/deps/easy/src/io/easy_summary.h @@ -8,7 +8,7 @@ EASY_CPP_START ////////////////////////////////////////////////////////////////////////////////// -//接口函数 +// interface function extern easy_summary_t *easy_summary_create(); extern void easy_summary_destroy(easy_summary_t *sum); extern easy_summary_node_t *easy_summary_locate_node(int fd, easy_summary_t *sum, int hidden); diff --git a/deps/easy/src/thread/easy_uthread.h b/deps/easy/src/thread/easy_uthread.h index 5c6647681..c057001ba 100644 --- a/deps/easy/src/thread/easy_uthread.h +++ b/deps/easy/src/thread/easy_uthread.h @@ -6,7 +6,7 @@ #include /** - * 创建一用户态线程 + * Create a user-mode thread */ EASY_CPP_START @@ -44,8 +44,7 @@ struct easy_uthread_control_t { easy_uthread_t *running; ucontext_t context; }; - -// 函数 +// function void easy_uthread_init(easy_uthread_control_t *control); void easy_uthread_destroy(); easy_uthread_t *easy_uthread_create(easy_uthread_start_pt *start, void *args, int stack_size); @@ -62,7 +61,7 @@ int easy_uthread_get_errcode(); void easy_uthread_set_errcode(easy_uthread_t *t, int errcode); ////////////////////// -// 下面对main的处理 +// The following is the processing of main #define EASY_UTHREAD_RUN_MAIN(main_name) \ static int easy_uthread_stacksize = 0; \ static int easy_uthread_argc; \ diff --git a/deps/easy/src/util/easy_array.h b/deps/easy/src/util/easy_array.h index 99f28e78c..08f6a4109 100644 --- a/deps/easy/src/util/easy_array.h +++ b/deps/easy/src/util/easy_array.h @@ -2,7 +2,7 @@ #define EASY_ARRAY_H_ /** - * 固定长度数组分配 + * Fixed length array allocation */ #include "util/easy_pool.h" #include "easy_list.h" diff --git a/deps/easy/src/util/easy_buf.h b/deps/easy/src/util/easy_buf.h index cfba8e350..50891fe27 100644 --- a/deps/easy/src/util/easy_buf.h +++ b/deps/easy/src/util/easy_buf.h @@ -2,7 +2,7 @@ #define EASY_BUF_H_ /** - * 网络的读写的BUFFER + * The BUFFER for network read and write */ #include "easy_define.h" #include "util/easy_pool.h" diff --git a/deps/easy/src/util/easy_hash.h b/deps/easy/src/util/easy_hash.h index 34848ad98..a21278b70 100644 --- a/deps/easy/src/util/easy_hash.h +++ b/deps/easy/src/util/easy_hash.h @@ -2,7 +2,7 @@ #define EASY_HASH_H_ /** - * 固定HASH桶的hashtable, 需要在使用的对象上定义一个easy_hash_list_t + * Fixed-size hash bucket hashtable, need to define an easy_hash_list_t on the used object */ #include "util/easy_pool.h" #include "easy_list.h" diff --git a/deps/easy/src/util/easy_inet.h b/deps/easy/src/util/easy_inet.h index ea0847b89..70cabbb29 100644 --- a/deps/easy/src/util/easy_inet.h +++ b/deps/easy/src/util/easy_inet.h @@ -2,7 +2,7 @@ #define EASY_INET_H_ /** - * inet的通用函数 + * general functions for inet */ #include "easy_define.h" #include diff --git a/deps/easy/src/util/easy_pool.h b/deps/easy/src/util/easy_pool.h index 57cb8d8ce..d361862a7 100644 --- a/deps/easy/src/util/easy_pool.h +++ b/deps/easy/src/util/easy_pool.h @@ -2,7 +2,7 @@ #define EASY_POOL_H_ /** - * 简单的内存池 + * simple memory pool */ #include "easy_define.h" #include "easy_list.h" diff --git a/deps/easy/src/util/easy_string.h b/deps/easy/src/util/easy_string.h index 1c014e594..f3c71ed2d 100644 --- a/deps/easy/src/util/easy_string.h +++ b/deps/easy/src/util/easy_string.h @@ -2,7 +2,7 @@ #define EASY_STRING_H_ /** - * inet的通用函数 + * general functions for inet */ #include #include "easy_define.h" diff --git a/deps/easy/src/util/easy_time.h b/deps/easy/src/util/easy_time.h index 23fb18f74..b3dae5aee 100644 --- a/deps/easy/src/util/easy_time.h +++ b/deps/easy/src/util/easy_time.h @@ -2,7 +2,7 @@ #define EASY_TIME_H_ /** - * time的通用函数 + * general functions for time */ #include "easy_define.h" diff --git a/deps/init/oceanbase.al8.aarch64.deps b/deps/init/oceanbase.al8.aarch64.deps index 3662f4d7f..c4ef4e19a 100644 --- a/deps/init/oceanbase.al8.aarch64.deps +++ b/deps/init/oceanbase.al8.aarch64.deps @@ -34,7 +34,7 @@ devdeps-s3-cpp-sdk-1.11.156-222024100811.al8.aarch64.rpm devdeps-protobuf-c-1.5.1-100000052025032810.al8.aarch64.rpm devdeps-roaringbitmap-croaring-3.0.0-92024092815.al8.aarch64.rpm devdeps-apache-arrow-9.0.0-652025071010.al8.aarch64.rpm -devdeps-vsag-1.1.0-142025062622.al8.aarch64.rpm +devdeps-vsag-1.1.0-802025101617.al8.aarch64.rpm devdeps-apache-orc-1.8.8-32025011711.al8.aarch64.rpm devdeps-fast-float-6.1.3-42024112122.al8.aarch64.rpm devdeps-hdfs-sdk-3.3.6-112024123116.al8.aarch64.rpm diff --git a/deps/init/oceanbase.al8.x86_64.deps b/deps/init/oceanbase.al8.x86_64.deps index 7934d5cfb..d131d2f83 100644 --- a/deps/init/oceanbase.al8.x86_64.deps +++ b/deps/init/oceanbase.al8.x86_64.deps @@ -37,7 +37,7 @@ devdeps-protobuf-c-1.5.1-100000052025032810.al8.x86_64.rpm devdeps-roaringbitmap-croaring-3.0.0-92024092815.al8.x86_64.rpm devdeps-apache-arrow-9.0.0-652025071010.al8.x86_64.rpm devdeps-hyperscan-5.4.2-252024092817.al8.x86_64.rpm -devdeps-vsag-1.1.0-142025062622.al8.x86_64.rpm +devdeps-vsag-1.1.0-802025101617.al8.x86_64.rpm devdeps-apache-orc-1.8.8-32025011711.al8.x86_64.rpm devdeps-fast-float-6.1.3-42024112122.al8.x86_64.rpm devdeps-hdfs-sdk-3.3.6-112024123116.al8.x86_64.rpm diff --git a/deps/init/oceanbase.el7.aarch64.deps b/deps/init/oceanbase.el7.aarch64.deps index 60bfaf745..329dc56c8 100644 --- a/deps/init/oceanbase.el7.aarch64.deps +++ b/deps/init/oceanbase.el7.aarch64.deps @@ -39,7 +39,7 @@ devdeps-s3-cpp-sdk-1.11.156-102023122011.el7.aarch64.rpm devdeps-protobuf-c-1.5.1-100000052025032810.el7.aarch64.rpm devdeps-roaringbitmap-croaring-3.0.0-42024042816.el7.aarch64.rpm devdeps-apache-arrow-9.0.0-652025071010.el7.aarch64.rpm -devdeps-vsag-1.1.0-142025062622.el7.aarch64.rpm +devdeps-vsag-1.1.0-802025101617.el7.aarch64.rpm devdeps-apache-orc-1.8.8-32025011711.el7.aarch64.rpm devdeps-fast-float-6.1.3-42024112122.el7.aarch64.rpm devdeps-hdfs-sdk-3.3.6-112024123116.el7.aarch64.rpm diff --git a/deps/init/oceanbase.el7.x86_64.deps b/deps/init/oceanbase.el7.x86_64.deps index c614a3008..e2b55a40e 100644 --- a/deps/init/oceanbase.el7.x86_64.deps +++ b/deps/init/oceanbase.el7.x86_64.deps @@ -38,7 +38,7 @@ devdeps-protobuf-c-1.5.1-100000052025032810.el7.x86_64.rpm devdeps-roaringbitmap-croaring-3.0.0-42024042816.el7.x86_64.rpm devdeps-apache-arrow-9.0.0-652025071010.el7.x86_64.rpm devdeps-hyperscan-5.4.2-242024090219.el7.x86_64.rpm -devdeps-vsag-1.1.0-142025062622.el7.x86_64.rpm +devdeps-vsag-1.1.0-802025101617.el7.x86_64.rpm devdeps-apache-orc-1.8.8-32025011711.el7.x86_64.rpm devdeps-fast-float-6.1.3-42024112122.el7.x86_64.rpm devdeps-hdfs-sdk-3.3.6-112024123116.el7.x86_64.rpm diff --git a/deps/init/oceanbase.el8.aarch64.deps b/deps/init/oceanbase.el8.aarch64.deps index 790fbade8..d402c2182 100644 --- a/deps/init/oceanbase.el8.aarch64.deps +++ b/deps/init/oceanbase.el8.aarch64.deps @@ -34,7 +34,7 @@ devdeps-s3-cpp-sdk-1.11.156-102023122011.el8.aarch64.rpm devdeps-protobuf-c-1.5.1-100000052025032810.el8.aarch64.rpm devdeps-roaringbitmap-croaring-3.0.0-42024042816.el8.aarch64.rpm devdeps-apache-arrow-9.0.0-652025071010.el8.aarch64.rpm -devdeps-vsag-1.1.0-142025062622.el8.aarch64.rpm +devdeps-vsag-1.1.0-802025101617.el8.aarch64.rpm devdeps-apache-orc-1.8.8-32025011711.el8.aarch64.rpm devdeps-fast-float-6.1.3-42024112122.el8.aarch64.rpm devdeps-hdfs-sdk-3.3.6-112024123116.el8.aarch64.rpm diff --git a/deps/init/oceanbase.el8.x86_64.deps b/deps/init/oceanbase.el8.x86_64.deps index 46b186a84..d8013b84b 100644 --- a/deps/init/oceanbase.el8.x86_64.deps +++ b/deps/init/oceanbase.el8.x86_64.deps @@ -36,7 +36,7 @@ devdeps-protobuf-c-1.5.1-100000052025032810.el8.x86_64.rpm devdeps-roaringbitmap-croaring-3.0.0-42024042816.el8.x86_64.rpm devdeps-apache-arrow-9.0.0-652025071010.el8.x86_64.rpm devdeps-hyperscan-5.4.2-242024090219.el8.x86_64.rpm -devdeps-vsag-1.1.0-142025062622.el8.x86_64.rpm +devdeps-vsag-1.1.0-802025101617.el8.x86_64.rpm devdeps-apache-orc-1.8.8-32025011711.el8.x86_64.rpm devdeps-cloud-qpl-1.1.0-272023061419.el8.x86_64.rpm devdeps-fast-float-6.1.3-42024112122.el8.x86_64.rpm diff --git a/deps/init/oceanbase.el9.aarch64.deps b/deps/init/oceanbase.el9.aarch64.deps index 87f537367..7082dfb56 100644 --- a/deps/init/oceanbase.el9.aarch64.deps +++ b/deps/init/oceanbase.el9.aarch64.deps @@ -38,7 +38,7 @@ devdeps-s3-cpp-sdk-1.11.156-102023122011.el8.aarch64.rpm devdeps-protobuf-c-1.5.1-100000052025032810.el8.aarch64.rpm devdeps-roaringbitmap-croaring-3.0.0-42024042816.el8.aarch64.rpm devdeps-apache-arrow-9.0.0-652025071010.el8.aarch64.rpm -devdeps-vsag-1.1.0-142025062622.el8.aarch64.rpm +devdeps-vsag-1.1.0-802025101617.el8.aarch64.rpm devdeps-apache-orc-1.8.8-32025011711.el8.aarch64.rpm devdeps-fast-float-6.1.3-42024112122.el8.aarch64.rpm devdeps-hdfs-sdk-3.3.6-112024123116.el8.aarch64.rpm diff --git a/deps/init/oceanbase.el9.x86_64.deps b/deps/init/oceanbase.el9.x86_64.deps index bb7042aa0..3c8f89967 100644 --- a/deps/init/oceanbase.el9.x86_64.deps +++ b/deps/init/oceanbase.el9.x86_64.deps @@ -41,7 +41,7 @@ devdeps-protobuf-c-1.5.1-100000052025032810.el8.x86_64.rpm devdeps-apache-arrow-9.0.0-652025071010.el8.x86_64.rpm devdeps-roaringbitmap-croaring-3.0.0-42024042816.el8.x86_64.rpm devdeps-hyperscan-5.4.2-242024090219.el8.x86_64.rpm -devdeps-vsag-1.1.0-142025062622.el8.x86_64.rpm +devdeps-vsag-1.1.0-802025101617.el8.x86_64.rpm devdeps-apache-orc-1.8.8-32025011711.el8.x86_64.rpm devdeps-fast-float-6.1.3-42024112122.el8.x86_64.rpm devdeps-hdfs-sdk-3.3.6-112024123116.el8.x86_64.rpm diff --git a/deps/oblib/src/common/cell/ob_cell_reader.cpp b/deps/oblib/src/common/cell/ob_cell_reader.cpp index ba22c6811..8f548956b 100644 --- a/deps/oblib/src/common/cell/ob_cell_reader.cpp +++ b/deps/oblib/src/common/cell/ob_cell_reader.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/cell/ob_cell_reader.h" diff --git a/deps/oblib/src/common/cell/ob_cell_reader.h b/deps/oblib/src/common/cell/ob_cell_reader.h index 1161bf364..9f100e7ce 100644 --- a/deps/oblib/src/common/cell/ob_cell_reader.h +++ b/deps/oblib/src/common/cell/ob_cell_reader.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_CELL_READER_H_ diff --git a/deps/oblib/src/common/cell/ob_cell_writer.cpp b/deps/oblib/src/common/cell/ob_cell_writer.cpp index 434d0bfa3..146fc2634 100644 --- a/deps/oblib/src/common/cell/ob_cell_writer.cpp +++ b/deps/oblib/src/common/cell/ob_cell_writer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/cell/ob_cell_writer.h" diff --git a/deps/oblib/src/common/cell/ob_cell_writer.h b/deps/oblib/src/common/cell/ob_cell_writer.h index 7d6f40617..cfa3d6d8c 100644 --- a/deps/oblib/src/common/cell/ob_cell_writer.h +++ b/deps/oblib/src/common/cell/ob_cell_writer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_CELL_WRITER_H_ @@ -23,8 +27,8 @@ namespace common class ObObj; /** - * 用于区分紧凑格式的四种存储类型 - * DENSE_SPARSE和DENSE_DENSE实际实现是rowkey和普通列分属于两行 + * Used to distinguish four types of storage formats + * DENSE_SPARSE and DENSE_DENSE are actually implemented with rowkey and regular columns belonging to two different rows */ enum ObCompactStoreType { diff --git a/deps/oblib/src/common/data_buffer.cpp b/deps/oblib/src/common/data_buffer.cpp index f175626f2..afa268677 100644 --- a/deps/oblib/src/common/data_buffer.cpp +++ b/deps/oblib/src/common/data_buffer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC diff --git a/deps/oblib/src/common/data_buffer.h b/deps/oblib/src/common/data_buffer.h index e847ba55d..0b7f03697 100644 --- a/deps/oblib/src/common/data_buffer.h +++ b/deps/oblib/src/common/data_buffer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_DATA_BUFFER_H_ diff --git a/deps/oblib/src/common/errsim_module/ob_errsim_module_interface.cpp b/deps/oblib/src/common/errsim_module/ob_errsim_module_interface.cpp index 4ee6c9ed2..73fcbb9a5 100644 --- a/deps/oblib/src/common/errsim_module/ob_errsim_module_interface.cpp +++ b/deps/oblib/src/common/errsim_module/ob_errsim_module_interface.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/common/errsim_module/ob_errsim_module_interface.h b/deps/oblib/src/common/errsim_module/ob_errsim_module_interface.h index 57b15db70..655b46f65 100644 --- a/deps/oblib/src/common/errsim_module/ob_errsim_module_interface.h +++ b/deps/oblib/src/common/errsim_module/ob_errsim_module_interface.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_ERRSIM_MODULE_OB_ERRSIM_MODULE_INTERFACE_H_ diff --git a/deps/oblib/src/common/errsim_module/ob_errsim_module_type.cpp b/deps/oblib/src/common/errsim_module/ob_errsim_module_type.cpp index 227741a69..c8e94fbb6 100644 --- a/deps/oblib/src/common/errsim_module/ob_errsim_module_type.cpp +++ b/deps/oblib/src/common/errsim_module/ob_errsim_module_type.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/common/errsim_module/ob_errsim_module_type.h b/deps/oblib/src/common/errsim_module/ob_errsim_module_type.h index 50d8f88f4..b8b994e26 100644 --- a/deps/oblib/src/common/errsim_module/ob_errsim_module_type.h +++ b/deps/oblib/src/common/errsim_module/ob_errsim_module_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_SHARE_ERRSIM_MODULE_OB_ERRSIM_MODULE_TYPE_H_ diff --git a/deps/oblib/src/common/errsim_module/ob_tenant_errsim_event.cpp b/deps/oblib/src/common/errsim_module/ob_tenant_errsim_event.cpp index fe9e71cce..3b2afa768 100644 --- a/deps/oblib/src/common/errsim_module/ob_tenant_errsim_event.cpp +++ b/deps/oblib/src/common/errsim_module/ob_tenant_errsim_event.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/common/errsim_module/ob_tenant_errsim_event.h b/deps/oblib/src/common/errsim_module/ob_tenant_errsim_event.h index e6c49e289..6b4f525e8 100644 --- a/deps/oblib/src/common/errsim_module/ob_tenant_errsim_event.h +++ b/deps/oblib/src/common/errsim_module/ob_tenant_errsim_event.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_COMMON_ERRSIM_OB_TENANT_ERRSIM_MODULE_MGR_H_ diff --git a/deps/oblib/src/common/expression/ob_expr_string_buf.h b/deps/oblib/src/common/expression/ob_expr_string_buf.h index 03b4da725..b92fce3a3 100644 --- a/deps/oblib/src/common/expression/ob_expr_string_buf.h +++ b/deps/oblib/src/common/expression/ob_expr_string_buf.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_EXPR_STRING_BUF_ diff --git a/deps/oblib/src/common/log/ob_log_constants.h b/deps/oblib/src/common/log/ob_log_constants.h index e0530885c..215ebd461 100644 --- a/deps/oblib/src/common/log/ob_log_constants.h +++ b/deps/oblib/src/common/log/ob_log_constants.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_LOG_CONSTANTS_H_ diff --git a/deps/oblib/src/common/log/ob_log_cursor.cpp b/deps/oblib/src/common/log/ob_log_cursor.cpp index 5857a18af..0446275bc 100644 --- a/deps/oblib/src/common/log/ob_log_cursor.cpp +++ b/deps/oblib/src/common/log/ob_log_cursor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/log/ob_log_cursor.h" diff --git a/deps/oblib/src/common/log/ob_log_cursor.h b/deps/oblib/src/common/log/ob_log_cursor.h index 0d503110b..8400740a5 100644 --- a/deps/oblib/src/common/log/ob_log_cursor.h +++ b/deps/oblib/src/common/log/ob_log_cursor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SHARE_LOG_OB_LOG_CURSOR_ diff --git a/deps/oblib/src/common/log/ob_log_data_writer.cpp b/deps/oblib/src/common/log/ob_log_data_writer.cpp index 2155d0fd4..f0beb1245 100644 --- a/deps/oblib/src/common/log/ob_log_data_writer.cpp +++ b/deps/oblib/src/common/log/ob_log_data_writer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/log/ob_log_data_writer.h" diff --git a/deps/oblib/src/common/log/ob_log_data_writer.h b/deps/oblib/src/common/log/ob_log_data_writer.h index ce0474c0f..8b3fcbc01 100644 --- a/deps/oblib/src/common/log/ob_log_data_writer.h +++ b/deps/oblib/src/common/log/ob_log_data_writer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_LOG_DATA_WRITER_ diff --git a/deps/oblib/src/common/log/ob_log_dir_scanner.cpp b/deps/oblib/src/common/log/ob_log_dir_scanner.cpp index 8b1c37512..3dcc9fcea 100644 --- a/deps/oblib/src/common/log/ob_log_dir_scanner.cpp +++ b/deps/oblib/src/common/log/ob_log_dir_scanner.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/log/ob_log_dir_scanner.h" diff --git a/deps/oblib/src/common/log/ob_log_dir_scanner.h b/deps/oblib/src/common/log/ob_log_dir_scanner.h index 174f8c5c8..a40578b4a 100644 --- a/deps/oblib/src/common/log/ob_log_dir_scanner.h +++ b/deps/oblib/src/common/log/ob_log_dir_scanner.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SHARE_LOG_OB_LOG_DIR_SCANNER_ diff --git a/deps/oblib/src/common/log/ob_log_entry.cpp b/deps/oblib/src/common/log/ob_log_entry.cpp index b81fee1cb..a19a8d251 100644 --- a/deps/oblib/src/common/log/ob_log_entry.cpp +++ b/deps/oblib/src/common/log/ob_log_entry.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/log/ob_log_entry.h" diff --git a/deps/oblib/src/common/log/ob_log_entry.h b/deps/oblib/src/common/log/ob_log_entry.h index 27c7a3c74..d06d50572 100644 --- a/deps/oblib/src/common/log/ob_log_entry.h +++ b/deps/oblib/src/common/log/ob_log_entry.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SHARE_LOG_OB_LOG_ENTRY_ @@ -152,11 +156,11 @@ enum LogCommand }; /** - * @brief 日志项 - * 一条日志项由四部分组成: - * ObRecordHeader + 日志序号 + LogCommand + 日志内容 - * ObLogEntry中保存ObRecordHeader, 日志序号, LogCommand 三部分 - * ObLogEntry中的data_checksum_项是对"日志序号", "LogCommand", "日志内容" 部分的校验 + * @brief log item + * a log item consists of four parts: + * ObRecordHeader + log sequence number + LogCommand + log content + * ObLogEntry stores the ObRecordHeader, log sequence number, and LogCommand parts + * the data_checksum_ item in ObLogEntry is a checksum for the "log sequence number", "LogCommand", and "log content" parts */ struct ObLogEntry { @@ -182,27 +186,27 @@ struct ObLogEntry } /** - * @brief 设置日志序号 + * @brief Set log index */ int set_log_seq(const uint64_t seq); /** - * @brief 设置LogCommand + * @brief Set LogCommand */ int set_log_command(const int32_t cmd); /** * @brief fill all fields of ObRecordHeader - * 调用该函数需要保证set_log_seq函数已经被调用 - * @param [in] log_data 日志内容缓冲区地址 - * @param [in] data_len 缓冲区长度 + * Call this function ensuring that the set_log_seq function has already been called + * @param [in] log_data log content buffer address + * @param [in] data_len buffer length */ int fill_header(const char *log_data, const int64_t data_len, const int64_t timestamp = 0); /** - * @brief 计算日志序号+LogCommand+日志内容的校验和 - * @param [in] buf 日志内容缓冲区地址 - * @param [in] len 缓冲区长度 + * @brief Calculate the checksum of log sequence number + LogCommand + log content + * @param [in] buf Address of the log content buffer + * @param [in] len Buffer length */ int64_t calc_data_checksum(const char *log_data, const int64_t data_len) const; @@ -216,8 +220,8 @@ struct ObLogEntry /** - * 调用deserialization之后, 调用该函数检查数据正确性 - * @param [in] log 日志内容缓冲区地址 + * Call this function to check data correctness after calling deserialization + * @param [in] log Address of the log content buffer */ static int get_header_size() {return sizeof(ObRecordHeader) + sizeof(uint64_t) + sizeof(LogCommand);} diff --git a/deps/oblib/src/common/log/ob_log_generator.cpp b/deps/oblib/src/common/log/ob_log_generator.cpp index c25c595f9..25ec8e4b9 100644 --- a/deps/oblib/src/common/log/ob_log_generator.cpp +++ b/deps/oblib/src/common/log/ob_log_generator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/log/ob_log_generator.h" diff --git a/deps/oblib/src/common/log/ob_log_generator.h b/deps/oblib/src/common/log/ob_log_generator.h index eda3ac3d3..78890eaf4 100644 --- a/deps/oblib/src/common/log/ob_log_generator.h +++ b/deps/oblib/src/common/log/ob_log_generator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_SHARE_OB_LOG_GENERATOR_ diff --git a/deps/oblib/src/common/log/ob_log_reader.cpp b/deps/oblib/src/common/log/ob_log_reader.cpp index d60aca160..4c19113fa 100644 --- a/deps/oblib/src/common/log/ob_log_reader.cpp +++ b/deps/oblib/src/common/log/ob_log_reader.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/log/ob_log_reader.h" diff --git a/deps/oblib/src/common/log/ob_log_reader.h b/deps/oblib/src/common/log/ob_log_reader.h index 51e2e62ea..2e17c4112 100644 --- a/deps/oblib/src/common/log/ob_log_reader.h +++ b/deps/oblib/src/common/log/ob_log_reader.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_LOG_READER_ @@ -23,11 +27,11 @@ namespace oceanbase namespace common { /** - * 日志读取类, 从一个指定的日志id开始, 遇到日志文件结束, 则打开下一个日志文件 - * 主要有两种使用方法: - * 1. Master启动时回放日志, 读到所有日志结束则回放完成 - * 2. Slave的日志回放线程使用: Slave采用一个线程同步日志, 另一个线程回放日志时, - * 回放线程不停追赶日志文件, 当读到日志结束时, 应该等待小段时间后, 再次读日志 + * Log reading class, starting from a specified log id, when the end of the log file is encountered, open the next log file + * There are mainly two usage methods: + * 1. When Master starts, replay logs, replay is complete when all logs are read + * 2. Slave's log replay thread usage: Slave uses one thread to synchronize logs, another thread to replay logs, + * the replay thread keeps chasing the log file, when it reads the end of the log, it should wait for a short period of time before reading the log again */ class ObLogReader { @@ -39,24 +43,24 @@ class ObLogReader virtual ~ObLogReader(); /** - * 初始化 - * @param [in] reader 读单个文件的单元 - * @param [in] log_dir 日志目录 - * @param [in] log_file_id_start 日志读取起始文件id - * @param [in] log_seq 日志读取上一条日志的seq - * @param [in] is_wait 在打开文件和读取数据出错时,是否重试 + * Initialization + * @param [in] reader Unit to read a single file + * @param [in] log_dir Log directory + * @param [in] log_file_id_start Starting file ID for log reading + * @param [in] log_seq Sequence of the previous log for reading + * @param [in] is_wait Whether to retry when opening a file or reading data fails */ /** - * @brief 读日志 - * 遇到SWITCH_LOG日志时直接打开下一个日志文件 - * 在打开下一个日志文件时, 如果遇到文件不存在, 可能是产生日志的地方正在切文件 - * 等待1ms后重试, 最多重试10次, 如果还不存在则报错 - * @return OB_SUCCESS 成功 - * @return OB_READ_NOTHING 没有读取到内容, 可能是日志结束了, - * 也可能是日志正在产生, 读到了中间状态数据 - * 由调用者根据自己逻辑做不同处理 - * @return otherwise 失败 + * @brief Read log + * When encountering a SWITCH_LOG log, directly open the next log file + * When opening the next log file, if the file does not exist, it may be that the place generating logs is switching files + * Wait for 1ms and retry, retry up to 10 times, if it still does not exist then report an error + * @return OB_SUCCESS Success + * @return OB_READ_NOTHING No content read, possibly because the log has ended, + * or possibly because the log is being generated, read intermediate state data + * The caller handles differently based on their own logic + * @return otherwise Failure */ int read_log(LogCommand &cmd, uint64_t &seq, char *&log_data, int64_t &data_len); //Reopen a new file and locate the next bit in the current log diff --git a/deps/oblib/src/common/log/ob_single_log_reader.cpp b/deps/oblib/src/common/log/ob_single_log_reader.cpp index f96f79963..10c8be36b 100644 --- a/deps/oblib/src/common/log/ob_single_log_reader.cpp +++ b/deps/oblib/src/common/log/ob_single_log_reader.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/log/ob_single_log_reader.h" diff --git a/deps/oblib/src/common/log/ob_single_log_reader.h b/deps/oblib/src/common/log/ob_single_log_reader.h index 870fb11f5..b74a17768 100644 --- a/deps/oblib/src/common/log/ob_single_log_reader.h +++ b/deps/oblib/src/common/log/ob_single_log_reader.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_SINGLE_LOG_READER_ @@ -33,44 +37,44 @@ class ObSingleLogReader virtual ~ObSingleLogReader(); /** - * @brief ObSingleLogReader初始化 - * ObSingleLogReader必须要先调用init函数进行初始化后, 才可以进行open和read_log调用 - * 初始化时, 会分配LOG_BUFFER_MAX_LENGTH长度的读缓冲区 - * 在析构函数中释放读缓冲区 - * @param [in] log_dir 日志文件夹 - * @return OB_SUCCESS 初始化成功 - * @return OB_INIT_TWICE 已经初始化 - * @return OB_ERROR 初始化失败 + * @brief ObSingleLogReader initialization + * ObSingleLogReader must call the init function for initialization before calling open and read_log + * During initialization, a read buffer of length LOG_BUFFER_MAX_LENGTH will be allocated + * The read buffer will be released in the destructor + * @param [in] log_dir log directory + * @return OB_SUCCESS initialization successful + * @return OB_INIT_TWICE already initialized + * @return OB_ERROR initialization failed */ /** - * @brief 打开一个文件 - * open函数会打开日志文件 - * 调用close函数关闭日志文件后, 可以再次调用open函数打开其他日志文件, 缓冲区复用 - * @param [in] file_id 读取的操作日志文件id - * @param [in] last_log_seq 上一条日志序号, 用于判断日志是否连续, 默认值0表示无效 + * @brief Open a file + * open function will open the log file + * After calling the close function to close the log file, you can call the open function again to open other log files, buffer is reused + * @param [in] file_id The id of the operation log file to read + * @param [in] last_log_seq The sequence number of the previous log, used to determine if the logs are continuous, default value 0 indicates invalid */ int open(const uint64_t file_id, const uint64_t last_log_seq = 0); /** - * @brief 关闭日志文件 - * 关闭已经打开的日志文件, 之后可以再次调用init函数, 读取其他日志文件 + * @brief Close the log file + * Close the already opened log file, after which the init function can be called again to read other log files */ int close(); /** - * @brief 重置内部状态, 释放缓冲区内存 + * @brief Reset internal state, release buffer memory */ /** - * @brief 从操作日志中读取一个更新操作 - * @param [out] cmd 日志类型 - * @param [out] log_seq 日志序号 - * @param [out] log_data 日志内容 - * @param [out] data_len 缓冲区长度 - * @return OB_SUCCESS: 如果成功; - * OB_READ_NOTHING: 从文件中没有读到数据 - * others: 发生了错误. + * @brief Read an update operation from the operation log + * @param [out] cmd Log type + * @param [out] log_seq Log sequence number + * @param [out] log_data Log content + * @param [out] data_len Buffer length + * @return OB_SUCCESS: If successful; + * OB_READ_NOTHING: No data read from the file + * others: An error occurred. */ virtual int read_log(LogCommand &cmd, uint64_t &log_seq, char *&log_data, int64_t &data_len) = 0; inline uint64_t get_cur_log_file_id() const @@ -98,10 +102,10 @@ class ObSingleLogReader int trim_last_zero_padding(int64_t header_size); protected: /** - * 从日志文件中读取数据到读缓冲区 - * @return OB_SUCCESS: 如果成功; - * OB_READ_NOTHING: 从文件中没有读到数据 - * others: 发生了错误. + * Read data from the log file into the read buffer + * @return OB_SUCCESS: if successful; + * OB_READ_NOTHING: no data was read from the file + * others: an error occurred. */ int read_log_(); protected: diff --git a/deps/oblib/src/common/meta_programming/ob_meta_compare.h b/deps/oblib/src/common/meta_programming/ob_meta_compare.h index 47a81b68f..8460e4a7d 100644 --- a/deps/oblib/src/common/meta_programming/ob_meta_compare.h +++ b/deps/oblib/src/common/meta_programming/ob_meta_compare.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef DEPS_OBLIB_SRC_COMMON_META_PROGRAMMING_OB_META_COMPARE_H @@ -61,4 +65,4 @@ int compare(const T &lhs, const T&rhs, int &result) } } } -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/common/meta_programming/ob_meta_copy.h b/deps/oblib/src/common/meta_programming/ob_meta_copy.h index 8780f2f5e..6263bc88e 100644 --- a/deps/oblib/src/common/meta_programming/ob_meta_copy.h +++ b/deps/oblib/src/common/meta_programming/ob_meta_copy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef DEPS_OBLIB_SRC_COMMON_META_PROGRAMMING_OB_META_COPY_H @@ -142,4 +146,4 @@ inline int move_or_copy_or_assign(const T &src, } } } -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/common/meta_programming/ob_meta_define.h b/deps/oblib/src/common/meta_programming/ob_meta_define.h index 4b7ab89bf..b55b2a094 100644 --- a/deps/oblib/src/common/meta_programming/ob_meta_define.h +++ b/deps/oblib/src/common/meta_programming/ob_meta_define.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_COMMON_META_PROGRAMMING_OB_META_DEFINE_H @@ -31,4 +35,4 @@ static DummyAllocator &get_instance() { static DummyAllocator alloc; return allo } } } -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/common/meta_programming/ob_meta_serialization.h b/deps/oblib/src/common/meta_programming/ob_meta_serialization.h index a72cf9480..d56025b3a 100644 --- a/deps/oblib/src/common/meta_programming/ob_meta_serialization.h +++ b/deps/oblib/src/common/meta_programming/ob_meta_serialization.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef DEPS_OBLIB_SRC_COMMON_META_PROGRAMMING_OB_META_SERIALIZATION_H @@ -60,4 +64,4 @@ class MetaSerializer } } } -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/common/meta_programming/ob_meta_swap.h b/deps/oblib/src/common/meta_programming/ob_meta_swap.h index 02084dbe5..4512f787c 100644 --- a/deps/oblib/src/common/meta_programming/ob_meta_swap.h +++ b/deps/oblib/src/common/meta_programming/ob_meta_swap.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_COMMON_META_PROGRAMMING_OB_META_SWAP_H @@ -54,4 +58,4 @@ void swap(T &lhs, T &rhs, Head &head_member, Others &...other_members) noexcept } } } -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/common/meta_programming/ob_mover.h b/deps/oblib/src/common/meta_programming/ob_mover.h index bf6f67319..5858f218e 100644 --- a/deps/oblib/src/common/meta_programming/ob_mover.h +++ b/deps/oblib/src/common/meta_programming/ob_mover.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef DEPS_OBLIB_SRC_COMMON_META_PROGRAMMING_OB_MOVER_H @@ -53,4 +57,4 @@ struct ObMover { } } } -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/common/meta_programming/ob_type_traits.h b/deps/oblib/src/common/meta_programming/ob_type_traits.h index 71027fdb7..637229aa4 100644 --- a/deps/oblib/src/common/meta_programming/ob_type_traits.h +++ b/deps/oblib/src/common/meta_programming/ob_type_traits.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef DEPS_OBLIB_SRC_COMMON_META_PROGRAMMING_OB_TYPE_TRAIT_H diff --git a/deps/oblib/src/common/ob_accuracy.cpp b/deps/oblib/src/common/ob_accuracy.cpp index d991345de..0d12c2ab6 100644 --- a/deps/oblib/src/common/ob_accuracy.cpp +++ b/deps/oblib/src/common/ob_accuracy.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_accuracy.h" diff --git a/deps/oblib/src/common/ob_accuracy.h b/deps/oblib/src/common/ob_accuracy.h index 00fa4b783..23282684c 100644 --- a/deps/oblib/src/common/ob_accuracy.h +++ b/deps/oblib/src/common/ob_accuracy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_ACCURACY_ diff --git a/deps/oblib/src/common/ob_action_flag.h b/deps/oblib/src/common/ob_action_flag.h index 8ea76f78a..d05386a44 100644 --- a/deps/oblib/src/common/ob_action_flag.h +++ b/deps/oblib/src/common/ob_action_flag.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_ACTION_FLAG_H__ diff --git a/deps/oblib/src/common/ob_balance_filter.cpp b/deps/oblib/src/common/ob_balance_filter.cpp index d39543880..c0a117479 100644 --- a/deps/oblib/src/common/ob_balance_filter.cpp +++ b/deps/oblib/src/common/ob_balance_filter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/ob_balance_filter.h" diff --git a/deps/oblib/src/common/ob_balance_filter.h b/deps/oblib/src/common/ob_balance_filter.h index 947d1507b..bf8ed3d46 100644 --- a/deps/oblib/src/common/ob_balance_filter.h +++ b/deps/oblib/src/common/ob_balance_filter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_BALANCE_FILTER_H_ diff --git a/deps/oblib/src/common/ob_buffer.h b/deps/oblib/src/common/ob_buffer.h index be212a09a..45f1d04e9 100644 --- a/deps/oblib/src/common/ob_buffer.h +++ b/deps/oblib/src/common/ob_buffer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _BUFFER_H__ diff --git a/deps/oblib/src/common/ob_clock_generator.cpp b/deps/oblib/src/common/ob_clock_generator.cpp index 366c2913f..acf351dfd 100644 --- a/deps/oblib/src/common/ob_clock_generator.cpp +++ b/deps/oblib/src/common/ob_clock_generator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_clock_generator.h" diff --git a/deps/oblib/src/common/ob_clock_generator.h b/deps/oblib/src/common/ob_clock_generator.h index ce13d00d9..867a32d86 100644 --- a/deps/oblib/src/common/ob_clock_generator.h +++ b/deps/oblib/src/common/ob_clock_generator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_CLOCK_GENERATOR_ diff --git a/deps/oblib/src/common/ob_common_types.h b/deps/oblib/src/common/ob_common_types.h index 07f181519..023f2981a 100644 --- a/deps/oblib/src/common/ob_common_types.h +++ b/deps/oblib/src/common/ob_common_types.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_COMMON_TYPES_ diff --git a/deps/oblib/src/common/ob_common_utility.cpp b/deps/oblib/src/common/ob_common_utility.cpp index f58b5f1d9..26928191e 100644 --- a/deps/oblib/src/common/ob_common_utility.cpp +++ b/deps/oblib/src/common/ob_common_utility.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/common/ob_common_utility.h b/deps/oblib/src/common/ob_common_utility.h index 64b70e5a2..0c78f09bc 100644 --- a/deps/oblib/src/common/ob_common_utility.h +++ b/deps/oblib/src/common/ob_common_utility.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_COMMON_OB_COMMON_UTILITY_H_ diff --git a/deps/oblib/src/common/ob_field.cpp b/deps/oblib/src/common/ob_field.cpp index fba6110c4..d48a53a3a 100644 --- a/deps/oblib/src/common/ob_field.cpp +++ b/deps/oblib/src/common/ob_field.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON @@ -320,8 +324,8 @@ int ObField::get_field_mb_length(const ObObjType type, break; case ObTimeTC: /* KNOWN ISSUE: - * 800:11:11,这时候TIME Length = 10 - * 11:11:11, 这时候TIME Length = 8 + * 800:11:11, at this time TIME Length = 10 + * 11:11:11, at this time TIME Length = 8 */ length = TIME_MIN_LENGTH + ((accuracy.get_scale() > 0) ? (1 + accuracy.get_scale()) : 0); /* 1 represents the decimal point in 12:12:12.3333 */ break; diff --git a/deps/oblib/src/common/ob_field.h b/deps/oblib/src/common/ob_field.h index 580841021..82158de8e 100644 --- a/deps/oblib/src/common/ob_field.h +++ b/deps/oblib/src/common/ob_field.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_FIELD_ diff --git a/deps/oblib/src/common/ob_file_common_header.cpp b/deps/oblib/src/common/ob_file_common_header.cpp index 21aeddd37..eabe1694e 100644 --- a/deps/oblib/src/common/ob_file_common_header.cpp +++ b/deps/oblib/src/common/ob_file_common_header.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/ob_file_common_header.h" diff --git a/deps/oblib/src/common/ob_file_common_header.h b/deps/oblib/src/common/ob_file_common_header.h index f49dc05f4..81e2d38de 100644 --- a/deps/oblib/src/common/ob_file_common_header.h +++ b/deps/oblib/src/common/ob_file_common_header.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_FILE_COMMON_HEADER_H_ diff --git a/deps/oblib/src/common/ob_i_callback.h b/deps/oblib/src/common/ob_i_callback.h index 0b79edde2..8b56db598 100644 --- a/deps/oblib/src/common/ob_i_callback.h +++ b/deps/oblib/src/common/ob_i_callback.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_I_CALLBAK_ diff --git a/deps/oblib/src/common/ob_idc.h b/deps/oblib/src/common/ob_idc.h index 2a0a33840..c12f44893 100644 --- a/deps/oblib/src/common/ob_idc.h +++ b/deps/oblib/src/common/ob_idc.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_IDC_H_ diff --git a/deps/oblib/src/common/ob_learner_list.h b/deps/oblib/src/common/ob_learner_list.h index a6da83d5b..6a938a023 100644 --- a/deps/oblib/src/common/ob_learner_list.h +++ b/deps/oblib/src/common/ob_learner_list.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_LEARNER_LIST_H_ diff --git a/deps/oblib/src/common/ob_learner_list.ipp b/deps/oblib/src/common/ob_learner_list.ipp index b30a444d3..3a2d1c187 100644 --- a/deps/oblib/src/common/ob_learner_list.ipp +++ b/deps/oblib/src/common/ob_learner_list.ipp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_learner_list.h" diff --git a/deps/oblib/src/common/ob_magic_number.h b/deps/oblib/src/common/ob_magic_number.h index 65340c02a..301a52850 100644 --- a/deps/oblib/src/common/ob_magic_number.h +++ b/deps/oblib/src/common/ob_magic_number.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_MAGIC_NUMBER_H_ diff --git a/deps/oblib/src/common/ob_member.cpp b/deps/oblib/src/common/ob_member.cpp index 517cd4f8f..d9d866f5a 100644 --- a/deps/oblib/src/common/ob_member.cpp +++ b/deps/oblib/src/common/ob_member.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/ob_member.h" diff --git a/deps/oblib/src/common/ob_member.h b/deps/oblib/src/common/ob_member.h index 404f0ac96..412b366cb 100644 --- a/deps/oblib/src/common/ob_member.h +++ b/deps/oblib/src/common/ob_member.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_MEMBER_H_ diff --git a/deps/oblib/src/common/ob_member_list.h b/deps/oblib/src/common/ob_member_list.h index 500433ef0..7f4127459 100644 --- a/deps/oblib/src/common/ob_member_list.h +++ b/deps/oblib/src/common/ob_member_list.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_MEMBER_LIST_H_ diff --git a/deps/oblib/src/common/ob_member_list.ipp b/deps/oblib/src/common/ob_member_list.ipp index 4f6230a4c..d4ee6ccdb 100644 --- a/deps/oblib/src/common/ob_member_list.ipp +++ b/deps/oblib/src/common/ob_member_list.ipp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/ob_member_list.h" diff --git a/deps/oblib/src/common/ob_queue_thread.cpp b/deps/oblib/src/common/ob_queue_thread.cpp index c9ad5fc47..3d355aea6 100644 --- a/deps/oblib/src/common/ob_queue_thread.cpp +++ b/deps/oblib/src/common/ob_queue_thread.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/ob_queue_thread.h" diff --git a/deps/oblib/src/common/ob_queue_thread.h b/deps/oblib/src/common/ob_queue_thread.h index 967539fb3..3a37545f2 100644 --- a/deps/oblib/src/common/ob_queue_thread.h +++ b/deps/oblib/src/common/ob_queue_thread.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_QUEUE_THREAD_H_ diff --git a/deps/oblib/src/common/ob_range.cpp b/deps/oblib/src/common/ob_range.cpp index 70b7b2f97..688d1cddc 100644 --- a/deps/oblib/src/common/ob_range.cpp +++ b/deps/oblib/src/common/ob_range.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_range.h" diff --git a/deps/oblib/src/common/ob_range.h b/deps/oblib/src/common/ob_range.h index 7d4a8f26e..5452d2db9 100644 --- a/deps/oblib/src/common/ob_range.h +++ b/deps/oblib/src/common/ob_range.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_RANGE2_H_ diff --git a/deps/oblib/src/common/ob_record_header.cpp b/deps/oblib/src/common/ob_record_header.cpp index d7af7392d..1c0ba95c6 100644 --- a/deps/oblib/src/common/ob_record_header.cpp +++ b/deps/oblib/src/common/ob_record_header.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/ob_record_header.h" @@ -150,7 +154,7 @@ DEFINE_DESERIALIZE(ObRecordHeader) } else if (OB_FAIL(serialization::decode_i64(buf, data_len, pos, &data_checksum_))) { COMMON_LOG(WARN, "encode data failed..", KP(buf), K_(data_checksum), K(ret)); } - // 后续新增成员时,应该使用header_length_作为反序列化长度的限制,以保证升级兼容 + // Subsequent new members should use header_length_ as the limit for deserialization length to ensure upgrade compatibility return ret; } diff --git a/deps/oblib/src/common/ob_record_header.h b/deps/oblib/src/common/ob_record_header.h index 03cacbece..e6e7277a0 100644 --- a/deps/oblib/src/common/ob_record_header.h +++ b/deps/oblib/src/common/ob_record_header.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_CHUNKSERVER_RECORD_HEADER_H_ diff --git a/deps/oblib/src/common/ob_region.h b/deps/oblib/src/common/ob_region.h index fdf8f3ca0..5af74ba0f 100644 --- a/deps/oblib/src/common/ob_region.h +++ b/deps/oblib/src/common/ob_region.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_REGION_H_ diff --git a/deps/oblib/src/common/ob_role.cpp b/deps/oblib/src/common/ob_role.cpp index 28fa39678..e837af56b 100644 --- a/deps/oblib/src/common/ob_role.cpp +++ b/deps/oblib/src/common/ob_role.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/common/ob_role.h b/deps/oblib/src/common/ob_role.h index 56eeed0d5..cd037289a 100644 --- a/deps/oblib/src/common/ob_role.h +++ b/deps/oblib/src/common/ob_role.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_ROLE_H_ diff --git a/deps/oblib/src/common/ob_role_mgr.h b/deps/oblib/src/common/ob_role_mgr.h index 6310a73e5..7112720cb 100644 --- a/deps/oblib/src/common/ob_role_mgr.h +++ b/deps/oblib/src/common/ob_role_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_ROLE_MGR_ diff --git a/deps/oblib/src/common/ob_server_ext.cpp b/deps/oblib/src/common/ob_server_ext.cpp index b5f56462e..e40882d6a 100644 --- a/deps/oblib/src/common/ob_server_ext.cpp +++ b/deps/oblib/src/common/ob_server_ext.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/ob_server_ext.h" diff --git a/deps/oblib/src/common/ob_server_ext.h b/deps/oblib/src/common/ob_server_ext.h index 113273e40..73abf3a86 100644 --- a/deps/oblib/src/common/ob_server_ext.h +++ b/deps/oblib/src/common/ob_server_ext.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __OCEANBASE_ZONEMANAGER_OB_SERVER_EXT_H__ diff --git a/deps/oblib/src/common/ob_simple_iterator.h b/deps/oblib/src/common/ob_simple_iterator.h index 6bc8102b7..a3ff13b15 100644 --- a/deps/oblib/src/common/ob_simple_iterator.h +++ b/deps/oblib/src/common/ob_simple_iterator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_SIMPLE_ITERATOR_ @@ -84,8 +88,8 @@ int ObSimpleIterator::set_ready() } /* - * 遍历的过程中,第一行返回的是item_arr_..begin(); - * 接下来返回的是++it,这样有利于判断it是否到达尾部,避免数组越界的风险 + * During the traversal, the first row returns item_arr_..begin(); + * The next one returns ++it, which helps in judging whether it has reached the end, avoiding the risk of array out-of-bounds. */ template int ObSimpleIterator::get_next(T &item) diff --git a/deps/oblib/src/common/ob_simple_right_join_cell.h b/deps/oblib/src/common/ob_simple_right_join_cell.h index a825788b5..e4f949c7f 100644 --- a/deps/oblib/src/common/ob_simple_right_join_cell.h +++ b/deps/oblib/src/common/ob_simple_right_join_cell.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_SIMPLE_RIGHT_JOIN_CELL_H_ diff --git a/deps/oblib/src/common/ob_simple_tpl.h b/deps/oblib/src/common/ob_simple_tpl.h index 0ead2220f..dde57708f 100644 --- a/deps/oblib/src/common/ob_simple_tpl.h +++ b/deps/oblib/src/common/ob_simple_tpl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/src/common/ob_smart_call.cpp b/deps/oblib/src/common/ob_smart_call.cpp index 7b17d20cb..cbb4a0e8f 100644 --- a/deps/oblib/src/common/ob_smart_call.cpp +++ b/deps/oblib/src/common/ob_smart_call.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_smart_call.h" diff --git a/deps/oblib/src/common/ob_smart_call.h b/deps/oblib/src/common/ob_smart_call.h index 202509fac..778467c09 100644 --- a/deps/oblib/src/common/ob_smart_call.h +++ b/deps/oblib/src/common/ob_smart_call.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEANBASE_SMART_CALL_ diff --git a/deps/oblib/src/common/ob_smart_var.cpp b/deps/oblib/src/common/ob_smart_var.cpp index 857a3976c..0a13a5bbb 100644 --- a/deps/oblib/src/common/ob_smart_var.cpp +++ b/deps/oblib/src/common/ob_smart_var.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_smart_var.h" diff --git a/deps/oblib/src/common/ob_smart_var.h b/deps/oblib/src/common/ob_smart_var.h index cb324c3d7..d829ae677 100644 --- a/deps/oblib/src/common/ob_smart_var.h +++ b/deps/oblib/src/common/ob_smart_var.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEANBASE_SMART_VAR_ diff --git a/deps/oblib/src/common/ob_store_format.cpp b/deps/oblib/src/common/ob_store_format.cpp index 5798c0b23..2c0690ac2 100644 --- a/deps/oblib/src/common/ob_store_format.cpp +++ b/deps/oblib/src/common/ob_store_format.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/common/ob_store_format.h b/deps/oblib/src/common/ob_store_format.h index 4660f4bfa..091deb437 100644 --- a/deps/oblib/src/common/ob_store_format.h +++ b/deps/oblib/src/common/ob_store_format.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_STORE_FORMAT_H_ diff --git a/deps/oblib/src/common/ob_store_range.cpp b/deps/oblib/src/common/ob_store_range.cpp index 3d6b5a480..1d980bd4b 100644 --- a/deps/oblib/src/common/ob_store_range.cpp +++ b/deps/oblib/src/common/ob_store_range.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/ob_store_range.h" diff --git a/deps/oblib/src/common/ob_store_range.h b/deps/oblib/src/common/ob_store_range.h index 3bb5b1146..d5ce71bfc 100644 --- a/deps/oblib/src/common/ob_store_range.h +++ b/deps/oblib/src/common/ob_store_range.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_STORE_RANGE_H_ diff --git a/deps/oblib/src/common/ob_string_buf.h b/deps/oblib/src/common/ob_string_buf.h index b30046fcd..369070e9a 100644 --- a/deps/oblib/src/common/ob_string_buf.h +++ b/deps/oblib/src/common/ob_string_buf.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_STRING_BUF_ diff --git a/deps/oblib/src/common/ob_string_buf.ipp b/deps/oblib/src/common/ob_string_buf.ipp index a62a753bb..e1a1d6bf6 100644 --- a/deps/oblib/src/common/ob_string_buf.ipp +++ b/deps/oblib/src/common/ob_string_buf.ipp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/allocator/ob_malloc.h" diff --git a/deps/oblib/src/common/ob_tablet_id.cpp b/deps/oblib/src/common/ob_tablet_id.cpp index 6ac432cae..dc008f313 100644 --- a/deps/oblib/src/common/ob_tablet_id.cpp +++ b/deps/oblib/src/common/ob_tablet_id.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/common/ob_tablet_id.h b/deps/oblib/src/common/ob_tablet_id.h index f5a07610f..9835d05d0 100644 --- a/deps/oblib/src/common/ob_tablet_id.h +++ b/deps/oblib/src/common/ob_tablet_id.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_TABLET_ID_H_ diff --git a/deps/oblib/src/common/ob_target_specific.cpp b/deps/oblib/src/common/ob_target_specific.cpp index c00bc0d37..853a9ff8a 100644 --- a/deps/oblib/src/common/ob_target_specific.cpp +++ b/deps/oblib/src/common/ob_target_specific.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON @@ -41,4 +45,4 @@ void init_arches() } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/common/ob_target_specific.h b/deps/oblib/src/common/ob_target_specific.h index c0effe05c..7dd912e39 100644 --- a/deps/oblib/src/common/ob_target_specific.h +++ b/deps/oblib/src/common/ob_target_specific.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_TARGET_SPECIFIC_H_ diff --git a/deps/oblib/src/common/ob_tenant_data_version_mgr.cpp b/deps/oblib/src/common/ob_tenant_data_version_mgr.cpp index 7bcbb7a00..a17e9ab90 100644 --- a/deps/oblib/src/common/ob_tenant_data_version_mgr.cpp +++ b/deps/oblib/src/common/ob_tenant_data_version_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/ob_tenant_data_version_mgr.h" @@ -551,7 +555,7 @@ int ObTenantDataVersionMgr::write_to_file_(char *buf, int64_t buf_length, int64_ // it's OK to continue if we fail to backup history file, so we ignore the err ret here COMMON_LOG(WARN, "fail to backup history config file", KERRMSG, K(ret)); } - // 运行到这里的时候可能掉电,导致没有 conf 文件,需要 DBA 手工拷贝 tmp 文件到这里 + // When running to here, a power outage may occur, resulting in no conf file, requiring the DBA to manually copy the tmp file here if (0 != ::rename(tmp_path, file_path)) { ret = OB_ERR_SYS; COMMON_LOG(WARN, "fail to move tmp config file", KERRMSG, K(ret)); @@ -567,4 +571,4 @@ int ObTenantDataVersionMgr::write_to_file_(char *buf, int64_t buf_length, int64_ } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/common/ob_tenant_data_version_mgr.h b/deps/oblib/src/common/ob_tenant_data_version_mgr.h index 6bbabe7fc..27102fa31 100644 --- a/deps/oblib/src/common/ob_tenant_data_version_mgr.h +++ b/deps/oblib/src/common/ob_tenant_data_version_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TENANT_DATA_VERSION_H_ diff --git a/deps/oblib/src/common/ob_timeout_ctx.cpp b/deps/oblib/src/common/ob_timeout_ctx.cpp index 7fdb33627..f0e73e778 100644 --- a/deps/oblib/src/common/ob_timeout_ctx.cpp +++ b/deps/oblib/src/common/ob_timeout_ctx.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/common/ob_timeout_ctx.h b/deps/oblib/src/common/ob_timeout_ctx.h index e7f2428a9..9aa110139 100644 --- a/deps/oblib/src/common/ob_timeout_ctx.h +++ b/deps/oblib/src/common/ob_timeout_ctx.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_TIMEOUT_CTX_H_ diff --git a/deps/oblib/src/common/ob_version_def.cpp b/deps/oblib/src/common/ob_version_def.cpp index 5d102c35f..4be85ce48 100644 --- a/deps/oblib/src/common/ob_version_def.cpp +++ b/deps/oblib/src/common/ob_version_def.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/ob_version_def.h" @@ -80,4 +84,4 @@ ObVersionPrinter::ObVersionPrinter(const uint64_t version) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/common/ob_version_def.h b/deps/oblib/src/common/ob_version_def.h index 9c88253ca..ff9e285e2 100644 --- a/deps/oblib/src/common/ob_version_def.h +++ b/deps/oblib/src/common/ob_version_def.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_VERSION_DEF_H_ @@ -15,7 +19,7 @@ #include "lib/ob_define.h" #include "lib/allocator/page_arena.h" -#include "lib/utility/ob_print_utils.h" +#include "lib/utility/ob_print_utils.h" namespace oceanbase { @@ -46,161 +50,45 @@ cal_version(const uint64_t major, const uint64_t minor, const uint64_t major_pat } #define DEF_MAJOR_VERSION 1 -#define DEF_MINOR_VERSION 4 -#define DEF_MAJOR_PATCH_VERSION 40 +#define DEF_MINOR_VERSION 0 +#define DEF_MAJOR_PATCH_VERSION 0 #define DEF_MINOR_PATCH_VERSION 0 -#define CLUSTER_VERSION_140 (oceanbase::common::cal_version(1, 4, 0, 0)) -#define CLUSTER_VERSION_141 (oceanbase::common::cal_version(1, 4, 0, 1)) -#define CLUSTER_VERSION_142 (oceanbase::common::cal_version(1, 4, 0, 2)) -#define CLUSTER_VERSION_143 (oceanbase::common::cal_version(1, 4, 0, 3)) -#define CLUSTER_VERSION_1431 (oceanbase::common::cal_version(1, 4, 0, 31)) -#define CLUSTER_VERSION_1432 (oceanbase::common::cal_version(1, 4, 0, 32)) -#define CLUSTER_VERSION_144 (oceanbase::common::cal_version(1, 4, 0, 4)) -#define CLUSTER_VERSION_1440 (oceanbase::common::cal_version(1, 4, 0, 40)) -#define CLUSTER_VERSION_1450 (oceanbase::common::cal_version(1, 4, 0, 50)) -#define CLUSTER_VERSION_1460 (oceanbase::common::cal_version(1, 4, 0, 60)) -#define CLUSTER_VERSION_1461 (oceanbase::common::cal_version(1, 4, 0, 61)) -#define CLUSTER_VERSION_1470 (oceanbase::common::cal_version(1, 4, 0, 70)) -#define CLUSTER_VERSION_1471 (oceanbase::common::cal_version(1, 4, 0, 71)) -#define CLUSTER_VERSION_1472 (oceanbase::common::cal_version(1, 4, 0, 72)) -#define CLUSTER_VERSION_1500 (oceanbase::common::cal_version(1, 5, 0, 0)) -#define CLUSTER_VERSION_2000 (oceanbase::common::cal_version(2, 0, 0, 0)) -#define CLUSTER_VERSION_2100 (oceanbase::common::cal_version(2, 1, 0, 0)) -#define CLUSTER_VERSION_2110 (oceanbase::common::cal_version(2, 1, 0, 1)) -#define CLUSTER_VERSION_2200 (oceanbase::common::cal_version(2, 2, 0, 0)) -#define CLUSTER_VERSION_2210 (oceanbase::common::cal_version(2, 2, 0, 1)) /* - * FIXME: cluster_version目前最高是4位,此处定义要和CMakeLists.txt、tools/upgrade、src/share/parameter/ob_parameter_seed.ipp的定义保持一致 - * 当最后一位非0时,需要注意。比方说2.2.2版本实际上代表的是2.2.02版本,但实际我们想定义成2.2.20版本,和我们的意图不符。 - * 但2.2.1及之前的版本已经发版,为了避免引入兼容性问题,不改历史版本的cluster_version定义。 + * FIXME: cluster_version is currently up to 4 digits, this definition needs to be consistent with the definitions in CMakeLists.txt, tools/upgrade, src/share/parameter/ob_parameter_seed.ipp + * When the last digit is not 0, attention is needed. For example, version 2.2.2 actually represents 2.2.02, but we actually want to define it as 2.2.20, which does not match our intention. + * However, versions 2.2.1 and earlier have already been released, to avoid introducing compatibility issues, the cluster_version definition of historical versions will not be changed. */ -#define CLUSTER_VERSION_2220 (oceanbase::common::cal_version(2, 2, 0, 20)) -#define CLUSTER_VERSION_2230 (oceanbase::common::cal_version(2, 2, 0, 30)) -#define CLUSTER_VERSION_2240 (oceanbase::common::cal_version(2, 2, 0, 40)) -#define CLUSTER_VERSION_2250 (oceanbase::common::cal_version(2, 2, 0, 50)) -#define CLUSTER_VERSION_2260 (oceanbase::common::cal_version(2, 2, 0, 60)) -#define CLUSTER_VERSION_2270 (oceanbase::common::cal_version(2, 2, 0, 70)) -#define CLUSTER_VERSION_2271 (oceanbase::common::cal_version(2, 2, 0, 71)) -#define CLUSTER_VERSION_2272 (oceanbase::common::cal_version(2, 2, 0, 72)) -#define CLUSTER_VERSION_2273 (oceanbase::common::cal_version(2, 2, 0, 73)) -#define CLUSTER_VERSION_2274 (oceanbase::common::cal_version(2, 2, 0, 74)) -#define CLUSTER_VERSION_2275 (oceanbase::common::cal_version(2, 2, 0, 75)) -#define CLUSTER_VERSION_2276 (oceanbase::common::cal_version(2, 2, 0, 76)) -#define CLUSTER_VERSION_2277 (oceanbase::common::cal_version(2, 2, 0, 77)) -#define CLUSTER_VERSION_3000 (oceanbase::common::cal_version(3, 0, 0, 0)) -#define CLUSTER_VERSION_3100 (oceanbase::common::cal_version(3, 1, 0, 0)) -#define CLUSTER_VERSION_311 (oceanbase::common::cal_version(3, 1, 0, 1)) -#define CLUSTER_VERSION_312 (oceanbase::common::cal_version(3, 1, 0, 2)) -#define CLUSTER_VERSION_3200 (oceanbase::common::cal_version(3, 2, 0, 0)) -#define CLUSTER_VERSION_321 (oceanbase::common::cal_version(3, 2, 0, 1)) -#define CLUSTER_VERSION_322 (oceanbase::common::cal_version(3, 2, 0, 2)) // ATTENSION!!!!!!!!!!!!!!!!! // // Cluster Version which is less than "3.2.3": -// - 1. It's composed by 3 parts(major、minor、minor_patch) +// - 1. It's composed by 3 parts(major, minor, minor_patch) // - 2. String: cluster version will be format as "major.minor.minor_patch[.0]", and string like "major.minor.x.minor_patch" is invalid. // - 3. Integer: for compatibility, cluster version will be encoded into "major|minor|x|minor_patch". "x" must be 0, otherwise, it's invalid. // - 4. Print: cluster version str will be still printed as 3 parts. // // Cluster Version which is not less than "3.2.3": -// - 1. It's composed by 4 parts(major、minor、major_patch、minor_patch) +// - 1. It's composed by 4 parts(major, minor, major_patch, minor_patch) // - 2. String: cluster version will be format as "major.minor.major_patch.minor_patch". // - 3. Integer: cluster version will be encoded into "major|minor|major_patch|minor_patch". // - 4. Print: cluster version str will be printed as 4 parts. -#define CLUSTER_VERSION_3_2_3_0 (oceanbase::common::cal_version(3, 2, 3, 0)) -#define CLUSTER_VERSION_4_0_0_0 (oceanbase::common::cal_version(4, 0, 0, 0)) -#define CLUSTER_VERSION_4_1_0_0 (oceanbase::common::cal_version(4, 1, 0, 0)) -#define CLUSTER_VERSION_4_1_0_1 (oceanbase::common::cal_version(4, 1, 0, 1)) -#define CLUSTER_VERSION_4_1_0_2 (oceanbase::common::cal_version(4, 1, 0, 2)) -#define CLUSTER_VERSION_4_2_0_0 (oceanbase::common::cal_version(4, 2, 0, 0)) -#define CLUSTER_VERSION_4_2_1_0 (oceanbase::common::cal_version(4, 2, 1, 0)) -#define CLUSTER_VERSION_4_2_1_1 (oceanbase::common::cal_version(4, 2, 1, 1)) -#define CLUSTER_VERSION_4_2_1_2 (oceanbase::common::cal_version(4, 2, 1, 2)) -#define MOCK_CLUSTER_VERSION_4_2_1_3 (oceanbase::common::cal_version(4, 2, 1, 3)) -#define MOCK_CLUSTER_VERSION_4_2_1_4 (oceanbase::common::cal_version(4, 2, 1, 4)) -#define MOCK_CLUSTER_VERSION_4_2_1_6 (oceanbase::common::cal_version(4, 2, 1, 6)) -#define MOCK_CLUSTER_VERSION_4_2_1_7 (oceanbase::common::cal_version(4, 2, 1, 7)) -#define CLUSTER_VERSION_4_2_2_0 (oceanbase::common::cal_version(4, 2, 2, 0)) -#define MOCK_CLUSTER_VERSION_4_2_2_1 (oceanbase::common::cal_version(4, 2, 2, 1)) -#define MOCK_CLUSTER_VERSION_4_2_3_0 (oceanbase::common::cal_version(4, 2, 3, 0)) -#define MOCK_CLUSTER_VERSION_4_2_3_1 (oceanbase::common::cal_version(4, 2, 3, 1)) -#define MOCK_CLUSTER_VERSION_4_2_4_0 (oceanbase::common::cal_version(4, 2, 4, 0)) -#define MOCK_CLUSTER_VERSION_4_2_5_0 (oceanbase::common::cal_version(4, 2, 5, 0)) -#define MOCK_CLUSTER_VERSION_4_2_5_1 (oceanbase::common::cal_version(4, 2, 5, 1)) -#define MOCK_CLUSTER_VERSION_4_2_5_2 (oceanbase::common::cal_version(4, 2, 5, 2)) -#define MOCK_CLUSTER_VERSION_4_2_5_3 (oceanbase::common::cal_version(4, 2, 5, 3)) -#define MOCK_CLUSTER_VERSION_4_2_5_4 (oceanbase::common::cal_version(4, 2, 5, 4)) -#define MOCK_CLUSTER_VERSION_4_2_5_5 (oceanbase::common::cal_version(4, 2, 5, 5)) -// new data version before 4.3 cannot upgrade to master, must add "MOCK_" prefix -#define CLUSTER_VERSION_4_3_0_0 (oceanbase::common::cal_version(4, 3, 0, 0)) -#define CLUSTER_VERSION_4_3_0_1 (oceanbase::common::cal_version(4, 3, 0, 1)) -#define CLUSTER_VERSION_4_3_1_0 (oceanbase::common::cal_version(4, 3, 1, 0)) -#define CLUSTER_VERSION_4_3_2_0 (oceanbase::common::cal_version(4, 3, 2, 0)) -#define CLUSTER_VERSION_4_3_2_1 (oceanbase::common::cal_version(4, 3, 2, 1)) -#define CLUSTER_VERSION_4_3_3_0 (oceanbase::common::cal_version(4, 3, 3, 0)) -#define CLUSTER_VERSION_4_3_3_1 (oceanbase::common::cal_version(4, 3, 3, 1)) -#define CLUSTER_VERSION_4_3_4_0 (oceanbase::common::cal_version(4, 3, 4, 0)) -#define CLUSTER_VERSION_4_3_4_1 (oceanbase::common::cal_version(4, 3, 4, 1)) -#define CLUSTER_VERSION_4_3_5_0 (oceanbase::common::cal_version(4, 3, 5, 0)) -#define CLUSTER_VERSION_4_3_5_1 (oceanbase::common::cal_version(4, 3, 5, 1)) -#define CLUSTER_VERSION_4_3_5_2 (oceanbase::common::cal_version(4, 3, 5, 2)) -#define CLUSTER_VERSION_4_3_5_3 (oceanbase::common::cal_version(4, 3, 5, 3)) -// TODO fix me after remove all other versions -#define CLUSTER_VERSION_1_0_0_0 (oceanbase::common::cal_version(5, 0, 0, 0)) +#define CLUSTER_VERSION_1_0_0_0 (oceanbase::common::cal_version(1, 0, 0, 0)) //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //TODO: If you update the above version, please update CLUSTER_CURRENT_VERSION. #define CLUSTER_CURRENT_VERSION CLUSTER_VERSION_1_0_0_0 // ATTENSION !!!!!!!!!!!!!!!!!!!!!!!!!!! -// 1. After 4.0, each cluster_version is corresponed to a data version. +// 1. each cluster_version is corresponed to a data version. // 2. cluster_version and data_version is not compariable. // 3. TODO: If you update data_version below, please update DATA_CURRENT_VERSION & ObUpgradeChecker too. #define DEFAULT_MIN_DATA_VERSION (oceanbase::common::cal_version(0, 0, 0, 1)) -#define DATA_VERSION_4_0_0_0 (oceanbase::common::cal_version(4, 0, 0, 0)) -#define DATA_VERSION_4_1_0_0 (oceanbase::common::cal_version(4, 1, 0, 0)) -#define DATA_VERSION_4_1_0_1 (oceanbase::common::cal_version(4, 1, 0, 1)) -#define DATA_VERSION_4_1_0_2 (oceanbase::common::cal_version(4, 1, 0, 2)) -#define DATA_VERSION_4_2_0_0 (oceanbase::common::cal_version(4, 2, 0, 0)) -#define DATA_VERSION_4_2_1_0 (oceanbase::common::cal_version(4, 2, 1, 0)) -#define DATA_VERSION_4_2_1_1 (oceanbase::common::cal_version(4, 2, 1, 1)) -#define DATA_VERSION_4_2_1_2 (oceanbase::common::cal_version(4, 2, 1, 2)) -#define MOCK_DATA_VERSION_4_2_1_3 (oceanbase::common::cal_version(4, 2, 1, 3)) -#define MOCK_DATA_VERSION_4_2_1_4 (oceanbase::common::cal_version(4, 2, 1, 4)) -#define MOCK_DATA_VERSION_4_2_1_5 (oceanbase::common::cal_version(4, 2, 1, 5)) -#define MOCK_DATA_VERSION_4_2_1_8 (oceanbase::common::cal_version(4, 2, 1, 8)) -#define MOCK_DATA_VERSION_4_2_1_9 (oceanbase::common::cal_version(4, 2, 1, 9)) -#define DATA_VERSION_4_2_2_0 (oceanbase::common::cal_version(4, 2, 2, 0)) -#define MOCK_DATA_VERSION_4_2_2_1 (oceanbase::common::cal_version(4, 2, 2, 1)) -#define MOCK_DATA_VERSION_4_2_3_0 (oceanbase::common::cal_version(4, 2, 3, 0)) -#define MOCK_DATA_VERSION_4_2_3_1 (oceanbase::common::cal_version(4, 2, 3, 1)) -#define MOCK_DATA_VERSION_4_2_4_0 (oceanbase::common::cal_version(4, 2, 4, 0)) -#define MOCK_DATA_VERSION_4_2_5_0 (oceanbase::common::cal_version(4, 2, 5, 0)) -#define MOCK_DATA_VERSION_4_2_5_1 (oceanbase::common::cal_version(4, 2, 5, 1)) -#define MOCK_DATA_VERSION_4_2_5_2 (oceanbase::common::cal_version(4, 2, 5, 2)) -#define MOCK_DATA_VERSION_4_2_5_3 (oceanbase::common::cal_version(4, 2, 5, 3)) -#define MOCK_DATA_VERSION_4_2_5_4 (oceanbase::common::cal_version(4, 2, 5, 4)) -// new data version before 4.3 cannot upgrade to master, must add "MOCK_" prefix -#define DATA_VERSION_4_3_0_0 (oceanbase::common::cal_version(4, 3, 0, 0)) -#define DATA_VERSION_4_3_0_1 (oceanbase::common::cal_version(4, 3, 0, 1)) -#define DATA_VERSION_4_3_1_0 (oceanbase::common::cal_version(4, 3, 1, 0)) -#define DATA_VERSION_4_3_2_0 (oceanbase::common::cal_version(4, 3, 2, 0)) -#define DATA_VERSION_4_3_2_1 (oceanbase::common::cal_version(4, 3, 2, 1)) -#define DATA_VERSION_4_3_3_0 (oceanbase::common::cal_version(4, 3, 3, 0)) -#define DATA_VERSION_4_3_3_1 (oceanbase::common::cal_version(4, 3, 3, 1)) -#define DATA_VERSION_4_3_4_0 (oceanbase::common::cal_version(4, 3, 4, 0)) -#define DATA_VERSION_4_3_4_1 (oceanbase::common::cal_version(4, 3, 4, 1)) -#define DATA_VERSION_4_3_5_0 (oceanbase::common::cal_version(4, 3, 5, 0)) -#define DATA_VERSION_4_3_5_1 (oceanbase::common::cal_version(4, 3, 5, 1)) -#define DATA_VERSION_4_3_5_2 (oceanbase::common::cal_version(4, 3, 5, 2)) -#define DATA_VERSION_4_3_5_3 (oceanbase::common::cal_version(4, 3, 5, 3)) -#define DATA_VERSION_1_0_0_0 (oceanbase::common::cal_version(5, 0, 0, 0)) +#define DATA_VERSION_1_0_0_0 (oceanbase::common::cal_version(1, 0, 0, 0)) #define DATA_CURRENT_VERSION DATA_VERSION_1_0_0_0 // ATTENSION !!!!!!!!!!!!!!!!!!!!!!!!!!! // LAST_BARRIER_DATA_VERSION should be the latest barrier data version before DATA_CURRENT_VERSION -#define LAST_BARRIER_DATA_VERSION DATA_VERSION_4_2_1_0 +#define LAST_BARRIER_DATA_VERSION DATA_VERSION_1_0_0_0 #define PROXY_VERSION_4_2_3_0 (oceanbase::common::cal_version(4, 2, 3, 0)) #define PROXY_VERSION_4_3_0_0 (oceanbase::common::cal_version(4, 3, 0, 0)) diff --git a/deps/oblib/src/common/ob_version_provider.h b/deps/oblib/src/common/ob_version_provider.h index 2d6a5de0f..71bc9581e 100644 --- a/deps/oblib/src/common/ob_version_provider.h +++ b/deps/oblib/src/common/ob_version_provider.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_VERSION_PROVIDER_H diff --git a/deps/oblib/src/common/ob_zerofill_info.h b/deps/oblib/src/common/ob_zerofill_info.h index 7492fb2bf..f80e83426 100644 --- a/deps/oblib/src/common/ob_zerofill_info.h +++ b/deps/oblib/src/common/ob_zerofill_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_ZEROFILL_INFO_ diff --git a/deps/oblib/src/common/ob_zone.h b/deps/oblib/src/common/ob_zone.h index 38a67fa05..568fd332a 100644 --- a/deps/oblib/src/common/ob_zone.h +++ b/deps/oblib/src/common/ob_zone.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_ZONE_H_ diff --git a/deps/oblib/src/common/ob_zone_status.h b/deps/oblib/src/common/ob_zone_status.h index 50fb97a06..0c800c04a 100644 --- a/deps/oblib/src/common/ob_zone_status.h +++ b/deps/oblib/src/common/ob_zone_status.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SHARE_OB_ZONE_STATUS_H_ diff --git a/deps/oblib/src/common/ob_zone_type.cpp b/deps/oblib/src/common/ob_zone_type.cpp index fd172f2c8..49aa93624 100644 --- a/deps/oblib/src/common/ob_zone_type.cpp +++ b/deps/oblib/src/common/ob_zone_type.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/common/ob_zone_type.h b/deps/oblib/src/common/ob_zone_type.h index 414a992b1..8600e9636 100644 --- a/deps/oblib/src/common/ob_zone_type.h +++ b/deps/oblib/src/common/ob_zone_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_ZONE_TYPE_H_ diff --git a/deps/oblib/src/common/object/ob_obj_compare.cpp b/deps/oblib/src/common/object/ob_obj_compare.cpp index 674e4e609..ecb15c141 100644 --- a/deps/oblib/src/common/object/ob_obj_compare.cpp +++ b/deps/oblib/src/common/object/ob_obj_compare.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/common/object/ob_obj_compare.h b/deps/oblib/src/common/object/ob_obj_compare.h index daffb2e7e..7d3badd00 100644 --- a/deps/oblib/src/common/object/ob_obj_compare.h +++ b/deps/oblib/src/common/object/ob_obj_compare.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_OBJ_COMPARE_ diff --git a/deps/oblib/src/common/object/ob_obj_funcs.h b/deps/oblib/src/common/object/ob_obj_funcs.h index fd3cfde51..243ec0612 100644 --- a/deps/oblib/src/common/object/ob_obj_funcs.h +++ b/deps/oblib/src/common/object/ob_obj_funcs.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_OBJ_FUNCS_ @@ -695,8 +699,8 @@ DEF_DOUBLE_FUNCS(ObUDoubleType, udouble, double, double); /* defense code*/ \ scale = 64; \ } \ - /* bit 类型最大长度是 64,所以其最多只需要占用 8bytes 空间 */ \ - /* bit_bytes 向上取整 */ \ + /* bit type maximum length is 64, so it only needs to occupy 8 bytes space */ \ + /* bit_bytes round up */ \ const uint8_t bit_bytes = (scale + 8 - 1) / 8; \ return ObBase64Encoder::encode(reinterpret_cast(&v), bit_bytes, buffer, length, pos); \ } else { \ @@ -727,7 +731,7 @@ DEF_BIT_FUNCS(ObBitType, bit, uint64_t); //////////////////// //ObEnumType=32 //ObSetType=33 -//TODO(yts):print函数并不准确 +//TODO(yts):print function is not accurate DEF_NUMERIC_FUNCS(ObEnumType, enum, uint64_t, "%lu", "'%lu'", uint64_t); DEF_NUMERIC_FUNCS(ObSetType, set, uint64_t, "%lu", "'%lu'", uint64_t); @@ -1932,8 +1936,7 @@ inline int obj_print_json(const ObObj &obj, char *buf, int64_t buf_l UNUSED(obj); \ return serialization::encode_length_otimestamp_tz_type(); \ } - -// obj_crc64_v2为了与老版本兼容,进行了特殊处理, 具体原因见struct ObOTimestampDataOld +// obj_crc64_v2 for compatibility with the old version, special processing was done, specific reasons see struct ObOTimestampDataOld #define DEF_ORACLE_TIMESTAMP_CS_FUNCS(OBJTYPE) \ template <> \ inline int64_t obj_crc64(const ObObj &obj, const int64_t current) \ diff --git a/deps/oblib/src/common/object/ob_obj_type.cpp b/deps/oblib/src/common/object/ob_obj_type.cpp index d9cfa59dd..65b4ef70f 100644 --- a/deps/oblib/src/common/object/ob_obj_type.cpp +++ b/deps/oblib/src/common/object/ob_obj_type.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON @@ -975,9 +979,8 @@ const double REAL_MAX_VAL[ObMaxType] = FLT_MAX, DBL_MAX }; - -// [in] pos : 开始查找的位置 -// [out] pos : 匹配的下标;-1表示没有找到 +// [in] pos : start position for search +// [out] pos : matched index; -1 indicates not found int find_type(const ObIArray &type_infos, ObCollationType cs_type, const ObString &val, int32_t &pos) { diff --git a/deps/oblib/src/common/object/ob_obj_type.h b/deps/oblib/src/common/object/ob_obj_type.h index e1a15fd87..c64f8908a 100644 --- a/deps/oblib/src/common/object/ob_obj_type.h +++ b/deps/oblib/src/common/object/ob_obj_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_OBJECT_TYPE_H_ @@ -23,12 +27,11 @@ class ObObjMeta; class ObAccuracy; template class ObIArray; - -// @note Obj类型只能增加,不能删除,顺序也不能变,见ob_obj_cast.h -// @note 增加类型时需要同步修改ObObjTypeClass和ob_obj_type_class(). +// @note Obj type can only be added, not deleted, and the order cannot change, see ob_obj_cast.h +// @note When adding a type, you need to synchronize the modification of ObObjTypeClass and ob_obj_type_class(). enum ObObjType { - ObNullType = 0, // 空类型 + ObNullType = 0, // null type ObTinyIntType = 1, // int8, aka mysql boolean type ObSmallIntType = 2, // int16 @@ -84,8 +87,7 @@ enum ObObjType ObMySQLDateTimeType = 42, // datetime type which is compatible with MySQL. ObRoaringBitmapType = 43, // Roaring Bitmap Type ObMaxType, // invalid type, or count of obj type - - + // ObTimestampLTZType = 47, // timestamp with local time zone for oracle ObTimestampNanoType = 48, // timestamp nanosecond for oracle }; @@ -94,7 +96,7 @@ enum ObObjType enum ObObjOType { ObONotSupport = 0, - ObONullType = 1, // 空类型 + ObONullType = 1, // null type ObOSmallIntType = 2, ObOIntType = 3, ObONumberFloatType = 4, //float @@ -136,9 +138,9 @@ enum class ObGeoType MULTIPOLYGON = 6, GEOMETRYCOLLECTION = 7, GEOTYPEMAX = 31, // 5 bit for geometry type in column schema,set max 31 - // 3d geotype is not supported to define as subtype yet, - // only use for inner type - POINTZ = 1001, + // 3d geotype is not supported to define as subtype yet, + // only use for inner type + POINTZ = 1001, LINESTRINGZ = 1002, POLYGONZ = 1003, MULTIPOINTZ = 1004, @@ -150,7 +152,7 @@ enum class ObGeoType //for cast/cmp map static ObObjOType OBJ_TYPE_TO_O_TYPE[ObMaxType+1] = { - ObONullType, // 空类型 + ObONullType, // null type ObOSmallIntType, // int8, aka mysql boolean type ObOSmallIntType, // int16 ObONotSupport, // int24 @@ -200,7 +202,7 @@ static ObObjOType OBJ_TYPE_TO_O_TYPE[ObMaxType+1] = { ObOCollectionSqlType, //ObCollectionSQLType = 40, ObONotSupport, //ObMySQLDateType = 41, ObONotSupport, //ObMySQLDateTimeType = 42, - ObORoaringBitmapType, //Roaring Bitmap Type = 43, + ObORoaringBitmapType, //Roaring Bitmap Type = 43, ObONotSupport //ObMaxType, }; @@ -229,7 +231,7 @@ enum ObObjTypeClass ObIntervalTC = 19, //oracle interval type class include interval year to month and interval day to second ObRowIDTC = 20, // oracle rowid typeclass, includes urowid and rowid ObLobTC = 21, //oracle lob typeclass - ObJsonTC = 22, // json type class + ObJsonTC = 22, // json type class ObGeometryTC = 23, // geometry type class ObUserDefinedSQLTC = 24, // user defined type class in SQL ObDecimalIntTC = 25, // decimal int class @@ -346,7 +348,7 @@ const ObObjType OBJ_DEFAULT_TYPE[ObActualMaxTC] = static ObObjTypeClass OBJ_O_TYPE_TO_CLASS[ObOMaxType + 1] = { ObMaxTC, //ObONotSupport = 1 - ObNullTC, // ObONullType = 2, // 空类型 + ObNullTC, // ObONullType = 2, // null type ObIntTC, // ObOSmallIntType=3, ObIntTC, // ObOIntType=4, ObNumberTC, // ObOBinFloatType=5, //float @@ -1280,7 +1282,7 @@ OB_INLINE bool ob_is_int_uint(ObObjTypeClass left_tc, ObObjTypeClass right_tc) return (ObIntTC == left_tc && ObUIntTC == right_tc) || (ObIntTC == right_tc && ObUIntTC == left_tc); } -OB_INLINE bool ob_is_int_less_than_64(ObObjType type) +OB_INLINE bool ob_is_int_less_than_64(ObObjType type) { return (ObTinyIntType <= type && type <= ObInt32Type) || (ObUTinyIntType <= type && type <= ObUInt32Type); @@ -1531,7 +1533,7 @@ inline bool ob_is_var_len_type(const ObObjType type) { return ob_is_string_type(type); } inline bool ob_is_collection_sql_type(const ObObjType type) { return ObCollectionSQLType == type; } -inline bool is_lob_storage(const ObObjType type) { return ob_is_large_text(type) +inline bool is_lob_storage(const ObObjType type) { return ob_is_large_text(type) || ob_is_json_tc(type) || ob_is_geometry_tc(type) || ob_is_collection_sql_type(type) @@ -1546,7 +1548,14 @@ inline bool is_decimal_int_accuracy_valid(const int16_t precision, const int16_t } inline bool ob_is_user_defined_pl_type(const ObObjType type) { return ObExtendType == type; } inline bool ob_is_user_defined_type(const ObObjType type) { - return ob_is_user_defined_pl_type(type); + return ob_is_user_defined_pl_type(type); +} +// xml type without schema +inline bool ob_is_xml_sql_type(const ObObjType type, const uint16_t sub_schema_id) { + return (ObUserDefinedSQLType == type) && (sub_schema_id == ObXMLSqlType); +} +inline bool ob_is_xml_pl_type(const ObObjType type, const uint64_t udt_id) { + return (ObExtendType == type) && (udt_id == static_cast(T_OBJ_XML)); } inline bool ob_is_datetime_or_mysql_datetime(const ObObjType type) { diff --git a/deps/oblib/src/common/object/ob_object.cpp b/deps/oblib/src/common/object/ob_object.cpp index 3f9b197af..54d1668f1 100644 --- a/deps/oblib/src/common/object/ob_object.cpp +++ b/deps/oblib/src/common/object/ob_object.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_object.h" @@ -1330,7 +1334,7 @@ int ObObj::check_collation_free_and_compare(const ObObj &other, int &cmp) const LOG_ERROR("unexpected error, invalid argument", K(*this), K(other)); ret = OB_ERR_UNEXPECTED; } else { - // 只用于sortkey转换后的Obj比较 + // Only used for Obj comparison after sortkey conversion const int32_t lhs_len = get_val_len(); const int32_t rhs_len = other.get_val_len(); const int32_t cmp_len = std::min(lhs_len, rhs_len); @@ -1339,16 +1343,16 @@ int ObObj::check_collation_free_and_compare(const ObObj &other, int &cmp) const cmp = memcmp(get_string_ptr(), other.get_string_ptr(), cmp_len); if (is_oracle) { if (0 == cmp) { - // 如果两个字符串只有尾部空格不同,在oracle varchar模式下,认为字符串是不同的 + // If two strings differ only by trailing spaces, they are considered different in Oracle varchar mode if (!is_varying_len_char_type()) { - // 如果两个字符串只有尾部空格不同,在oracle char模式下,认为字符串是相同的 + // If two strings differ only by trailing spaces, they are considered the same in Oracle char mode need_skip_tail_space = true; } else if (lhs_len != cmp_len || rhs_len != cmp_len) { cmp = lhs_len > cmp_len ? 1 : -1; } } } else if (0 == cmp && (lhs_len != cmp_len || rhs_len != cmp_len)) { - // m如果两个字符串只有尾部空格不同,在mysql模式下,认为字符串是相同的 + // If two strings differ only at the end with spaces, they are considered the same in MySQL mode need_skip_tail_space = true; } if (need_skip_tail_space) { @@ -1358,7 +1362,7 @@ int ObObj::check_collation_free_and_compare(const ObObj &other, int &cmp) const const unsigned char *uptr = reinterpret_cast(ptr); int32_t i = 0; uptr += cmp_len; - // varchar或char有长度限制,不可能超过int32_t + // varchar or char has length limit, it is impossible to exceed int32_t for (; i < left_len; ++i) { if (*(uptr + i) != ' ') { has_non_space = true; @@ -1366,7 +1370,7 @@ int ObObj::check_collation_free_and_compare(const ObObj &other, int &cmp) const } } if (has_non_space) { - // mysql特殊行为:a\1 < a,但ab > a + // mysql special behavior: a\1 < a, but ab > a if (*(uptr + i) < ' ') { cmp = lhs_len > cmp_len ? -1 : 1; } else { @@ -1394,7 +1398,7 @@ int ObObj::check_collation_free_and_compare(const ObObj &other) const LOG_ERROR_RET(common::OB_ERR_UNEXPECTED, "unexpected error, invalid argument", K(*this), K(other)); right_to_die_or_duty_to_live(); } else { - // 只用于sortkey转换后的Obj比较 + // Only used for Obj comparison after sortkey conversion const int32_t lhs_len = get_val_len(); const int32_t rhs_len = other.get_val_len(); const int32_t cmp_len = std::min(lhs_len, rhs_len); @@ -1403,16 +1407,16 @@ int ObObj::check_collation_free_and_compare(const ObObj &other) const cmp = memcmp(get_string_ptr(), other.get_string_ptr(), cmp_len); if (is_oracle) { if (0 == cmp) { - // 如果两个字符串只有尾部空格不同,在oracle varchar模式下,认为字符串是不同的 + // If two strings differ only by trailing spaces, in Oracle varchar mode, the strings are considered different if (!is_varying_len_char_type()) { - // 如果两个字符串只有尾部空格不同,在oracle char模式下,认为字符串是相同的 + // If two strings differ only by trailing spaces, they are considered the same in Oracle char mode need_skip_tail_space = true; } else if (lhs_len != cmp_len || rhs_len != cmp_len) { cmp = lhs_len > cmp_len ? 1 : -1; } } } else if (0 == cmp && (lhs_len != cmp_len || rhs_len != cmp_len)) { - // m如果两个字符串只有尾部空格不同,在mysql模式下,认为字符串是相同的 + // If two strings differ only at the trailing spaces, they are considered the same in MySQL mode need_skip_tail_space = true; } if (need_skip_tail_space) { @@ -1422,7 +1426,7 @@ int ObObj::check_collation_free_and_compare(const ObObj &other) const const unsigned char *uptr = reinterpret_cast(ptr); int32_t i = 0; uptr += cmp_len; - // varchar或char有长度限制,不可能超过int32_t + // varchar or char has length limit, it is impossible to exceed int32_t for (; i < left_len; ++i) { if (*(uptr + i) != ' ') { has_non_space = true; @@ -1430,7 +1434,7 @@ int ObObj::check_collation_free_and_compare(const ObObj &other) const } } if (has_non_space) { - // mysql特殊行为:a\1 < a,但ab > a + // mysql special behavior: a\1 < a, but ab > a if (*(uptr + i) < ' ') { cmp = lhs_len > cmp_len ? -1 : 1; } else { @@ -1993,10 +1997,9 @@ int ObObj::get_set_str_val(ObSqlString &str_val, const ObIArray &type_ } return ret; } - -// 当租户模式为 mysql 时,返回 char 的字符长度 -// 当租户模式为 oracle 时,如果 char 的 len 类型为 char,返回 char 的字符长度 -// 当租户模式为 oracle 时,如果 char 的 len 类型为 byte,返回 char 的字节长度 +// When the tenant mode is mysql, return the character length of char +// When the tenant mode is oracle, if the len type of char is char, return the character length of char +// When the tenant mode is oracle, if the len type of char is byte, return the byte length of char int ObObj::get_char_length(const ObAccuracy accuracy, int32_t &char_len, bool is_oracle_mode) const { int ret = OB_SUCCESS; @@ -2228,7 +2231,7 @@ DEF_TO_STRING(ObHexEscapeSqlStr) if (do_oracle_mode_escape_) { for (const char *cur = str_.ptr(); cur < end && buf_pos < buf_len; ++cur) { if ('\'' == *cur) { - //在oracle模式中,只处理单引号转义 + // In oracle mode, only handle single quote escape buf[buf_pos++] = '\''; if (buf_pos < buf_len) { buf[buf_pos++] = *cur; @@ -2261,7 +2264,7 @@ DEF_TO_STRING(ObHexEscapeSqlStr) } case '\'': case '\"': { - //字符串中出现了'或者",需要进行转义 + // A ' or " appeared in the string, it needs to be escaped buf[buf_pos++] = '\\'; if (buf_pos < buf_len) { buf[buf_pos++] = *cur; @@ -2497,4 +2500,3 @@ int ObObjCharacterUtil::print_safe_hex_represent(const ObObj &obj, char* buf, co return ret; } - \ No newline at end of file diff --git a/deps/oblib/src/common/object/ob_object.h b/deps/oblib/src/common/object/ob_object.h index e80d34760..cd0918e29 100644 --- a/deps/oblib/src/common/object/ob_object.h +++ b/deps/oblib/src/common/object/ob_object.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_OBJECT_H_ @@ -1198,6 +1202,13 @@ OB_UNIS_VERSION(1); bool has_lob_header_; // for observer 4.0 compatibility }; +enum class ObDocIDType : uint16_t +{ + INVALID = 0, + TABLET_SEQUENCE, + HIDDEN_INC_PK, +}; + class ObDocId final { public: @@ -2081,9 +2092,8 @@ class ObObj }; // sizeof = 4 ObObjValue v_; // sizeof = 8 }; - -//为每个hash函数创建一个类,其中都包含static方法,方法名为hash,参数类型为const void*, uint64_t, uint64_t. -//is_varchar_hash是为了兼容原来实现murmurhash处理varchar类型时,底层并不是使用murmurhash +// Create a class for each hash function, all containing a static method named hash, with parameter types const void*, uint64_t, uint64_t. +// is_varchar_hash is for compatibility with the original implementation of murmurhash,processing varchar type, where the underlying does not actually use murmurhash struct ObjHashBase { static const bool is_varchar_hash = true; @@ -3227,7 +3237,7 @@ inline int ObObj::get_varchar(ObString &v) const //} //return ret; // - ////// todo 区分varchar和varbinary ; + ////// todo distinguish varchar and varbinary ; return get_string(v); } @@ -3382,8 +3392,7 @@ inline int ObObj::get_enumset_inner_value(ObEnumSetInnerValue &inner_value) cons } return ret; } - -//Obj中所有public的varchar hash方法,以及varchar类型的obj调用hash方法时,都调用了此方法 +// All public varchar hash methods in Obj, as well as hash method calls on varchar type obj, all invoke this method OB_INLINE static uint64_t varchar_hash_with_collation(const ObObj &obj, const ObCollationType cs_type, const uint64_t hash, hash_algo hash_al) @@ -3454,17 +3463,17 @@ int ObObj::to_collation_free_obj(ObObj &dst, bool &is_valid_collation_free, Allo int ret = OB_SUCCESS; const int32_t len = get_string_len(); const bool is_copy_all = true; - const int32_t buf_len = len * 2; // 对于变长类型的sortkey,最多会比原来的字符串占用2倍的空间 + const int32_t buf_len = len * 2; // For variable-length type sortkey, it will occupy at most twice the space of the original string char *buf = NULL; is_valid_collation_free = true; if (!is_character_type()) { ret = OB_INVALID_ARGUMENT; COMMON_LOG(WARN, "invalid argument, only varchar or char can be transformed to collation free obj", K(ret), "obj type", get_type()); - } else { // 对于字符串类型,目前仅考虑char或varchar作为rowkey的场景 + } else { // For string type, currently only consider char or varchar as rowkey scenarios if (0 == len || NULL == get_string_ptr()) { copy_value_or_obj(dst, is_copy_all); - dst.set_collation_type(CS_TYPE_COLLATION_FREE); // TODO: 等九仞把是否比较空格的collation加进来之后,还需要修改 + dst.set_collation_type(CS_TYPE_COLLATION_FREE); // TODO: Wait until Juren adds the collation that compares spaces, then further modification is needed } else { if (OB_ISNULL(buf = static_cast(allocator.alloc(buf_len)))) { ret = OB_ALLOCATE_MEMORY_FAILED; @@ -3690,7 +3699,7 @@ struct ParamFlag uint8_t is_ref_cursor_type_ : 1; // in pl/sql context, this will be true if the local var is a ref cursor uint8_t is_pl_mock_default_param_ : 1; // TRUE if ObObjParam is pl default param uint8_t is_boolean_ : 1; // to distinguish T_BOOL and T_TINYINT - uint8_t is_batch_parameter_ : 1; // 表示是batch参数 + uint8_t is_batch_parameter_ : 1; // indicates it is a batch parameter }; }; diff --git a/deps/oblib/src/common/row/ob_row.cpp b/deps/oblib/src/common/row/ob_row.cpp index 360443c55..55ba79a69 100644 --- a/deps/oblib/src/common/row/ob_row.cpp +++ b/deps/oblib/src/common/row/ob_row.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/common/row/ob_row.h b/deps/oblib/src/common/row/ob_row.h index 1818960cd..17ccfa52c 100644 --- a/deps/oblib/src/common/row/ob_row.h +++ b/deps/oblib/src/common/row/ob_row.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_ROW_ diff --git a/deps/oblib/src/common/row/ob_row_checksum.cpp b/deps/oblib/src/common/row/ob_row_checksum.cpp index 020c0e00a..a95376b96 100644 --- a/deps/oblib/src/common/row/ob_row_checksum.cpp +++ b/deps/oblib/src/common/row/ob_row_checksum.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/common/row/ob_row_checksum.h b/deps/oblib/src/common/row/ob_row_checksum.h index 40c0bf1c6..99b865079 100644 --- a/deps/oblib/src/common/row/ob_row_checksum.h +++ b/deps/oblib/src/common/row/ob_row_checksum.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_ROW_CHECKSUM_H_ diff --git a/deps/oblib/src/common/row/ob_row_desc.cpp b/deps/oblib/src/common/row/ob_row_desc.cpp index 1737d09ab..75f055156 100644 --- a/deps/oblib/src/common/row/ob_row_desc.cpp +++ b/deps/oblib/src/common/row/ob_row_desc.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/common/row/ob_row_desc.h b/deps/oblib/src/common/row/ob_row_desc.h index 4660f2e06..60a06963a 100644 --- a/deps/oblib/src/common/row/ob_row_desc.h +++ b/deps/oblib/src/common/row/ob_row_desc.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_ROW_DESC_ @@ -51,22 +55,22 @@ class ObRowDesc ObRowDesc(); ~ObRowDesc(); /** - * 根据表ID和列ID获得改列在元素数组中的下标 + * Get the index of the column in the element array based on table ID and column ID * - * @param table_id 表ID - * @param column_id 列ID + * @param table_id table ID + * @param column_id column ID * - * @return 下标或者OB_INVALID_INDEX + * @return index or OB_INVALID_INDEX */ int64_t get_idx(const uint64_t table_id, const uint64_t column_id) const; /** - * 根据列下标获得表ID和列ID + * Get table ID and column ID based on column index * * @param idx * @param table_id [out] * @param column_id [out] * - * @return OB_SUCCESS或错误码 + * @return OB_SUCCESS or error code */ int get_tid_cid(const int64_t idx, uint64_t &table_id, uint64_t &column_id) const; diff --git a/deps/oblib/src/common/row/ob_row_iterator.h b/deps/oblib/src/common/row/ob_row_iterator.h index 0bfb61e14..59dcd8060 100644 --- a/deps/oblib/src/common/row/ob_row_iterator.h +++ b/deps/oblib/src/common/row/ob_row_iterator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_ROW_ITERATOR_ diff --git a/deps/oblib/src/common/row/ob_row_store.cpp b/deps/oblib/src/common/row/ob_row_store.cpp index 7266ccc2e..85f422d7e 100644 --- a/deps/oblib/src/common/row/ob_row_store.cpp +++ b/deps/oblib/src/common/row/ob_row_store.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON @@ -505,9 +509,9 @@ void ObRowStore::clear_rows() } /* - * 小心使用,不合理的使用会造成内存泄漏, - * 根据alloc_和自己使用场景的内存管理来决定是否使用此函数, - * 这个函数保留最新分配的block,删除其他的block,效果类似于reuse + * Use with caution, improper use can lead to memory leaks, + * Decide whether to use this function based on memory management with alloc_ and your own usage scenario, + * This function retains the most recently allocated block and deletes other blocks, similar to reuse */ diff --git a/deps/oblib/src/common/row/ob_row_store.h b/deps/oblib/src/common/row/ob_row_store.h index 77a058beb..d915b0e22 100644 --- a/deps/oblib/src/common/row/ob_row_store.h +++ b/deps/oblib/src/common/row/ob_row_store.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_ROW_STORE_H diff --git a/deps/oblib/src/common/row/ob_row_util.cpp b/deps/oblib/src/common/row/ob_row_util.cpp index 6168ebcd8..0c207e7a0 100644 --- a/deps/oblib/src/common/row/ob_row_util.cpp +++ b/deps/oblib/src/common/row/ob_row_util.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/common/row/ob_row_util.h b/deps/oblib/src/common/row/ob_row_util.h index 4df430c2f..adbf7f748 100644 --- a/deps/oblib/src/common/row/ob_row_util.h +++ b/deps/oblib/src/common/row/ob_row_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_ROW_UTIL_ diff --git a/deps/oblib/src/common/rowkey/ob_rowkey.cpp b/deps/oblib/src/common/rowkey/ob_rowkey.cpp index 49e6e78b7..fa70cfe6d 100644 --- a/deps/oblib/src/common/rowkey/ob_rowkey.cpp +++ b/deps/oblib/src/common/rowkey/ob_rowkey.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_rowkey.h" diff --git a/deps/oblib/src/common/rowkey/ob_rowkey.h b/deps/oblib/src/common/rowkey/ob_rowkey.h index 528c23417..ba5119dd0 100644 --- a/deps/oblib/src/common/rowkey/ob_rowkey.h +++ b/deps/oblib/src/common/rowkey/ob_rowkey.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_ROWKEY_H_ diff --git a/deps/oblib/src/common/rowkey/ob_rowkey_info.cpp b/deps/oblib/src/common/rowkey/ob_rowkey_info.cpp index 03043f31e..6a62eb4d5 100644 --- a/deps/oblib/src/common/rowkey/ob_rowkey_info.cpp +++ b/deps/oblib/src/common/rowkey/ob_rowkey_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/rowkey/ob_rowkey_info.h" @@ -481,4 +485,4 @@ bool ObRowkeyInfo::equals(const ObRowkeyInfo &other) const bret = true; } return bret; -} \ No newline at end of file +} diff --git a/deps/oblib/src/common/rowkey/ob_rowkey_info.h b/deps/oblib/src/common/rowkey/ob_rowkey_info.h index 86c8f5e78..a543a8b86 100644 --- a/deps/oblib/src/common/rowkey/ob_rowkey_info.h +++ b/deps/oblib/src/common/rowkey/ob_rowkey_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ROWKEY_INFO_H_ diff --git a/deps/oblib/src/common/rowkey/ob_store_rowkey.cpp b/deps/oblib/src/common/rowkey/ob_store_rowkey.cpp index a03236eee..d9c05beab 100644 --- a/deps/oblib/src/common/rowkey/ob_store_rowkey.cpp +++ b/deps/oblib/src/common/rowkey/ob_store_rowkey.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/rowkey/ob_store_rowkey.h" diff --git a/deps/oblib/src/common/rowkey/ob_store_rowkey.h b/deps/oblib/src/common/rowkey/ob_store_rowkey.h index 278afe700..dcd55c68a 100644 --- a/deps/oblib/src/common/rowkey/ob_store_rowkey.h +++ b/deps/oblib/src/common/rowkey/ob_store_rowkey.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_STORE_ROWKEY_H_ diff --git a/deps/oblib/src/common/server_framework/ob_priority_scheduler.h b/deps/oblib/src/common/server_framework/ob_priority_scheduler.h index b2db46dd1..501a4b6a2 100644 --- a/deps/oblib/src/common/server_framework/ob_priority_scheduler.h +++ b/deps/oblib/src/common/server_framework/ob_priority_scheduler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ namespace oceanbase diff --git a/deps/oblib/src/common/sql_mode/ob_sql_mode.h b/deps/oblib/src/common/sql_mode/ob_sql_mode.h index 605ba6144..15eb71b8c 100644 --- a/deps/oblib/src/common/sql_mode/ob_sql_mode.h +++ b/deps/oblib/src/common/sql_mode/ob_sql_mode.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_SQL_MODE_H diff --git a/deps/oblib/src/common/sql_mode/ob_sql_mode_utils.cpp b/deps/oblib/src/common/sql_mode/ob_sql_mode_utils.cpp index 6f6f68da0..d753afc2d 100644 --- a/deps/oblib/src/common/sql_mode/ob_sql_mode_utils.cpp +++ b/deps/oblib/src/common/sql_mode/ob_sql_mode_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/common/sql_mode/ob_sql_mode_utils.h b/deps/oblib/src/common/sql_mode/ob_sql_mode_utils.h index 446828a6e..bdb9d3e9d 100644 --- a/deps/oblib/src/common/sql_mode/ob_sql_mode_utils.h +++ b/deps/oblib/src/common/sql_mode/ob_sql_mode_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_SQL_MODE_UTILS_H_ diff --git a/deps/oblib/src/common/storage/ob_device_common.h b/deps/oblib/src/common/storage/ob_device_common.h index ca5f6ae4e..f65e6c137 100644 --- a/deps/oblib/src/common/storage/ob_device_common.h +++ b/deps/oblib/src/common/storage/ob_device_common.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef DEF_STORAGE_USE diff --git a/deps/oblib/src/common/storage/ob_fd_simulator.cpp b/deps/oblib/src/common/storage/ob_fd_simulator.cpp index a57118de8..a9ba6d07b 100644 --- a/deps/oblib/src/common/storage/ob_fd_simulator.cpp +++ b/deps/oblib/src/common/storage/ob_fd_simulator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_fd_simulator.h" diff --git a/deps/oblib/src/common/storage/ob_fd_simulator.h b/deps/oblib/src/common/storage/ob_fd_simulator.h index 9f1669887..d066edbc3 100644 --- a/deps/oblib/src/common/storage/ob_fd_simulator.h +++ b/deps/oblib/src/common/storage/ob_fd_simulator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_STORAGE_OB_FD_SIMULATOR_ @@ -88,4 +92,4 @@ class ObFdSimulator { } } -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/common/storage/ob_freeze_define.cpp b/deps/oblib/src/common/storage/ob_freeze_define.cpp index 66e9d28a6..003b595ad 100644 --- a/deps/oblib/src/common/storage/ob_freeze_define.cpp +++ b/deps/oblib/src/common/storage/ob_freeze_define.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/storage/ob_freeze_define.h" diff --git a/deps/oblib/src/common/storage/ob_freeze_define.h b/deps/oblib/src/common/storage/ob_freeze_define.h index e73ecc3e4..18b07b282 100644 --- a/deps/oblib/src/common/storage/ob_freeze_define.h +++ b/deps/oblib/src/common/storage/ob_freeze_define.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_STORAGE_OB_FREEZE_DEFINE_ diff --git a/deps/oblib/src/common/storage/ob_io_device.cpp b/deps/oblib/src/common/storage/ob_io_device.cpp index c3ca71218..db32ca694 100644 --- a/deps/oblib/src/common/storage/ob_io_device.cpp +++ b/deps/oblib/src/common/storage/ob_io_device.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/common/storage/ob_io_device.h b/deps/oblib/src/common/storage/ob_io_device.h index 83adc5e45..0e4b53a1b 100644 --- a/deps/oblib/src/common/storage/ob_io_device.h +++ b/deps/oblib/src/common/storage/ob_io_device.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef DEPS_OBLIB_SRC_COMMON_STORAGE_OB_IO_DEVICE_H_ diff --git a/deps/oblib/src/common/storage/ob_sequence.cpp b/deps/oblib/src/common/storage/ob_sequence.cpp index 402320a65..e87175d57 100644 --- a/deps/oblib/src/common/storage/ob_sequence.cpp +++ b/deps/oblib/src/common/storage/ob_sequence.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/storage/ob_sequence.h" diff --git a/deps/oblib/src/common/storage/ob_sequence.h b/deps/oblib/src/common/storage/ob_sequence.h index 59262a373..0eb4cc774 100644 --- a/deps/oblib/src/common/storage/ob_sequence.h +++ b/deps/oblib/src/common/storage/ob_sequence.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_SEQUENCE_H_ diff --git a/deps/oblib/src/lib/CMakeLists.txt b/deps/oblib/src/lib/CMakeLists.txt index 07ca92851..6d00df9cf 100644 --- a/deps/oblib/src/lib/CMakeLists.txt +++ b/deps/oblib/src/lib/CMakeLists.txt @@ -471,6 +471,11 @@ target_link_directories( ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") +if(BUILD_EMBED_MODE) + set(GOMP_LIB libgomp_embed_static.a) +else() + set(GOMP_LIB libgomp_static.a) +endif() if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") target_link_libraries(oblib_lib PUBLIC @@ -481,10 +486,11 @@ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") libopenblas.a libgfortran_static.a libquadmath_static.a - libgomp_static.a + ${GOMP_LIB} libroaring.a libantlr4-runtime.a libantlr4-autogen.a + libfmt.a ) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") target_link_libraries(oblib_lib @@ -495,10 +501,11 @@ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") libdiskann.a libopenblas.a libgfortran_static.a - libgomp_static.a + ${GOMP_LIB} libroaring.a libantlr4-runtime.a libantlr4-autogen.a + libfmt.a ) else() message(FATAL_ERROR "Unsupported architecture: ${CMAKE_SYSTEM_PROCESSOR}") diff --git a/deps/oblib/src/lib/alloc/abit_set.cpp b/deps/oblib/src/lib/alloc/abit_set.cpp index 8a0527b8c..b6bf4842d 100644 --- a/deps/oblib/src/lib/alloc/abit_set.cpp +++ b/deps/oblib/src/lib/alloc/abit_set.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "abit_set.h" diff --git a/deps/oblib/src/lib/alloc/abit_set.h b/deps/oblib/src/lib/alloc/abit_set.h index 599c285c0..219b81b58 100644 --- a/deps/oblib/src/lib/alloc/abit_set.h +++ b/deps/oblib/src/lib/alloc/abit_set.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_LIB_ALLOC_BIT_SET_H_ diff --git a/deps/oblib/src/lib/alloc/alloc_assist.cpp b/deps/oblib/src/lib/alloc/alloc_assist.cpp index 41f7a5820..db6c0bb61 100644 --- a/deps/oblib/src/lib/alloc/alloc_assist.cpp +++ b/deps/oblib/src/lib/alloc/alloc_assist.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "alloc_assist.h" diff --git a/deps/oblib/src/lib/alloc/alloc_assist.h b/deps/oblib/src/lib/alloc/alloc_assist.h index 25f7a825c..8b632fd7b 100644 --- a/deps/oblib/src/lib/alloc/alloc_assist.h +++ b/deps/oblib/src/lib/alloc/alloc_assist.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_LIB_ALLOC_ALLOC_ASSIST_H_ diff --git a/deps/oblib/src/lib/alloc/alloc_failed_reason.cpp b/deps/oblib/src/lib/alloc/alloc_failed_reason.cpp index 626bebfbf..dcf360080 100644 --- a/deps/oblib/src/lib/alloc/alloc_failed_reason.cpp +++ b/deps/oblib/src/lib/alloc/alloc_failed_reason.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/alloc/alloc_failed_reason.h" diff --git a/deps/oblib/src/lib/alloc/alloc_failed_reason.h b/deps/oblib/src/lib/alloc/alloc_failed_reason.h index 1914f57b1..c1c72cae3 100644 --- a/deps/oblib/src/lib/alloc/alloc_failed_reason.h +++ b/deps/oblib/src/lib/alloc/alloc_failed_reason.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_LIB_ALLOC_FAILED_REASON_H_ diff --git a/deps/oblib/src/lib/alloc/alloc_func.cpp b/deps/oblib/src/lib/alloc/alloc_func.cpp index f69ee2834..2d41128fb 100644 --- a/deps/oblib/src/lib/alloc/alloc_func.cpp +++ b/deps/oblib/src/lib/alloc/alloc_func.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "alloc_func.h" @@ -24,6 +28,11 @@ namespace oceanbase namespace lib { +void set_memory_hard_limit(int64_t bytes) +{ + CHUNK_MGR.set_hard_limit(bytes); +} + void set_memory_limit(int64_t bytes) { CHUNK_MGR.set_limit(bytes); @@ -126,21 +135,12 @@ void ob_set_reserved_memory(const int64_t bytes) } } -void ob_set_urgent_memory(const int64_t bytes) -{ - ObMallocAllocator *allocator = ObMallocAllocator::get_instance(); - if (!OB_ISNULL(allocator)) { - allocator->set_urgent(bytes); - } -} - -int64_t ob_get_reserved_urgent_memory() +int64_t ob_get_reserved_memory() { int64_t bytes = 0; ObMallocAllocator *allocator = ObMallocAllocator::get_instance(); if (!OB_ISNULL(allocator)) { - bytes += allocator->get_urgent(); - bytes += allocator->get_reserved(); + bytes = allocator->get_reserved(); } return bytes; } diff --git a/deps/oblib/src/lib/alloc/alloc_func.h b/deps/oblib/src/lib/alloc/alloc_func.h index a6e3193c7..fbd5adf1a 100644 --- a/deps/oblib/src/lib/alloc/alloc_func.h +++ b/deps/oblib/src/lib/alloc/alloc_func.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _ALLOC_FUNC_H_ @@ -27,6 +31,7 @@ namespace lib // statistic relating struct ObLabel; struct ObMemAttr; +void set_memory_hard_limit(int64_t bytes); void set_memory_limit(int64_t bytes); int64_t get_memory_limit(); int64_t get_memory_hold(); @@ -42,8 +47,7 @@ int64_t get_tenant_memory_remain(uint64_t tenant_id); void get_tenant_label_memory( uint64_t tenant_id, ObLabel &label, common::ObLabelItem &item); void ob_set_reserved_memory(const int64_t bytes); -void ob_set_urgent_memory(const int64_t bytes); -int64_t ob_get_reserved_urgent_memory(); +int64_t ob_get_reserved_memory(); // Set Work Area memory limit for specified tenant. // ms_pctg: percentage limitation of tenant memory can be used by MemStore diff --git a/deps/oblib/src/lib/alloc/alloc_interface.h b/deps/oblib/src/lib/alloc/alloc_interface.h index a4618665a..e5df195d7 100644 --- a/deps/oblib/src/lib/alloc/alloc_interface.h +++ b/deps/oblib/src/lib/alloc/alloc_interface.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _ALLOC_INTERFACE_H_ diff --git a/deps/oblib/src/lib/alloc/alloc_struct.cpp b/deps/oblib/src/lib/alloc/alloc_struct.cpp index b431c1758..b5c59394a 100644 --- a/deps/oblib/src/lib/alloc/alloc_struct.cpp +++ b/deps/oblib/src/lib/alloc/alloc_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/alloc/alloc_struct.h" diff --git a/deps/oblib/src/lib/alloc/alloc_struct.h b/deps/oblib/src/lib/alloc/alloc_struct.h index afd583a8a..353f717a0 100644 --- a/deps/oblib/src/lib/alloc/alloc_struct.h +++ b/deps/oblib/src/lib/alloc/alloc_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _ALLOC_STRUCT_H_ diff --git a/deps/oblib/src/lib/alloc/block_set.cpp b/deps/oblib/src/lib/alloc/block_set.cpp index 46c32738b..7d2d0f1f0 100644 --- a/deps/oblib/src/lib/alloc/block_set.cpp +++ b/deps/oblib/src/lib/alloc/block_set.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ @@ -382,7 +386,7 @@ int64_t BlockSet::sync_wash(int64_t wash_size) if (washed_size > 0) { UNUSED(ATOMIC_FAA(&total_hold_, -washed_size)); UNUSED(ATOMIC_FAA(&total_payload_, -washed_size)); - tallocator_->update_hold(-washed_size); + tallocator_->dec_hold(washed_size); tallocator_->update_wash_stat(related_chunks, washed_blks, washed_size); } #if MEMCHK_LEVEL >= 1 diff --git a/deps/oblib/src/lib/alloc/block_set.h b/deps/oblib/src/lib/alloc/block_set.h index 9a2dbc439..8b05a7ea2 100644 --- a/deps/oblib/src/lib/alloc/block_set.h +++ b/deps/oblib/src/lib/alloc/block_set.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_LIB_ALLOC_BLOCK_SET_H_ diff --git a/deps/oblib/src/lib/alloc/malloc_hook.cpp b/deps/oblib/src/lib/alloc/malloc_hook.cpp index 6879e3b6b..0f23c1468 100644 --- a/deps/oblib/src/lib/alloc/malloc_hook.cpp +++ b/deps/oblib/src/lib/alloc/malloc_hook.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "malloc_hook.h" #include "deps/oblib/src/lib/hash/ob_hashmap.h" diff --git a/deps/oblib/src/lib/alloc/malloc_hook.h b/deps/oblib/src/lib/alloc/malloc_hook.h index db3beb248..2d6a1cd00 100644 --- a/deps/oblib/src/lib/alloc/malloc_hook.h +++ b/deps/oblib/src/lib/alloc/malloc_hook.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef MALLOC_HOOK_H diff --git a/deps/oblib/src/lib/alloc/malloc_hook_extended.cpp b/deps/oblib/src/lib/alloc/malloc_hook_extended.cpp index 0350b1ebc..e8e726167 100644 --- a/deps/oblib/src/lib/alloc/malloc_hook_extended.cpp +++ b/deps/oblib/src/lib/alloc/malloc_hook_extended.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/src/lib/alloc/memory_dump.cpp b/deps/oblib/src/lib/alloc/memory_dump.cpp index d64f735be..fbb3313d3 100644 --- a/deps/oblib/src/lib/alloc/memory_dump.cpp +++ b/deps/oblib/src/lib/alloc/memory_dump.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/lib/alloc/memory_dump.h b/deps/oblib/src/lib/alloc/memory_dump.h index f70bf6870..b1ac9dc58 100644 --- a/deps/oblib/src/lib/alloc/memory_dump.h +++ b/deps/oblib/src/lib/alloc/memory_dump.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_DUMP_MEMORY_H_ diff --git a/deps/oblib/src/lib/alloc/memory_sanity.cpp b/deps/oblib/src/lib/alloc/memory_sanity.cpp index feb43e8e5..131160cf3 100644 --- a/deps/oblib/src/lib/alloc/memory_sanity.cpp +++ b/deps/oblib/src/lib/alloc/memory_sanity.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef ENABLE_SANITY diff --git a/deps/oblib/src/lib/alloc/memory_sanity.h b/deps/oblib/src/lib/alloc/memory_sanity.h index d227a1ba2..13a99524b 100644 --- a/deps/oblib/src/lib/alloc/memory_sanity.h +++ b/deps/oblib/src/lib/alloc/memory_sanity.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _MEMORY_SANITY_H_ diff --git a/deps/oblib/src/lib/alloc/ob_futex_v2.cpp b/deps/oblib/src/lib/alloc/ob_futex_v2.cpp index 9cfc49bf9..ef435bfe5 100644 --- a/deps/oblib/src/lib/alloc/ob_futex_v2.cpp +++ b/deps/oblib/src/lib/alloc/ob_futex_v2.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef ENABLE_SANITY diff --git a/deps/oblib/src/lib/alloc/ob_futex_v2.h b/deps/oblib/src/lib/alloc/ob_futex_v2.h index 10c3eb20d..a3f6da39a 100644 --- a/deps/oblib/src/lib/alloc/ob_futex_v2.h +++ b/deps/oblib/src/lib/alloc/ob_futex_v2.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_FUTEX_v2_H diff --git a/deps/oblib/src/lib/alloc/ob_latch_v2.cpp b/deps/oblib/src/lib/alloc/ob_latch_v2.cpp index e15cda40a..398ad7132 100644 --- a/deps/oblib/src/lib/alloc/ob_latch_v2.cpp +++ b/deps/oblib/src/lib/alloc/ob_latch_v2.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef ENABLE_SANITY diff --git a/deps/oblib/src/lib/alloc/ob_latch_v2.h b/deps/oblib/src/lib/alloc/ob_latch_v2.h index b261f1129..979f78778 100644 --- a/deps/oblib/src/lib/alloc/ob_latch_v2.h +++ b/deps/oblib/src/lib/alloc/ob_latch_v2.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef ENABLE_SANITY diff --git a/deps/oblib/src/lib/alloc/ob_malloc_allocator.cpp b/deps/oblib/src/lib/alloc/ob_malloc_allocator.cpp index 0a5ad196e..522e4c363 100644 --- a/deps/oblib/src/lib/alloc/ob_malloc_allocator.cpp +++ b/deps/oblib/src/lib/alloc/ob_malloc_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -42,7 +46,7 @@ namespace lib ObMallocAllocator::ObMallocAllocator() : allocator_(NULL), - reserved_(0), urgent_(0), max_used_tenant_id_(0), create_on_demand_(false) + reserved_(0), max_used_tenant_id_(0), create_on_demand_(false) { set_root_allocator(); is_inited_ = true; @@ -292,16 +296,6 @@ void ObMallocAllocator::print_tenant_memory_usage(uint64_t tenant_id) const UNUSED(ret); } -void ObMallocAllocator::set_urgent(int64_t bytes) -{ - CHUNK_MGR.set_urgent(bytes); -} - -int64_t ObMallocAllocator::get_urgent() const -{ - return CHUNK_MGR.get_urgent(); -} - void ObMallocAllocator::set_reserved(int64_t bytes) { reserved_ = bytes; diff --git a/deps/oblib/src/lib/alloc/ob_malloc_allocator.h b/deps/oblib/src/lib/alloc/ob_malloc_allocator.h index 2e4f04daf..40ab62d74 100644 --- a/deps/oblib/src/lib/alloc/ob_malloc_allocator.h +++ b/deps/oblib/src/lib/alloc/ob_malloc_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_MALLOC_ALLOCATOR_H_ @@ -114,8 +118,6 @@ class ObMallocAllocator ObTenantCtxAllocatorGuard get_tenant_ctx_allocator_unrecycled(uint64_t tenant_id, uint64_t ctx_id) const; // statistic relating - void set_urgent(int64_t bytes); - int64_t get_urgent() const; void set_reserved(int64_t bytes); int64_t get_reserved() const; int set_tenant_limit(uint64_t tenant_id, int64_t bytes); @@ -156,7 +158,6 @@ class ObMallocAllocator private: ObTenantCtxAllocatorV2 *allocator_; int64_t reserved_; - int64_t urgent_; uint64_t max_used_tenant_id_; bool create_on_demand_; }; // end of class ObMallocAllocator diff --git a/deps/oblib/src/lib/alloc/ob_malloc_callback.cpp b/deps/oblib/src/lib/alloc/ob_malloc_callback.cpp index 8314717de..e6746b9ac 100644 --- a/deps/oblib/src/lib/alloc/ob_malloc_callback.cpp +++ b/deps/oblib/src/lib/alloc/ob_malloc_callback.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_malloc_callback.h" @@ -60,4 +64,4 @@ ObMallocCallbackGuard::~ObMallocCallbackGuard() } } -} \ No newline at end of file +} diff --git a/deps/oblib/src/lib/alloc/ob_malloc_callback.h b/deps/oblib/src/lib/alloc/ob_malloc_callback.h index b81123daa..02c8955af 100644 --- a/deps/oblib/src/lib/alloc/ob_malloc_callback.h +++ b/deps/oblib/src/lib/alloc/ob_malloc_callback.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_MALLOC_CALLBACK_H_ @@ -56,4 +60,4 @@ class ObMallocCallbackGuard } // end of namespace lib } // end of namespace oceanbase -#endif /* _OB_MALLOC_CALLBACK_H_ */ \ No newline at end of file +#endif /* _OB_MALLOC_CALLBACK_H_ */ diff --git a/deps/oblib/src/lib/alloc/ob_malloc_sample_struct.cpp b/deps/oblib/src/lib/alloc/ob_malloc_sample_struct.cpp index 36fbed458..0d74b0390 100644 --- a/deps/oblib/src/lib/alloc/ob_malloc_sample_struct.cpp +++ b/deps/oblib/src/lib/alloc/ob_malloc_sample_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/alloc/ob_malloc_sample_struct.h" diff --git a/deps/oblib/src/lib/alloc/ob_malloc_sample_struct.h b/deps/oblib/src/lib/alloc/ob_malloc_sample_struct.h index 90d3e226a..4c26ec249 100644 --- a/deps/oblib/src/lib/alloc/ob_malloc_sample_struct.h +++ b/deps/oblib/src/lib/alloc/ob_malloc_sample_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_MALLOC_SAMPLE_STRUCT_H_ diff --git a/deps/oblib/src/lib/alloc/ob_malloc_time_monitor.cpp b/deps/oblib/src/lib/alloc/ob_malloc_time_monitor.cpp index 773fc59f2..2fa01525f 100644 --- a/deps/oblib/src/lib/alloc/ob_malloc_time_monitor.cpp +++ b/deps/oblib/src/lib/alloc/ob_malloc_time_monitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/alloc/ob_malloc_time_monitor.h b/deps/oblib/src/lib/alloc/ob_malloc_time_monitor.h index f5c07ebd1..a6e38e03a 100644 --- a/deps/oblib/src/lib/alloc/ob_malloc_time_monitor.h +++ b/deps/oblib/src/lib/alloc/ob_malloc_time_monitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEABASE_MALLOC_TIME_MONITOR_H_ @@ -21,7 +25,7 @@ namespace lib class ObMallocTimeMonitor { public: - static const int64_t WARN_THRESHOLD = 100000; + static const int64_t WARN_THRESHOLD = 10000000; ObMallocTimeMonitor() { MEMSET(this, 0, sizeof(*this)); diff --git a/deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.cpp b/deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.cpp index 99d53dea3..5dd0d176c 100644 --- a/deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.cpp +++ b/deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -136,7 +140,7 @@ int ObTenantCtxAllocatorV2::iter_label(VisitFunc func) const void ObTenantCtxAllocatorV2::print_usage() const { int ret = OB_SUCCESS; - static const int64_t BUFLEN = 1 << 17; + static const int64_t BUFLEN = 1 << 18; // 256k SMART_VAR(char[BUFLEN], buf) { int64_t pos = 0; int64_t ctx_hold_bytes = 0; @@ -253,32 +257,21 @@ void ObTenantCtxAllocator::free_chunk(AChunk *chunk, const ObMemAttr &attr) ctx_allocator_.free_chunk(chunk, attr); } } -bool ObTenantCtxAllocator::update_hold(const int64_t size) + +// bytes need to be positive +void ObTenantCtxAllocator::dec_hold(const int64_t size) { - return ctx_allocator_.update_hold(size); + ctx_allocator_.dec_hold(size); } -bool ObTenantCtxAllocatorV2::update_hold(const int64_t size) +void ObTenantCtxAllocatorV2::dec_hold(const int64_t size) { - bool update = false; if (!resource_handle_.is_valid()) { LIB_LOG_RET(ERROR, OB_INVALID_ARGUMENT, "resource_handle is invalid", K_(tenant_id), K_(ctx_id)); } else { bool reach_ctx_limit = false; - if (size <=0) { - resource_handle_.get_memory_mgr()->update_hold(size, ctx_id_, ObLabel(), reach_ctx_limit); - AChunkMgr::instance().update_hold(size, false); - update = true; - } else { - if (!resource_handle_.get_memory_mgr()->update_hold(size, ctx_id_, ObLabel(), reach_ctx_limit)) { - // do-nothing - } else if (!AChunkMgr::instance().update_hold(size, false)) { - resource_handle_.get_memory_mgr()->update_hold(-size, ctx_id_, ObLabel(), reach_ctx_limit); - } else { - update = true; - } - } + resource_handle_.get_memory_mgr()->update_hold(-size, ctx_id_, ObLabel(), reach_ctx_limit); + AChunkMgr::instance().dec_hold(size); } - return update; } int ObTenantCtxAllocator::set_idle(const int64_t set_size, const bool reserve/*=false*/) diff --git a/deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h b/deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h index 13be1035b..c40325a6e 100644 --- a/deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h +++ b/deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TENANT_CTX_ALLOCATOR_H_ @@ -80,7 +84,7 @@ class ObTenantCtxAllocatorV2 : private common::ObLink resource_handle_.get_memory_mgr()->free_chunk(chunk, attr); } } - bool update_hold(const int64_t size); + void dec_hold(const int64_t size); // statistic related int set_tenant_memory_mgr() { @@ -94,6 +98,19 @@ class ObTenantCtxAllocatorV2 : private common::ObLink } return ret; } + + int set_hard_limit(int64_t bytes) + { + int ret = common::OB_SUCCESS; + if (!resource_handle_.is_valid()) { + ret = common::OB_ERR_UNEXPECTED; + LIB_LOG(ERROR, "resource_handle is invalid", K(ret), K_(tenant_id), K_(ctx_id)); + } else if (OB_FAIL(resource_handle_.get_memory_mgr()->set_ctx_hard_limit(ctx_id_, bytes))) { + LIB_LOG(WARN, "memory manager set_ctx_limit failed", K(ret), K(ctx_id_), K(bytes)); + } + return ret; + } + int set_limit(int64_t bytes) { int ret = common::OB_SUCCESS; @@ -387,6 +404,7 @@ class AChunkUsingList static int64_t get_obj_hold(void *ptr); // statistic related + int set_hard_limit(int64_t bytes) { return ctx_allocator_.set_hard_limit(bytes); } int set_limit(int64_t bytes) { return ctx_allocator_.set_limit(bytes); } int64_t get_limit() const { return ctx_allocator_.get_limit(); } @@ -403,7 +421,7 @@ class AChunkUsingList void print_memory_usage() const { ctx_allocator_.print_usage(); } AChunk *alloc_chunk(const int64_t size, const ObMemAttr &attr); void free_chunk(AChunk *chunk, const ObMemAttr &attr); - bool update_hold(const int64_t size); + void dec_hold(const int64_t size); int set_idle(const int64_t size, const bool reserve = false); IBlockMgr &get_block_mgr() { return obj_mgr_; } IChunkMgr &get_chunk_mgr() { return chunk_mgr_; } diff --git a/deps/oblib/src/lib/alloc/object_mgr.cpp b/deps/oblib/src/lib/alloc/object_mgr.cpp index 6a779843b..24b57a560 100644 --- a/deps/oblib/src/lib/alloc/object_mgr.cpp +++ b/deps/oblib/src/lib/alloc/object_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "object_mgr.h" diff --git a/deps/oblib/src/lib/alloc/object_mgr.h b/deps/oblib/src/lib/alloc/object_mgr.h index 39643eb17..790d4c97a 100644 --- a/deps/oblib/src/lib/alloc/object_mgr.h +++ b/deps/oblib/src/lib/alloc/object_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_LIB_ALLOC_OBJECT_MGR_H_ diff --git a/deps/oblib/src/lib/alloc/object_set.cpp b/deps/oblib/src/lib/alloc/object_set.cpp index fe0f69bb4..ad86f7413 100644 --- a/deps/oblib/src/lib/alloc/object_set.cpp +++ b/deps/oblib/src/lib/alloc/object_set.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "object_set.h" @@ -936,4 +940,4 @@ AObject *ObjectSetV2::realloc_object(AObject *obj, const uint64_t size, const Ob } return new_obj; -} \ No newline at end of file +} diff --git a/deps/oblib/src/lib/alloc/object_set.h b/deps/oblib/src/lib/alloc/object_set.h index 2a35a92c1..295e04330 100644 --- a/deps/oblib/src/lib/alloc/object_set.h +++ b/deps/oblib/src/lib/alloc/object_set.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_LIB_ALLOC_OBJECT_SET_H_ diff --git a/deps/oblib/src/lib/allocator/ob_allocator.cpp b/deps/oblib/src/lib/allocator/ob_allocator.cpp index 0800adcc0..c636218ea 100644 --- a/deps/oblib/src/lib/allocator/ob_allocator.cpp +++ b/deps/oblib/src/lib/allocator/ob_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ using namespace oceanbase; @@ -16,4 +20,4 @@ using namespace common; ObWrapperAllocatorWithAttr::ObWrapperAllocatorWithAttr(ObIAllocator *alloc, ObMemAttr attr = ObMemAttr()) - : ObWrapperAllocator(alloc), mem_attr_(attr) {}; \ No newline at end of file + : ObWrapperAllocator(alloc), mem_attr_(attr) {}; diff --git a/deps/oblib/src/lib/allocator/ob_allocator.h b/deps/oblib/src/lib/allocator/ob_allocator.h index 9d20ae0fb..b5ba55f12 100644 --- a/deps/oblib/src/lib/allocator/ob_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_IALLOCATOR_H_ diff --git a/deps/oblib/src/lib/allocator/ob_allocator_v2.cpp b/deps/oblib/src/lib/allocator/ob_allocator_v2.cpp index 52f431712..1fc1a7a81 100644 --- a/deps/oblib/src/lib/allocator/ob_allocator_v2.cpp +++ b/deps/oblib/src/lib/allocator/ob_allocator_v2.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/allocator/ob_allocator_v2.h" diff --git a/deps/oblib/src/lib/allocator/ob_allocator_v2.h b/deps/oblib/src/lib/allocator/ob_allocator_v2.h index 7a69a0ca8..e31f126ec 100644 --- a/deps/oblib/src/lib/allocator/ob_allocator_v2.h +++ b/deps/oblib/src/lib/allocator/ob_allocator_v2.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_ALLOCATOR_H_ diff --git a/deps/oblib/src/lib/allocator/ob_asan_allocator.h b/deps/oblib/src/lib/allocator/ob_asan_allocator.h index da1f309ea..9c9621e75 100644 --- a/deps/oblib/src/lib/allocator/ob_asan_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_asan_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_ASAN_ALLOCATOR_H_ diff --git a/deps/oblib/src/lib/allocator/ob_block_alloc_mgr.cpp b/deps/oblib/src/lib/allocator/ob_block_alloc_mgr.cpp index 1f7b665ed..ba1f11afe 100644 --- a/deps/oblib/src/lib/allocator/ob_block_alloc_mgr.cpp +++ b/deps/oblib/src/lib/allocator/ob_block_alloc_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/allocator/ob_block_alloc_mgr.h" diff --git a/deps/oblib/src/lib/allocator/ob_block_alloc_mgr.h b/deps/oblib/src/lib/allocator/ob_block_alloc_mgr.h index 061be89dd..c06b55c74 100644 --- a/deps/oblib/src/lib/allocator/ob_block_alloc_mgr.h +++ b/deps/oblib/src/lib/allocator/ob_block_alloc_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ALLOCATOR_OB_BLOCK_ALLOC_MGR_H_ diff --git a/deps/oblib/src/lib/allocator/ob_cached_allocator.h b/deps/oblib/src/lib/allocator/ob_cached_allocator.h index c5d8d9cfa..c162873e4 100644 --- a/deps/oblib/src/lib/allocator/ob_cached_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_cached_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBAE_LIB_ALLOCATER_OB_CACHED_ALLOCATOR_H_ diff --git a/deps/oblib/src/lib/allocator/ob_concurrent_fifo_allocator.cpp b/deps/oblib/src/lib/allocator/ob_concurrent_fifo_allocator.cpp index b4b83a871..51d1ab559 100644 --- a/deps/oblib/src/lib/allocator/ob_concurrent_fifo_allocator.cpp +++ b/deps/oblib/src/lib/allocator/ob_concurrent_fifo_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/allocator/ob_concurrent_fifo_allocator.h" diff --git a/deps/oblib/src/lib/allocator/ob_concurrent_fifo_allocator.h b/deps/oblib/src/lib/allocator/ob_concurrent_fifo_allocator.h index fd4bf1550..a89448733 100644 --- a/deps/oblib/src/lib/allocator/ob_concurrent_fifo_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_concurrent_fifo_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_CONCURRENT_FIFO_ALLOCATOR_H_ diff --git a/deps/oblib/src/lib/allocator/ob_ctx_define.cpp b/deps/oblib/src/lib/allocator/ob_ctx_define.cpp index 83e30bd66..7ed35180c 100644 --- a/deps/oblib/src/lib/allocator/ob_ctx_define.cpp +++ b/deps/oblib/src/lib/allocator/ob_ctx_define.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/allocator/ob_ctx_define.h" diff --git a/deps/oblib/src/lib/allocator/ob_ctx_define.h b/deps/oblib/src/lib/allocator/ob_ctx_define.h index b2645165d..261b554aa 100644 --- a/deps/oblib/src/lib/allocator/ob_ctx_define.h +++ b/deps/oblib/src/lib/allocator/ob_ctx_define.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_CTX_DEFINE_H_ diff --git a/deps/oblib/src/lib/allocator/ob_delay_free_allocator.cpp b/deps/oblib/src/lib/allocator/ob_delay_free_allocator.cpp index 541233bc8..5be3574b7 100644 --- a/deps/oblib/src/lib/allocator/ob_delay_free_allocator.cpp +++ b/deps/oblib/src/lib/allocator/ob_delay_free_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/allocator/ob_delay_free_allocator.h" diff --git a/deps/oblib/src/lib/allocator/ob_delay_free_allocator.h b/deps/oblib/src/lib/allocator/ob_delay_free_allocator.h index 528b81258..acd2772bf 100644 --- a/deps/oblib/src/lib/allocator/ob_delay_free_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_delay_free_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_DELAY_FREE_ALLOCATOR_H_ diff --git a/deps/oblib/src/lib/allocator/ob_external_ref.h b/deps/oblib/src/lib/allocator/ob_external_ref.h index 9787a3e37..434b07b36 100644 --- a/deps/oblib/src/lib/allocator/ob_external_ref.h +++ b/deps/oblib/src/lib/allocator/ob_external_ref.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ALLOCATOR_OB_EXTERNAL_REF_H_ diff --git a/deps/oblib/src/lib/allocator/ob_fifo_allocator.cpp b/deps/oblib/src/lib/allocator/ob_fifo_allocator.cpp index d89224b0a..81c10154e 100644 --- a/deps/oblib/src/lib/allocator/ob_fifo_allocator.cpp +++ b/deps/oblib/src/lib/allocator/ob_fifo_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/lib/allocator/ob_fifo_allocator.h b/deps/oblib/src/lib/allocator/ob_fifo_allocator.h index f216446e2..a7669d429 100644 --- a/deps/oblib/src/lib/allocator/ob_fifo_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_fifo_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_ALLOCATOR_NORMAL_FIFO_ diff --git a/deps/oblib/src/lib/allocator/ob_fixed_size_block_allocator.h b/deps/oblib/src/lib/allocator/ob_fixed_size_block_allocator.h index bee6f0948..311c09d0a 100644 --- a/deps/oblib/src/lib/allocator/ob_fixed_size_block_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_fixed_size_block_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_FIXED_SIZE_BLOCK_ALLOCATOR_H_ diff --git a/deps/oblib/src/lib/allocator/ob_hazard_ref.cpp b/deps/oblib/src/lib/allocator/ob_hazard_ref.cpp index 0c525e3e7..25b783bdf 100644 --- a/deps/oblib/src/lib/allocator/ob_hazard_ref.cpp +++ b/deps/oblib/src/lib/allocator/ob_hazard_ref.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/allocator/ob_hazard_ref.h" diff --git a/deps/oblib/src/lib/allocator/ob_hazard_ref.h b/deps/oblib/src/lib/allocator/ob_hazard_ref.h index afd88e612..9615e49ef 100644 --- a/deps/oblib/src/lib/allocator/ob_hazard_ref.h +++ b/deps/oblib/src/lib/allocator/ob_hazard_ref.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ALLOCATOR_OB_HAZARD_REF_H_ diff --git a/deps/oblib/src/lib/allocator/ob_heavy_ref.h b/deps/oblib/src/lib/allocator/ob_heavy_ref.h index b338a0185..00b2e7f43 100644 --- a/deps/oblib/src/lib/allocator/ob_heavy_ref.h +++ b/deps/oblib/src/lib/allocator/ob_heavy_ref.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ALLOCATOR_OB_HEAVY_REF_H_ diff --git a/deps/oblib/src/lib/allocator/ob_lf_fifo_allocator.h b/deps/oblib/src/lib/allocator/ob_lf_fifo_allocator.h index febeded0c..12c15c64b 100644 --- a/deps/oblib/src/lib/allocator/ob_lf_fifo_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_lf_fifo_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ALLOCATOR_OB_LF_FIFO_ALLOCATOR_V2_H_ diff --git a/deps/oblib/src/lib/allocator/ob_libeasy_mem_pool.cpp b/deps/oblib/src/lib/allocator/ob_libeasy_mem_pool.cpp index ff6080421..a253650a1 100644 --- a/deps/oblib/src/lib/allocator/ob_libeasy_mem_pool.cpp +++ b/deps/oblib/src/lib/allocator/ob_libeasy_mem_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/allocator/ob_libeasy_mem_pool.h" diff --git a/deps/oblib/src/lib/allocator/ob_libeasy_mem_pool.h b/deps/oblib/src/lib/allocator/ob_libeasy_mem_pool.h index 8c518d321..77744f2b2 100644 --- a/deps/oblib/src/lib/allocator/ob_libeasy_mem_pool.h +++ b/deps/oblib/src/lib/allocator/ob_libeasy_mem_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_LIBEASY_MEM_POOL_H diff --git a/deps/oblib/src/lib/allocator/ob_malloc.cpp b/deps/oblib/src/lib/allocator/ob_malloc.cpp index 156e57632..7c52c3c19 100644 --- a/deps/oblib/src/lib/allocator/ob_malloc.cpp +++ b/deps/oblib/src/lib/allocator/ob_malloc.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_malloc.h" diff --git a/deps/oblib/src/lib/allocator/ob_malloc.h b/deps/oblib/src/lib/allocator/ob_malloc.h index cebd8ecaa..7dd783a46 100644 --- a/deps/oblib/src/lib/allocator/ob_malloc.h +++ b/deps/oblib/src/lib/allocator/ob_malloc.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_MALLOC_H_ diff --git a/deps/oblib/src/lib/allocator/ob_mem_leak_checker.cpp b/deps/oblib/src/lib/allocator/ob_mem_leak_checker.cpp index 18f1ffe1a..8f9748e3e 100644 --- a/deps/oblib/src/lib/allocator/ob_mem_leak_checker.cpp +++ b/deps/oblib/src/lib/allocator/ob_mem_leak_checker.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/allocator/ob_mem_leak_checker.h" diff --git a/deps/oblib/src/lib/allocator/ob_mem_leak_checker.h b/deps/oblib/src/lib/allocator/ob_mem_leak_checker.h index 61b6e4ed6..7fe56d47d 100644 --- a/deps/oblib/src/lib/allocator/ob_mem_leak_checker.h +++ b/deps/oblib/src/lib/allocator/ob_mem_leak_checker.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __OB_MEM_LEAK_CHECKER_H__ diff --git a/deps/oblib/src/lib/allocator/ob_mod_define.cpp b/deps/oblib/src/lib/allocator/ob_mod_define.cpp index 3bebfc2b9..d0ed48cb6 100644 --- a/deps/oblib/src/lib/allocator/ob_mod_define.cpp +++ b/deps/oblib/src/lib/allocator/ob_mod_define.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/deps/oblib/src/lib/allocator/ob_mod_define.h b/deps/oblib/src/lib/allocator/ob_mod_define.h index 1673605b8..edc04108f 100644 --- a/deps/oblib/src/lib/allocator/ob_mod_define.h +++ b/deps/oblib/src/lib/allocator/ob_mod_define.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef CTX_ITEM_DEF diff --git a/deps/oblib/src/lib/allocator/ob_page_manager.cpp b/deps/oblib/src/lib/allocator/ob_page_manager.cpp index 2d985d6b2..3e4bfa62b 100644 --- a/deps/oblib/src/lib/allocator/ob_page_manager.cpp +++ b/deps/oblib/src/lib/allocator/ob_page_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/allocator/ob_page_manager.h" diff --git a/deps/oblib/src/lib/allocator/ob_page_manager.h b/deps/oblib/src/lib/allocator/ob_page_manager.h index bf5a3203d..69556f702 100644 --- a/deps/oblib/src/lib/allocator/ob_page_manager.h +++ b/deps/oblib/src/lib/allocator/ob_page_manager.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_PAGE_MANAGER_H_ diff --git a/deps/oblib/src/lib/allocator/ob_pooled_allocator.h b/deps/oblib/src/lib/allocator/ob_pooled_allocator.h index be4c15ed8..418ce8f39 100644 --- a/deps/oblib/src/lib/allocator/ob_pooled_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_pooled_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_ALLOCATOR_OB_POOLED_ALLOCATOR_H_ diff --git a/deps/oblib/src/lib/allocator/ob_qsync.h b/deps/oblib/src/lib/allocator/ob_qsync.h index bbdc86279..abe35c9c5 100644 --- a/deps/oblib/src/lib/allocator/ob_qsync.h +++ b/deps/oblib/src/lib/allocator/ob_qsync.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_QSYNC_ diff --git a/deps/oblib/src/lib/allocator/ob_retire_station.h b/deps/oblib/src/lib/allocator/ob_retire_station.h index bfbd7eddb..4cc0e3e10 100644 --- a/deps/oblib/src/lib/allocator/ob_retire_station.h +++ b/deps/oblib/src/lib/allocator/ob_retire_station.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ALLOCATOR_OB_RETIRE_STATION_H_ diff --git a/deps/oblib/src/lib/allocator/ob_safe_arena.h b/deps/oblib/src/lib/allocator/ob_safe_arena.h index 3e5268784..8ecc30090 100644 --- a/deps/oblib/src/lib/allocator/ob_safe_arena.h +++ b/deps/oblib/src/lib/allocator/ob_safe_arena.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_SAFE_ARENA_H__ diff --git a/deps/oblib/src/lib/allocator/ob_simple_fifo_alloc.h b/deps/oblib/src/lib/allocator/ob_simple_fifo_alloc.h index 89e2a66ab..e06a9da70 100644 --- a/deps/oblib/src/lib/allocator/ob_simple_fifo_alloc.h +++ b/deps/oblib/src/lib/allocator/ob_simple_fifo_alloc.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ALLOCATOR_OB_SIMPLE_FIFO_ALLOC_H_ diff --git a/deps/oblib/src/lib/allocator/ob_slice_alloc.cpp b/deps/oblib/src/lib/allocator/ob_slice_alloc.cpp index 73f397184..d73edb6f3 100644 --- a/deps/oblib/src/lib/allocator/ob_slice_alloc.cpp +++ b/deps/oblib/src/lib/allocator/ob_slice_alloc.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_slice_alloc.h" diff --git a/deps/oblib/src/lib/allocator/ob_slice_alloc.h b/deps/oblib/src/lib/allocator/ob_slice_alloc.h index b9ffa187e..fc967ae24 100644 --- a/deps/oblib/src/lib/allocator/ob_slice_alloc.h +++ b/deps/oblib/src/lib/allocator/ob_slice_alloc.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ALLOCATOR_OB_SLICE_ALLOC_H_ diff --git a/deps/oblib/src/lib/allocator/ob_small_allocator.h b/deps/oblib/src/lib/allocator/ob_small_allocator.h index e6cd63c42..30cbf2f3a 100644 --- a/deps/oblib/src/lib/allocator/ob_small_allocator.h +++ b/deps/oblib/src/lib/allocator/ob_small_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ALLOCATOR_OB_SMALL_ALLOCATOR_V2_H_ diff --git a/deps/oblib/src/lib/allocator/ob_tc_malloc.cpp b/deps/oblib/src/lib/allocator/ob_tc_malloc.cpp index e48f13941..a59517bc6 100644 --- a/deps/oblib/src/lib/allocator/ob_tc_malloc.cpp +++ b/deps/oblib/src/lib/allocator/ob_tc_malloc.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_ALLOC diff --git a/deps/oblib/src/lib/allocator/ob_tc_malloc.h b/deps/oblib/src/lib/allocator/ob_tc_malloc.h index 2633cebb0..f0c36a266 100644 --- a/deps/oblib/src/lib/allocator/ob_tc_malloc.h +++ b/deps/oblib/src/lib/allocator/ob_tc_malloc.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __OB_COMMON_OB_BLOCK_ALLOCATOR_H__ diff --git a/deps/oblib/src/lib/allocator/ob_vslice_alloc.h b/deps/oblib/src/lib/allocator/ob_vslice_alloc.h index d8fc8578d..dfc70d39b 100644 --- a/deps/oblib/src/lib/allocator/ob_vslice_alloc.h +++ b/deps/oblib/src/lib/allocator/ob_vslice_alloc.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ALLOCATOR_OB_VSLICE_ALLOC_H_ diff --git a/deps/oblib/src/lib/allocator/page_arena.h b/deps/oblib/src/lib/allocator/page_arena.h index 980900dd1..f8f16ef87 100644 --- a/deps/oblib/src/lib/allocator/page_arena.h +++ b/deps/oblib/src/lib/allocator/page_arena.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_PAGE_ARENA_H_ diff --git a/deps/oblib/src/lib/ash/ob_active_session_guard.cpp b/deps/oblib/src/lib/ash/ob_active_session_guard.cpp index 61df21259..406f43a5a 100644 --- a/deps/oblib/src/lib/ash/ob_active_session_guard.cpp +++ b/deps/oblib/src/lib/ash/ob_active_session_guard.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE @@ -431,10 +435,10 @@ ObBackgroundSessionIdGenerator &ObBackgroundSessionIdGenerator::get_instance() { // | Local Seq |1|2|3|4| // +---------------------------+----------------------------------------+ // -// Local Seq: 从0递增的int64原子变量 -// 1: rpc请求置为1 -// 2: 后台会话置为1 -// 3: inner sql置为1 +// Local Seq: an int64 atomic variable that increments from 0 +// 1: rpc request set to 1 +// 2: Set background session to 1 +// 3: set inner sql to 1 // 4: reserved // Roughly speaking, over 500k ids would be consumed over 1 minutes. uint64_t ObBackgroundSessionIdGenerator::get_next_rpc_session_id() { @@ -486,4 +490,4 @@ void ObQueryRetryAshGuard::setup_info(ObQueryRetryAshInfo &info) void ObQueryRetryAshGuard::reset_info() { info_ = nullptr; -} \ No newline at end of file +} diff --git a/deps/oblib/src/lib/ash/ob_active_session_guard.h b/deps/oblib/src/lib/ash/ob_active_session_guard.h index 8576c91e9..59a5c2d90 100644 --- a/deps/oblib/src/lib/ash/ob_active_session_guard.h +++ b/deps/oblib/src/lib/ash/ob_active_session_guard.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_SHARE_ASH_ACTIVE_SESSION_GUARD_H_ diff --git a/deps/oblib/src/lib/ash/ob_ash_bkgd_sess_inactive_guard.cpp b/deps/oblib/src/lib/ash/ob_ash_bkgd_sess_inactive_guard.cpp index 579855ffe..1a8a75d93 100644 --- a/deps/oblib/src/lib/ash/ob_ash_bkgd_sess_inactive_guard.cpp +++ b/deps/oblib/src/lib/ash/ob_ash_bkgd_sess_inactive_guard.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE diff --git a/deps/oblib/src/lib/ash/ob_ash_bkgd_sess_inactive_guard.h b/deps/oblib/src/lib/ash/ob_ash_bkgd_sess_inactive_guard.h index 2c76ac1ea..0118e79c0 100644 --- a/deps/oblib/src/lib/ash/ob_ash_bkgd_sess_inactive_guard.h +++ b/deps/oblib/src/lib/ash/ob_ash_bkgd_sess_inactive_guard.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_SHARE_ASH_BKGD_SESS_INACTIVE_GUARD_H_ diff --git a/deps/oblib/src/lib/asmdefs.h b/deps/oblib/src/lib/asmdefs.h index 352d6af42..896a1ee4d 100644 --- a/deps/oblib/src/lib/asmdefs.h +++ b/deps/oblib/src/lib/asmdefs.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _ASMDEFS_H diff --git a/deps/oblib/src/lib/atomic/atomic128.h b/deps/oblib/src/lib/atomic/atomic128.h index 845ddf6dd..c523345d9 100644 --- a/deps/oblib/src/lib/atomic/atomic128.h +++ b/deps/oblib/src/lib/atomic/atomic128.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_CLOG_ATOMIC128_ diff --git a/deps/oblib/src/lib/atomic/ob_atomic.h b/deps/oblib/src/lib/atomic/ob_atomic.h index c32df0060..56eee6084 100644 --- a/deps/oblib/src/lib/atomic/ob_atomic.h +++ b/deps/oblib/src/lib/atomic/ob_atomic.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_ATOMIC_H_ diff --git a/deps/oblib/src/lib/atomic/ob_atomic_reference.cpp b/deps/oblib/src/lib/atomic/ob_atomic_reference.cpp index 1017a5516..eff6aa39f 100644 --- a/deps/oblib/src/lib/atomic/ob_atomic_reference.cpp +++ b/deps/oblib/src/lib/atomic/ob_atomic_reference.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/atomic/ob_atomic_reference.h" diff --git a/deps/oblib/src/lib/atomic/ob_atomic_reference.h b/deps/oblib/src/lib/atomic/ob_atomic_reference.h index b78d2fa35..a88c55a35 100644 --- a/deps/oblib/src/lib/atomic/ob_atomic_reference.h +++ b/deps/oblib/src/lib/atomic/ob_atomic_reference.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ATOMIC_REFERENCE_H_ diff --git a/deps/oblib/src/lib/atomic/ob_atomic_type.h b/deps/oblib/src/lib/atomic/ob_atomic_type.h index 391d48b2b..fb4a0d7e3 100644 --- a/deps/oblib/src/lib/atomic/ob_atomic_type.h +++ b/deps/oblib/src/lib/atomic/ob_atomic_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __OCEANBASE_COMMON_OB_ATOMIC_TYPE_H__ @@ -18,7 +22,7 @@ namespace oceanbase { namespace common { -// 支持并发读写 +// Support concurrent read and write template struct ObAtomicType { diff --git a/deps/oblib/src/lib/charset/mb_wc.h b/deps/oblib/src/lib/charset/mb_wc.h index 6c80a0d4d..ccaffad81 100644 --- a/deps/oblib/src/lib/charset/mb_wc.h +++ b/deps/oblib/src/lib/charset/mb_wc.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef MB_WC_INCLUDED @@ -168,4 +172,4 @@ static ALWAYS_INLINE int ob_mb_wc_utf8_prototype(ob_wc_t *pwc, const unsigned ch extern "C" int ob_mb_wc_utf8mb4_thunk(const ObCharsetInfo *cs, ob_wc_t *pwc, const unsigned char *s, const unsigned char *e); -#endif // MB_WC_INCLUDED \ No newline at end of file +#endif // MB_WC_INCLUDED diff --git a/deps/oblib/src/lib/charset/ob_byteorder.h b/deps/oblib/src/lib/charset/ob_byteorder.h index 272dbab93..42fc7ef63 100644 --- a/deps/oblib/src/lib/charset/ob_byteorder.h +++ b/deps/oblib/src/lib/charset/ob_byteorder.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_BYTEORDER_H diff --git a/deps/oblib/src/lib/charset/ob_charset.cpp b/deps/oblib/src/lib/charset/ob_charset.cpp index de160bc1a..57865dad1 100644 --- a/deps/oblib/src/lib/charset/ob_charset.cpp +++ b/deps/oblib/src/lib/charset/ob_charset.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_CHARSET @@ -1032,21 +1036,19 @@ size_t ObCharset::sortkey(ObCollationType collation_type, bool is_valid_unicode_tmp = 0; if (is_argument_valid(collation_type, str, str_len, key, key_len)) { const ObCharsetInfo *cs = get_charset(collation_type); - - // compare_collation_free函数已经能自动过滤尾部空格了,sortkey中过滤空格的逻辑不需要了 - - // is_valid_unicode参数的作用如下: - // 以一个例子说明,待比较的字符串为: + // compare_collation_free function already automatically filters trailing spaces, the space filtering logic in sortkey is not needed anymore + // the role of the is_valid_unicode parameter is as follows: + // An example to illustrate, the strings to be compared are: // - // 第一个字符串:0x2c 0x80 - // 第二个字符串:0x2c 0x80 0x20 + // The first string: 0x2c 0x80 + // The second string: 0x2c 0x80 0x20 // - // 如果不采用sortkey转换后的字符串比较,会认为0x80及之后的字符为非法的unicode字符,对这之后的字符串采用二进制比较,则认为第二个字符串更大。 + // If the sortkey conversion is not used for string comparison, characters 0x80 and above will be considered illegal unicode characters, and binary comparison of strings after this will consider the second string to be larger. // - // 而采用sortkey转换后的字符串,则在碰到0x80非法字符之后,就停止转换,导致认为比较结果相等。 - // 修复方案: + // And the string converted using sortkey stops conversion after encountering the illegal character 0x80, leading to the belief that the comparison result is equal. + // Fix solution: // - // 对于有非法字符的unicode字符串,采用原生的不转换sortkey的方式进行比较。 + // For unicode strings with illegal characters, use the native method of comparison without converting the sortkey. result = cs->coll->strnxfrm(cs, reinterpret_cast(key), key_len, @@ -1072,8 +1074,7 @@ size_t ObCharset::sortkey_var_len(ObCollationType collation_type, bool is_valid_unicode_tmp = 0; if (is_argument_valid(collation_type, str, str_len, key, key_len)) { const ObCharsetInfo *cs = get_charset(collation_type); - - // 对于有非法字符的unicode字符串,采用原生的不转换sortkey的方式进行比较。 + // For unicode strings with illegal characters, use the native sortkey comparison method without conversion. if (cs->coll->strnxfrm_varlen == NULL) { result = -1; } else { @@ -1158,9 +1159,9 @@ int ObCharset::like_range(ObCollationType collation_type, static char w_many = '%'; // const char *tmp_str = like_str.ptr(); // 'abc%' -> real_len=3 - // like_range里面会对min_str做字符填充, ('abc\min\min..', 'abc\max\max..') - // 存储层那边比较的时候会有字节比较的情况,导致判断出'abc'不在这个范围内 - // 所以这里将start的长度修改为填充前的长度,变为('abc','abc\max\max\max..') + // like_range inside will do character padding on min_str, ('abc\min\min..', 'abc\max\max..') + // The storage layer compares with byte comparison, leading to the judgment that 'abc' is not within this range + // So here the length of start is modified to the length before padding, becoming ('abc','abc\max\max\max..') // size_t real_len = like_str.length(); // size_t cur_len = 0; // while (cur_len < like_str.length() @@ -1169,8 +1170,8 @@ int ObCharset::like_range(ObCollationType collation_type, // ++cur_len; // } // real_len = cur_len; - // 上面的修改会引发这样的问题:'a\0' 会不在范围内,因为mysql的utf8特性使得'a\0' < 'a',所以范围不能这么修改 - // 具体的修正还是由存储层来做 + // The above modification will cause the following issue: 'a\0' will not be within the range, because MySQL's utf8 feature makes 'a\0' < 'a', so the range cannot be modified like this + // the specific correction is still to be done by the storage layer size_t res_size = *min_str_len < *max_str_len ? *min_str_len : *max_str_len; size_t pre_len = 0; if (OB_ISNULL(cs->coll)) { @@ -1679,7 +1680,7 @@ ObCharsetType ObCharset::charset_type(const ObString &cs_name) { ObCharsetType charset_type = CHARSET_INVALID; if (0 == cs_name.case_compare("utf8") || 0 == cs_name.case_compare("utf8mb3")) { - // utf8是utf8mb4的别名 + // utf8 is the alias of utf8mb4 charset_type = CHARSET_UTF8MB4; } else if (0 == cs_name.case_compare(ob_charset_utf8mb4_bin.csname)) { charset_type = CHARSET_UTF8MB4; @@ -2018,10 +2019,11 @@ int ObCharset::aggregate_collation_old( LOG_WARN ("invalid collation level or type", K(ret), K(collation_level1), K(collation_type1), K(collation_level2), K(collation_type2)); } else { - /** 先比较level,level小的优先级大,使用相应的结果。 - * 如果优先级相同,binary和string比较,统一用binary比较 - * 如果都是string,按照规则进行处理 - */ + /** + * First compare level, the smaller the level, the higher the priority, use the corresponding result. + * If the priorities are the same, compare binary and string, uniformly use binary comparison. + * If both are strings, process according to the rules. + */ ObCharsetType cs1 = charset_type_by_coll(collation_type1); ObCharsetType cs2 = charset_type_by_coll(collation_type2); if (collation_level1 < collation_level2) { @@ -2038,16 +2040,16 @@ int ObCharset::aggregate_collation_old( res_type = collation_type2; } else if (cs1 != cs2) { /** - * 左右字符集不相同的情况 - * 主要以下情况 - * utf8mb4和utf16:使用utf16 - * utf8mb4和gbk:使用utf8mb4 - * utf16和gbk:使用utf16 - * utf8mb4和gb18030:使用utf8mb4 - * utf16和gb18030:使用utf16 - * gbk和gb18030:使用gb18030 - * gb18030_2022 与 gb18030 的 AGGREGATE 暂定禁止 - * 以上任一字符集X与latin1的组合结果都为X,latin1目前地位最低 + * The case where the character sets on the left and right are different + * Mainly the following cases + * utf8mb4 and utf16: use utf16 + * utf8mb4 and gbk: use utf8mb4 + * utf16 and gbk: use utf16 + * utf8mb4 and gb18030: use utf8mb4 + * utf16 and gb18030: use utf16 + * gbk and gb18030: use gb18030 + * gb18030_2022 and gb18030 AGGREGATE is temporarily prohibited + * The combination result of any of the above character set X with latin1 is X, latin1 has the lowest status currently */ int res = AGGREGATE_2CHARSET[cs1][cs2]; @@ -2058,11 +2060,11 @@ int ObCharset::aggregate_collation_old( res_type = collation_type2; res_level = collation_level2; } else { - // 所有不能转换的情况都到这里 + // All cases that cannot be converted end up here ret = OB_CANT_AGGREGATE_2COLLATIONS; } } else { - //处理相同字符集的情况,每种字符集单独考虑 + // Handle the case of the same character set, considering each character set separately if (collation_type1 == collation_type2) { res_type = collation_type1; res_level = collation_level1; @@ -2075,7 +2077,7 @@ int ObCharset::aggregate_collation_old( res_type = CS_TYPE_UTF8MB4_BIN; res_level = (CS_TYPE_UTF8MB4_BIN == collation_type1) ? collation_level1 : collation_level2; } else { - // utf8mb4_unicode_ci和utf8mb4_general_ci的情况报错,和mysql兼容 + // utf8mb4_unicode_ci and utf8mb4_general_ci cases report an error, and are compatible with mysql ret = OB_CANT_AGGREGATE_2COLLATIONS; } } else if (charset_type_by_coll(collation_type1) == CHARSET_GBK) { @@ -2086,7 +2088,7 @@ int ObCharset::aggregate_collation_old( res_type = CS_TYPE_UTF16_BIN; res_level = (CS_TYPE_UTF16_BIN == collation_type1) ? collation_level1 : collation_level2; } else { - // utf16_unicode_ci和utf16_general_ci直接报错,不应该出现这种情况 + // utf16_unicode_ci and utf16_general_ci directly report an error, this situation should not occur ret = OB_CANT_AGGREGATE_2COLLATIONS; } } else if (charset_type_by_coll(collation_type1) == CHARSET_UTF16LE) { @@ -2094,7 +2096,7 @@ int ObCharset::aggregate_collation_old( res_type = CS_TYPE_UTF16LE_BIN; res_level = (CS_TYPE_UTF16LE_BIN == collation_type1) ? collation_level1 : collation_level2; } else { - // utf16le_unicode_ci和utf16le_general_ci直接报错,不应该出现这种情况 + // utf16le_unicode_ci and utf16le_general_ci directly report an error, this situation should not occur ret = OB_CANT_AGGREGATE_2COLLATIONS; } } else if (charset_type_by_coll(collation_type1) == CHARSET_GB18030) { @@ -2105,7 +2107,7 @@ int ObCharset::aggregate_collation_old( res_type = CS_TYPE_LATIN1_BIN; res_level = (CS_TYPE_LATIN1_BIN == collation_type1) ? collation_level1 : collation_level2; } else { - //未来可能支持latin1_german,与latin1_swedish不兼容 + //Future may support latin1_german, incompatible with latin1_swedish ret = OB_CANT_AGGREGATE_2COLLATIONS; } } else if (is_valid_charset(charset_type_by_coll(collation_type1))){ @@ -2937,8 +2939,7 @@ bool ObCharset::case_sensitive_equal(const ObString &one, const ObString &anothe { return 0 == strcmp(CS_TYPE_UTF8MB4_BIN, one, another); } - -//当租户模式为mysql时,不敏感匹配,租户模式为oracle时,敏感匹配 +// When tenant mode is mysql, case insensitive match, tenant mode is oracle, case sensitive match bool ObCharset::case_compat_mode_equal(const ObString &one, const ObString &another) { return lib::is_oracle_mode() ? @@ -3131,15 +3132,15 @@ int ObCharset::get_mbminlen_by_coll(const ObCollationType collation_type, int64_ return ret; } -/*in order to prevent a char from be splitted into 2 blocks -We have to get the right bound of a string in terms a block +/*in order to prevent a char from being split into 2 blocks +We have to get the right bound of a string in terms of a block Take "我爱你" as an example if len_limit_in_byte = 8 which means that the max size of a block is 8 Bytes -since '我' and '爱' takes 6 Bytes in total already. +since '我' and '爱' take 6 Bytes in total already. and '你' takes 3 Bytes. if we assign the '你' to the block then the total length will be 9 which is greater than 8 -so , byte_num = 6 and char_num = 2 will be returned. +so, byte_num = 6 and char_num = 2 will be returned. and '你' has to be assigned to another block. Please note that: @@ -3235,8 +3236,7 @@ int ObCharset::get_aggregate_len_unit(const ObCollationType collation_type, bool } return ret; } - -//进行字符集之间的转换,from_type为源字符集,to_type为目标字符集 +// Perform character set conversion, from_type is the source character set, to_type is the target character set int ObCharset::charset_convert(const ObCollationType from_type, const char *from_str, const uint32_t from_len, @@ -3798,7 +3798,7 @@ int ObCharsetUtils::init_const_str(ObCollationType coll_type, int ascii) MEMCPY(sys_buf, buf, result_len); const_str_for_ascii_[charset_type][ascii].assign_ptr(sys_buf, result_len); } - // swe7的定义中缺失了ascii的一些字符 + // the definition of swe7 is missing some ascii characters if(charset_type == CHARSET_SWE7 && ret == OB_ERR_INCORRECT_STRING_VALUE) { LOG_WARN("swe7 character convert failed", K(ret), K(buf_len), K(coll_type), K(ascii)); ret = OB_SUCCESS; diff --git a/deps/oblib/src/lib/charset/ob_charset.h b/deps/oblib/src/lib/charset/ob_charset.h index 0c171480f..c7e6206e2 100644 --- a/deps/oblib/src/lib/charset/ob_charset.h +++ b/deps/oblib/src/lib/charset/ob_charset.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_CHARSET_H_ @@ -24,9 +28,8 @@ namespace oceanbase { namespace common { - -// 我们目前的字符集实现参考MySQL,现在MySQL源码,进入strings目录, -// 根据文件名后缀可以大体找到对应编码实现 +// Our current character set implementation references MySQL, now enter the strings directory in the MySQL source code, +// According to the file name suffix, you can roughly find the corresponding encoding implementation enum ObCharsetType { @@ -61,11 +64,11 @@ enum ObCharsetType }; /* -*AGGREGATE_2CHARSET[CHARSET_UTF8MB4][CHARSET_GBK]=1表示结果为第一个参数CHARSET_UTF8MB4 -*AGGREGATE_2CHARSET[CHARSET_GBK][CHARSET_UTF8MB4]=2表示结果为第二个参数CHARSET_UTF8MB4 -*矩阵中只对当前需要考虑的情况填值1&2,其余补0 -*return value means idx of the resule type, 0 means OB_CANT_AGGREGATE_2COLLATIONS -*there is no possibly to reach AGGREGATE_2CHARSET[CHARSET_UTF8MB4][CHARSET_UTF8MB4] and so on +*AGGREGATE_2CHARSET[CHARSET_UTF8MB4][CHARSET_GBK]=1 indicates that the result is the first parameter CHARSET_UTF8MB4 +*AGGREGATE_2CHARSET[CHARSET_GBK][CHARSET_UTF8MB4]=2 indicates that the result is the second parameter CHARSET_UTF8MB4 +*Only fill values 1&2 in the matrix for the cases that need to be considered, and fill 0 for the rest +*return value means idx of the result type, 0 means OB_CANT_AGGREGATE_2COLLATIONS +*there is no possibility to reach AGGREGATE_2CHARSET[CHARSET_UTF8MB4][CHARSET_UTF8MB4] and so on */ static const int AGGREGATE_2CHARSET[CHARSET_MAX][CHARSET_MAX] = { //CHARSET_INVALID,CHARSET_BINARY,CHARSET_UTF8MB4... @@ -146,7 +149,7 @@ enum ObCollationType CS_TYPE_CP932_BIN = 96, CS_TYPE_EUCJPMS_JAPANESE_CI = 97, CS_TYPE_EUCJPMS_BIN = 98, - CS_TYPE_COLLATION_FREE = 100, // mysql中间没有使用这个 + CS_TYPE_COLLATION_FREE = 100, // mysql does not use this in the middle CS_TYPE_UTF16_UNICODE_CI = 101, CS_TYPE_UTF16_ICELANDIC_UCA_CI = 102, CS_TYPE_UTF16_LATVIAN_UCA_CI = 103, @@ -349,8 +352,7 @@ enum ObCollationType CS_TYPE_SWE7_ZH3_0900_AS_CS, // invalid CS_TYPE_MAX }; - -// oracle 模式下字符集名称对应的 ID 值 +// oracle mode character set name corresponding ID value // https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions095.htm enum ObNlsCharsetId { @@ -446,7 +448,7 @@ class ObCharset static const int32_t MIN_MB_LEN = 1; static const int32_t MAX_CASE_MULTIPLY = 4; - //比如latin1 1byte ,utf8mb4 4byte,转换因子为4,也可以理解为最多使用4字节存储一个字符 + // For example, latin1 1 byte, utf8mb4 4 bytes, the conversion factor is 4, which can also be understood as using up to 4 bytes to store one character static const int32_t CharConvertFactorNum = 4; static const int64_t VALID_CHARSET_TYPES = 24; static const int64_t VALID_COLLATION_TYPES = 167; @@ -735,7 +737,7 @@ class ObCharset static int get_aggregate_len_unit(const ObCollationType collation_type, bool &len_in_byte); - // 实现不同字符集之间的转换 + // Implement conversion between different character sets static int charset_convert(const ObCollationType from_type, const char *from_str, const uint32_t from_len, diff --git a/deps/oblib/src/lib/charset/ob_charset_string_helper.h b/deps/oblib/src/lib/charset/ob_charset_string_helper.h index 696e8b782..ccd004dfe 100644 --- a/deps/oblib/src/lib/charset/ob_charset_string_helper.h +++ b/deps/oblib/src/lib/charset/ob_charset_string_helper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_CHARSET_STRING_HELPER_H diff --git a/deps/oblib/src/lib/charset/ob_config.h b/deps/oblib/src/lib/charset/ob_config.h index 2f34e45f7..087db2d6c 100644 --- a/deps/oblib/src/lib/charset/ob_config.h +++ b/deps/oblib/src/lib/charset/ob_config.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_CONFIG_H diff --git a/deps/oblib/src/lib/charset/ob_ctype.cc b/deps/oblib/src/lib/charset/ob_ctype.cc index b26024f70..6e220b509 100644 --- a/deps/oblib/src/lib/charset/ob_ctype.cc +++ b/deps/oblib/src/lib/charset/ob_ctype.cc @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype.h b/deps/oblib/src/lib/charset/ob_ctype.h index 5373d7675..7fb1bf178 100644 --- a/deps/oblib/src/lib/charset/ob_ctype.h +++ b/deps/oblib/src/lib/charset/ob_ctype.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OBMYSQL_OB_CTYPE_ @@ -287,10 +291,10 @@ typedef struct ObCollationHandler bool (*init)(ObCharsetInfo *, ObCharsetLoader *); void (*uninit)(ObCharsetInfo *); /* Collation routines */ - // 进行字符串比较的函数 + // The function for string comparison int (*strnncoll)(const struct ObCharsetInfo *, const unsigned char *, size_t, const unsigned char *, size_t, bool); - // 字符串比较时忽略尾部空格 + // String comparison ignores trailing spaces int (*strnncollsp)(const struct ObCharsetInfo *, const unsigned char *, size_t, const unsigned char *, size_t, bool diff_if_only_endspace_difference); @@ -298,7 +302,7 @@ typedef struct ObCollationHandler size_t (*strnxfrm)(const struct ObCharsetInfo *, unsigned char *dst, size_t dstlen, unsigned int nweights, const unsigned char *src, size_t srclen, unsigned int flags, bool *is_valid_unicode); - // 获取weight_string结果的长度 + // Get the length of the weight_string result size_t (*strnxfrmlen)(const struct ObCharsetInfo *, size_t); // makes a sortkey suitable for memcmp() corresponding to the given variable length string size_t (*strnxfrm_varlen)(const struct ObCharsetInfo*, @@ -306,8 +310,7 @@ typedef struct ObCollationHandler const unsigned char *src, size_t srclen, bool is_memcmp, bool *is_valid_unicode); //size_t (*strnxfrmlen)(const struct ObCharsetInfo *, size_t); - - // creates a LIKE range, for optimizer,query range模块使用到了 + // creates a LIKE range, for optimizer, query range module uses it // prifix_len should return **byte** length before the first '%' bool (*like_range)(const struct ObCharsetInfo *, const char *s, size_t s_length, diff --git a/deps/oblib/src/lib/charset/ob_ctype_ascii.cc b/deps/oblib/src/lib/charset/ob_ctype_ascii.cc index 1fee19ea3..37a61cc02 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_ascii.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_ascii.cc @@ -1,13 +1,17 @@ -/** - * Copyright (code) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype.h" @@ -111,4 +115,4 @@ ObCharsetInfo ob_charset_ascii_bin = { 1, &ob_charset_ascii_handler, &ob_collation_8bit_bin_handler, - PAD_SPACE}; \ No newline at end of file + PAD_SPACE}; diff --git a/deps/oblib/src/lib/charset/ob_ctype_ascii_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_ascii_tab.cpp index 8375946ca..222527e57 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_ascii_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_ascii_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_ascii_tab.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_ascii_tab.h b/deps/oblib/src/lib/charset/ob_ctype_ascii_tab.h index 117a66581..0ba87fdc2 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_ascii_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_ascii_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_ASCII_TAB_H_ #define CHARSET_ASCII_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_big5.cc b/deps/oblib/src/lib/charset/ob_ctype_big5.cc index 6f4619430..51e938ef7 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_big5.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_big5.cc @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_big5_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_big5_tab.cpp index eecd6e899..b87675222 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_big5_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_big5_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_big5_tab.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_big5_tab.h b/deps/oblib/src/lib/charset/ob_ctype_big5_tab.h index 14beb6ac0..8f093ff2b 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_big5_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_big5_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_BIG5_TAB_H_ @@ -54,4 +58,4 @@ extern const uint16 tab_uni_big510[]; #define getbig5tail(e) ((unsigned char)(e & 0xff)) int func_big5_uni_onechar(int code); -#endif // CHARSET_BIG5_TAB_H_ \ No newline at end of file +#endif // CHARSET_BIG5_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_bin.cc b/deps/oblib/src/lib/charset/ob_ctype_bin.cc index 157e0270b..902f6fe74 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_bin.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_bin.cc @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ /* * diff --git a/deps/oblib/src/lib/charset/ob_ctype_bin_tab.h b/deps/oblib/src/lib/charset/ob_ctype_bin_tab.h index 459631891..9bfabaf0b 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_bin_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_bin_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ static unsigned char ctype_bin[]= { diff --git a/deps/oblib/src/lib/charset/ob_ctype_cp850_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_cp850_tab.cpp index 44c8d44f7..ff08cd70e 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_cp850_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_cp850_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_cp850_tab.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_cp850_tab.h b/deps/oblib/src/lib/charset/ob_ctype_cp850_tab.h index a2a7b73ff..039cd20d0 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_cp850_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_cp850_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_CP850_TAB_H_ #define CHARSET_CP850_TAB_H_ @@ -25,4 +29,4 @@ extern unsigned char to_upper_cp850_bin[]; extern uint16 to_uni_cp850_bin[]; -#endif // CHARSET_CP850_TAB_H_ \ No newline at end of file +#endif // CHARSET_CP850_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_cp932.cc b/deps/oblib/src/lib/charset/ob_ctype_cp932.cc index 4c1d5f19d..05b44267e 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_cp932.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_cp932.cc @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_mysql_global.h" #include "lib/charset/ob_ctype.h" @@ -326,4 +330,4 @@ ObCharsetInfo ob_charset_cp932_bin = { 1, // unsure &ob_charset_cp932_handler, &ob_collation_mb_bin_handler, - PAD_SPACE}; \ No newline at end of file + PAD_SPACE}; diff --git a/deps/oblib/src/lib/charset/ob_ctype_cp932_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_cp932_tab.cpp index f38f973db..b83657e66 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_cp932_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_cp932_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_cp932_tab.h" unsigned char ctype_cp932[257] = @@ -18483,4 +18487,4 @@ uint16_t unicode_to_cp932[65536] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -}; \ No newline at end of file +}; diff --git a/deps/oblib/src/lib/charset/ob_ctype_cp932_tab.h b/deps/oblib/src/lib/charset/ob_ctype_cp932_tab.h index 25a99c067..3d2cf4992 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_cp932_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_cp932_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_CP932_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_dec8_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_dec8_tab.cpp index e9ef20a05..9a9c1a40f 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_dec8_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_dec8_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_dec8_tab.h" @@ -215,4 +219,4 @@ uint16 to_uni_dec8_bin[] = { 0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, 0x0000,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x0153, 0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FF,0x0000,0x0000 -}; \ No newline at end of file +}; diff --git a/deps/oblib/src/lib/charset/ob_ctype_dec8_tab.h b/deps/oblib/src/lib/charset/ob_ctype_dec8_tab.h index 29cd32ae4..253bb7f2b 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_dec8_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_dec8_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_DEC8_TAB_H_ @@ -24,4 +28,4 @@ extern unsigned char ctype_dec8_bin[]; extern unsigned char to_lower_dec8_bin[]; extern unsigned char to_upper_dec8_bin[]; extern uint16 to_uni_dec8_bin[]; -#endif // CHARSET_DEC8_TAB_H_ \ No newline at end of file +#endif // CHARSET_DEC8_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_eucjpms.cc b/deps/oblib/src/lib/charset/ob_ctype_eucjpms.cc index 183c2f02a..28ec4753a 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_eucjpms.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_eucjpms.cc @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_mysql_global.h" #include "lib/charset/ob_ctype.h" @@ -314,4 +318,4 @@ ObCharsetInfo ob_charset_eucjpms_bin = { 1, /* levels_for_order */ &ob_charset_eucjpms_handler, &ob_collation_mb_bin_handler, - PAD_SPACE}; \ No newline at end of file + PAD_SPACE}; diff --git a/deps/oblib/src/lib/charset/ob_ctype_eucjpms_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_eucjpms_tab.cpp index 4f0cd95dd..554416c43 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_eucjpms_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_eucjpms_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_eucjpms_tab.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_eucjpms_tab.h b/deps/oblib/src/lib/charset/ob_ctype_eucjpms_tab.h index 26035a4b3..3a99cad34 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_eucjpms_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_eucjpms_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_EUCJPMS_TAB_H_ #define CHARSET_EUCJPMS_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_euckr.cc b/deps/oblib/src/lib/charset/ob_ctype_euckr.cc index c80c16e1d..76b20e641 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_euckr.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_euckr.cc @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_mysql_global.h" #include "lib/charset/ob_ctype.h" @@ -208,4 +212,4 @@ ObCharsetInfo ob_charset_euckr_bin = { 1, /* levels_for_order, unsure */ &ob_charset_euckr_handler, &ob_collation_mb_bin_handler, - PAD_SPACE}; \ No newline at end of file + PAD_SPACE}; diff --git a/deps/oblib/src/lib/charset/ob_ctype_euckr_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_euckr_tab.cpp index ce714656d..15bc587b1 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_euckr_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_euckr_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_euckr_tab.h" @@ -9267,4 +9271,4 @@ int func_uni_ksc5601_onechar(int code) { if ((code >= 0xFF01) && (code <= 0xFFE6)) return (tab_uni_ksc560110[code - 0xFF01]); return (0); -} \ No newline at end of file +} diff --git a/deps/oblib/src/lib/charset/ob_ctype_euckr_tab.h b/deps/oblib/src/lib/charset/ob_ctype_euckr_tab.h index 1c914b564..f5d524b09 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_euckr_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_euckr_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_EUCKR_TAB_H_ @@ -29,4 +33,4 @@ extern int func_uni_ksc5601_onechar(int code); #define iseuc_kr_tail(c) \ (iseuc_kr_tail1(c) || iseuc_kr_tail2(c) || iseuc_kr_tail3(c)) -#endif // CHARSET_EUCKR_TAB_H_ \ No newline at end of file +#endif // CHARSET_EUCKR_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_extra.cc b/deps/oblib/src/lib/charset/ob_ctype_extra.cc index 85fe6f4e6..65823d4bf 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_extra.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_extra.cc @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype.h" #include "lib/charset/ob_ctype_dec8_tab.h" @@ -399,4 +403,4 @@ ObCharsetInfo ob_charset_swe7_bin = { &ob_charset_8bit_handler, &ob_collation_8bit_bin_handler, PAD_SPACE /* pad_attribute */ -}; \ No newline at end of file +}; diff --git a/deps/oblib/src/lib/charset/ob_ctype_gb18030.cc b/deps/oblib/src/lib/charset/ob_ctype_gb18030.cc index 3f13b7a59..eddbc7d15 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_gb18030.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_gb18030.cc @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #include "lib/charset/ob_charset.h" #include "lib/charset/ob_gb18030_2022_tab.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_gb18030_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_gb18030_tab.cpp index 96d62f59b..555ce0196 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_gb18030_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_gb18030_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_gb18030_tab.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_gb18030_tab.h b/deps/oblib/src/lib/charset/ob_ctype_gb18030_tab.h index 5c97cc57e..22a802762 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_gb18030_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_gb18030_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_GB18030_TAB_H_ @@ -41,4 +45,4 @@ extern uint16 tab_gb18030_2022_4_uni[]; extern uint16 tab_uni_gb18030_2022_p1[]; extern uint16 tab_uni_gb18030_2022_p2[]; -#endif // CHARSET_GB18030_TAB_H_ \ No newline at end of file +#endif // CHARSET_GB18030_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_gb2312.cc b/deps/oblib/src/lib/charset/ob_ctype_gb2312.cc index c81dee800..c7481ea66 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_gb2312.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_gb2312.cc @@ -1,13 +1,17 @@ -/** - * Copyright (code) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_mysql_global.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_gb2312_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_gb2312_tab.cpp index 7af7030fe..c2fe0d4d2 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_gb2312_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_gb2312_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ @@ -6399,4 +6403,4 @@ int func_uni_gb2312_onechar(int code) { if ((code >= 0xFF01) && (code <= 0xFFE5)) return (tab_uni_gb23129[code - 0xFF01]); return (0); -} \ No newline at end of file +} diff --git a/deps/oblib/src/lib/charset/ob_ctype_gb2312_tab.h b/deps/oblib/src/lib/charset/ob_ctype_gb2312_tab.h index 020668e37..65408c07a 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_gb2312_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_gb2312_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_GB2312_TAB_H_ @@ -27,4 +31,4 @@ extern ObUnicaseInfo ob_caseinfo_gb2312; extern int func_gb2312_uni_onechar(int code); extern int func_uni_gb2312_onechar(int code); -#endif // CHARSET_GB2312_TAB_H_ \ No newline at end of file +#endif // CHARSET_GB2312_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_gbk.cc b/deps/oblib/src/lib/charset/ob_ctype_gbk.cc index e20c13bba..a86dc663f 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_gbk.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_gbk.cc @@ -1,15 +1,19 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #include "lib/charset/ob_ctype.h" #include "lib/charset/ob_ctype_gbk_tab.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_gbk_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_gbk_tab.cpp index 567144d56..035180eee 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_gbk_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_gbk_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_gbk_tab.h" unsigned char ctype_gbk[257] = diff --git a/deps/oblib/src/lib/charset/ob_ctype_gbk_tab.h b/deps/oblib/src/lib/charset/ob_ctype_gbk_tab.h index 09c459d2c..b41041a25 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_gbk_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_gbk_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_GBK_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_hkscs.cc b/deps/oblib/src/lib/charset/ob_ctype_hkscs.cc index 1d0162446..94008cc80 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_hkscs.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_hkscs.cc @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype.h" #include "lib/charset/ob_ctype_hkscs_tab.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_hkscs31_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_hkscs31_tab.cpp index 057db5c06..056f8eec2 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_hkscs31_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_hkscs31_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_hkscs31_tab.h" @@ -2519,4 +2523,4 @@ int func_uni_hkscs31_onechar(int code) { return iter->second; } return (0); -} \ No newline at end of file +} diff --git a/deps/oblib/src/lib/charset/ob_ctype_hkscs31_tab.h b/deps/oblib/src/lib/charset/ob_ctype_hkscs31_tab.h index 1ec757618..0446243bf 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_hkscs31_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_hkscs31_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_HKSCS31_TAB_H_ #define CHARSET_HKSCS31_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_hkscs_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_hkscs_tab.cpp index ab0322530..209ecba00 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_hkscs_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_hkscs_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_hkscs_tab.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_hkscs_tab.h b/deps/oblib/src/lib/charset/ob_ctype_hkscs_tab.h index e1e2dbf98..8296f9845 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_hkscs_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_hkscs_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_HKSCS_TAB_H_ @@ -49,4 +53,4 @@ extern const int size_of_uni_to_hkscs_map_array; int func_hkscs_uni_onechar(int code); int func_uni_hkscs_onechar(int code); -#endif // CHARSET_HKSCS_TAB_H_ \ No newline at end of file +#endif // CHARSET_HKSCS_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_hp8_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_hp8_tab.cpp index ce5ebb083..4e976808f 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_hp8_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_hp8_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_hp8_tab.h" @@ -215,4 +219,4 @@ uint16 to_uni_hp8_bin[] = { 0x00D2,0x00D5,0x00F5,0x0160,0x0161,0x00DA,0x0178,0x00FF, 0x00DE,0x00FE,0x00B7,0x00B5,0x00B6,0x00BE,0x2014,0x00BC, 0x00BD,0x00AA,0x00BA,0x00AB,0x25A0,0x00BB,0x00B1,0x0000 -}; \ No newline at end of file +}; diff --git a/deps/oblib/src/lib/charset/ob_ctype_hp8_tab.h b/deps/oblib/src/lib/charset/ob_ctype_hp8_tab.h index 4382fa3a6..7c83bbf8b 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_hp8_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_hp8_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_HP8_TAB_H_ #define CHARSET_HP8_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_latin1.cc b/deps/oblib/src/lib/charset/ob_ctype_latin1.cc index 157e2892e..7b375b2cc 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_latin1.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_latin1.cc @@ -1,13 +1,17 @@ -/** - * Copyright (code) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_latin1_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_latin1_tab.cpp index 3a781a3d7..7bf28fc66 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_latin1_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_latin1_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_latin1_tab.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_latin1_tab.h b/deps/oblib/src/lib/charset/ob_ctype_latin1_tab.h index a1a939f9e..f914f3fa7 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_latin1_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_latin1_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_LATIN1_TAB_H_ #define CHARSET_LATIN1_TAB_H_ @@ -28,4 +32,4 @@ extern const unsigned char combo2map[]; extern unsigned short cs_to_uni[]; extern unsigned char *uni_to_cs[]; -#endif // CHARSET_LATIN1_TAB_H_ \ No newline at end of file +#endif // CHARSET_LATIN1_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_macroman_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_macroman_tab.cpp index 6036747e1..3d3b077d9 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_macroman_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_macroman_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_macroman_tab.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_macroman_tab.h b/deps/oblib/src/lib/charset/ob_ctype_macroman_tab.h index 3bdb028d6..35415048d 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_macroman_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_macroman_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_MACROMAN_TAB_H_ #define CHARSET_MACROMAN_TAB_H_ @@ -24,4 +28,4 @@ extern unsigned char to_lower_macroman_bin[]; extern unsigned char to_upper_macroman_bin[]; extern uint16 to_uni_macroman_bin[]; -#endif // CHARSET_MACROMAN_TAB_H_ \ No newline at end of file +#endif // CHARSET_MACROMAN_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_mb.cc b/deps/oblib/src/lib/charset/ob_ctype_mb.cc index 60192c132..2e7917d32 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_mb.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_mb.cc @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #include "lib/charset/ob_ctype.h" #include "ob_uctype.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_simple.cc b/deps/oblib/src/lib/charset/ob_ctype_simple.cc index 5f9739492..dbbde65f2 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_simple.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_simple.cc @@ -1,15 +1,19 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ /* * * Version: $Id @@ -1263,4 +1267,4 @@ ObCollationHandler ob_collation_8bit_simple_ci_handler = { ob_propagate_simple}; #undef likeconv -#undef INC_PTR \ No newline at end of file +#undef INC_PTR diff --git a/deps/oblib/src/lib/charset/ob_ctype_sjis.cc b/deps/oblib/src/lib/charset/ob_ctype_sjis.cc index 31d299d4e..03aea337a 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_sjis.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_sjis.cc @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype.h" @@ -31,14 +35,14 @@ static uint mbcharlen_sjis(const ObCharsetInfo *cs [[maybe_unused]], uint c) { static ObUnicaseInfo ob_caseinfo_sjis = {0xFFFF, ob_caseinfo_pages_sjis}; /** - * @brief 对两个SJIS编码的字符串进行比较 + * @brief Compare two SJIS encoded strings * - * @param cs SJIS编码的字符集信息 - * @param a_res 指向第一个字符串的指针的指针 - * @param a_length 第一个字符串的长度 - * @param b_res 指向第二个字符串的指针的指针 - * @param b_length 第二个字符串的长度 - * @return int 返回值为0表示两个字符串相等,小于0表示第一个字符串小于第二个字符串,大于0表示第一个字符串大于第二个字符串 + * @param cs SJIS encoded character set information + * @param a_res Pointer to a pointer of the first string + * @param a_length Length of the first string + * @param b_res Pointer to a pointer of the second string + * @param b_length Length of the second string + * @return int Return value of 0 indicates the two strings are equal, less than 0 indicates the first string is less than the second string, greater than 0 indicates the first string is greater than the second string */ static int ob_strnncoll_sjis_internal(const ObCharsetInfo *cs, const uchar **a_res, size_t a_length, @@ -276,7 +280,7 @@ static ObCharsetHandler ob_sjis_charset_handler = ismbchar_sjis, /* ismbchar */ mbcharlen_sjis, /* mbcharlen */ ob_numchars_mb, /* numchars */ - ob_charpos_mb, /* charpos 这里charpos = */ + ob_charpos_mb, /* charpos here charpos = */ ob_max_bytes_charpos_mb, /* max_byptes charpos */ ob_well_formed_len_sjis, /* well_formed_len */ ob_lengthsp_8bit, /* lengthsp */ diff --git a/deps/oblib/src/lib/charset/ob_ctype_sjis_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_sjis_tab.cpp index 021983d77..b3fd09dad 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_sjis_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_sjis_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_sjis_tab.h" /* diff --git a/deps/oblib/src/lib/charset/ob_ctype_sjis_tab.h b/deps/oblib/src/lib/charset/ob_ctype_sjis_tab.h index c652fa3e2..4144177c4 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_sjis_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_sjis_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_SJIS_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_swe7_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_swe7_tab.cpp index fd7eb4165..2aad8391d 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_swe7_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_swe7_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_swe7_tab.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_swe7_tab.h b/deps/oblib/src/lib/charset/ob_ctype_swe7_tab.h index 59ec6ac80..dfdcade35 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_swe7_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_swe7_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_SWE7_TAB_H_ #define CHARSET_SWE7_TAB_H_ @@ -24,4 +28,4 @@ extern unsigned char to_lower_swe7_bin[]; extern unsigned char to_upper_swe7_bin[]; extern uint16 to_uni_swe7_bin[]; -#endif // CHARSET_SWE7_TAB_H_ \ No newline at end of file +#endif // CHARSET_SWE7_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_tis620.cc b/deps/oblib/src/lib/charset/ob_ctype_tis620.cc index a8e1e1cc7..61610013b 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_tis620.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_tis620.cc @@ -1,13 +1,17 @@ -/** - * Copyright (code) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype.h" @@ -512,4 +516,4 @@ void debug_tis620_sortkey(const uchar *str, size_t len, uchar *dst, size_t dst_l idx++; } } -} \ No newline at end of file +} diff --git a/deps/oblib/src/lib/charset/ob_ctype_tis620.h b/deps/oblib/src/lib/charset/ob_ctype_tis620.h index 7ae19c954..42ae710e2 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_tis620.h +++ b/deps/oblib/src/lib/charset/ob_ctype_tis620.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_TIS620_H_ @@ -15,7 +19,7 @@ #include "lib/charset/ob_ctype.h" #define LAST_LEVEL 4 /* TOT_LEVELS - 1 */ -/* 这一段define会和别人冲突的厉害 */ +/* This define will conflict heavily with others */ #define _is(c) (t_ctype[(c)][LAST_LEVEL]) #define _level 8 #define _consnt 16 diff --git a/deps/oblib/src/lib/charset/ob_ctype_tis620_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_tis620_tab.cpp index ce29d8c73..86ef11dbd 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_tis620_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_tis620_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_tis620_tab.h" @@ -616,4 +620,4 @@ unsigned char *uni_to_cs_tis620[256] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, plFF}; \ No newline at end of file + NULL, NULL, NULL, NULL, NULL, NULL, NULL, plFF}; diff --git a/deps/oblib/src/lib/charset/ob_ctype_tis620_tab.h b/deps/oblib/src/lib/charset/ob_ctype_tis620_tab.h index c09c1bed1..40618ab70 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_tis620_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_tis620_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_TIS620_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_uca.cc b/deps/oblib/src/lib/charset/ob_ctype_uca.cc index 4ed2f8209..ff447d0a2 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_uca.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_uca.cc @@ -1,13 +1,17 @@ -/** - * Copyright (code) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/src/lib/charset/ob_ctype_uca_tab.h b/deps/oblib/src/lib/charset/ob_ctype_uca_tab.h index 2c1c62034..49847203d 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_uca_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_uca_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ static const char german2[] = "&AE << \\u00E6 <<< \\u00C6 << \\u00E4 <<< \\u00C4 " diff --git a/deps/oblib/src/lib/charset/ob_ctype_ujis.cc b/deps/oblib/src/lib/charset/ob_ctype_ujis.cc index 1c159f2da..17d31c0fc 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_ujis.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_ujis.cc @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_mysql_global.h" @@ -333,4 +337,4 @@ ObCharsetInfo ob_charset_ujis_bin = { 1, &ob_charset_ujis_handler, &ob_collation_mb_bin_handler, - PAD_SPACE}; \ No newline at end of file + PAD_SPACE}; diff --git a/deps/oblib/src/lib/charset/ob_ctype_ujis_tab.cpp b/deps/oblib/src/lib/charset/ob_ctype_ujis_tab.cpp index 92969e281..829b8eeb2 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_ujis_tab.cpp +++ b/deps/oblib/src/lib/charset/ob_ctype_ujis_tab.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype_ujis_tab.h" @@ -35413,4 +35417,4 @@ uint16_t unicode_to_jisx0212_eucjp[65536] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, -}; \ No newline at end of file +}; diff --git a/deps/oblib/src/lib/charset/ob_ctype_ujis_tab.h b/deps/oblib/src/lib/charset/ob_ctype_ujis_tab.h index 152d67953..28863ec6b 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_ujis_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_ujis_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CHARSET_UJIS_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_ctype_utf16.cc b/deps/oblib/src/lib/charset/ob_ctype_utf16.cc index 375f98437..77d84dead 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_utf16.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_utf16.cc @@ -1,15 +1,19 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #include "lib/charset/ob_ctype.h" #include "lib/charset/ob_dtoa.h" diff --git a/deps/oblib/src/lib/charset/ob_ctype_utf8.cc b/deps/oblib/src/lib/charset/ob_ctype_utf8.cc index 5ec3ed69b..2cec28c44 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_utf8.cc +++ b/deps/oblib/src/lib/charset/ob_ctype_utf8.cc @@ -1,13 +1,17 @@ -/** - * Copyright (code) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ /* * @@ -467,7 +471,7 @@ size_t ob_strnxfrm_unicode(const ObCharsetInfo *cs, src+= res; if (uni_plane) ob_tosort_unicode(uni_plane, &wc, cs->state); - dst = store16be(dst, wc); //这是是不是bydesign的 + dst = store16be(dst, wc); //Is this by design? } ob_strnxfrm_unicode_help(&dst,&de, nweights, flags, &dst0); return dst - dst0; diff --git a/deps/oblib/src/lib/charset/ob_ctype_utf8_tab.h b/deps/oblib/src/lib/charset/ob_ctype_utf8_tab.h index 92a75eb6e..1ee303af1 100644 --- a/deps/oblib/src/lib/charset/ob_ctype_utf8_tab.h +++ b/deps/oblib/src/lib/charset/ob_ctype_utf8_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_CTYPE_UTF8_TAB_H_ #define OB_CTYPE_UTF8_TAB_H_ diff --git a/deps/oblib/src/lib/charset/ob_dtoa.cc b/deps/oblib/src/lib/charset/ob_dtoa.cc index 4a4c652ca..8a59e6f78 100644 --- a/deps/oblib/src/lib/charset/ob_dtoa.cc +++ b/deps/oblib/src/lib/charset/ob_dtoa.cc @@ -1,15 +1,19 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. -*/ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #include "lib/charset/ob_dtoa.h" @@ -200,7 +204,7 @@ void ob_gcvt_help2(int *width, int *len, char **dend, char **src, *dst_ptr++ = '-'; if (dst_ptr < dend_ptr) *dst_ptr++ = *src_ptr++; - // oracle mode 已废弃,is_zero 恒为 false + // oracle mode has been deprecated, is_zero is always false if ((*len) > 1 && dst_ptr < dend_ptr) { *dst_ptr++ = '.'; while (src_ptr < (*end) && dst_ptr < dend_ptr) @@ -233,7 +237,7 @@ void ob_gcvt_help2(int *width, int *len, char **dend, char **src, if (sign) *dst_ptr++ = '-'; *dst_ptr++ = *src_ptr++; - // oracle mode 已废弃,is_zero 恒为 false + // oracle mode has been deprecated, is_zero is always false if ((*len) > 1) { *dst_ptr++ = '.'; while (src_ptr < (*end)) diff --git a/deps/oblib/src/lib/charset/ob_dtoa.h b/deps/oblib/src/lib/charset/ob_dtoa.h index 269df34a9..955437fde 100644 --- a/deps/oblib/src/lib/charset/ob_dtoa.h +++ b/deps/oblib/src/lib/charset/ob_dtoa.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OBMYSQL_OB_DTOA_ diff --git a/deps/oblib/src/lib/charset/ob_gb18030_2022_tab.h b/deps/oblib/src/lib/charset/ob_gb18030_2022_tab.h index 48086b785..a7abb26fe 100644 --- a/deps/oblib/src/lib/charset/ob_gb18030_2022_tab.h +++ b/deps/oblib/src/lib/charset/ob_gb18030_2022_tab.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_ctype.h" @@ -30761,4 +30765,4 @@ static const uint32 gb18030_2022_4_radical_weight_py_p2[] = { 96544, 96573, 96858, 96992, 96993, 97132, 97184, 97185, 97195, 97253, /*[GB+9B31A130, GB+9B31A139]*/ 97306, 97329, 97346, 97443, 97728, 97759, 97835, 97836, 97837, 97512, /*[GB+9B31A230, GB+9B31A239]*/ 97540, 97560, 97576, 97581, 97934, 97952, 97965, 98043, /*[GB+9B31A330, GB+9B31A337]*/ -}; \ No newline at end of file +}; diff --git a/deps/oblib/src/lib/charset/ob_mysql_global.h b/deps/oblib/src/lib/charset/ob_mysql_global.h index 969e3030e..4eb48d181 100644 --- a/deps/oblib/src/lib/charset/ob_mysql_global.h +++ b/deps/oblib/src/lib/charset/ob_mysql_global.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OBMYSQL_OB_MYSQL_GLOBAL_ diff --git a/deps/oblib/src/lib/charset/ob_template_helper.h b/deps/oblib/src/lib/charset/ob_template_helper.h index 3aeeab64d..f98a98ea1 100644 --- a/deps/oblib/src/lib/charset/ob_template_helper.h +++ b/deps/oblib/src/lib/charset/ob_template_helper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_TEMPLATE_HELPER_H diff --git a/deps/oblib/src/lib/charset/ob_tis620ci_sort_scanner.h b/deps/oblib/src/lib/charset/ob_tis620ci_sort_scanner.h index 87f1e4f05..05a33b2e4 100644 --- a/deps/oblib/src/lib/charset/ob_tis620ci_sort_scanner.h +++ b/deps/oblib/src/lib/charset/ob_tis620ci_sort_scanner.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_TIS620CI_SORT_SCANNER diff --git a/deps/oblib/src/lib/charset/ob_uctype.h b/deps/oblib/src/lib/charset/ob_uctype.h index 5737a7505..fbcd5de66 100644 --- a/deps/oblib/src/lib/charset/ob_uctype.h +++ b/deps/oblib/src/lib/charset/ob_uctype.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SRC_LIB_CHARSET_OB_UCTYPE_H_ diff --git a/deps/oblib/src/lib/charset/str_uca_type.h b/deps/oblib/src/lib/charset/str_uca_type.h index 0a1eb2e89..92d05f4bb 100644 --- a/deps/oblib/src/lib/charset/str_uca_type.h +++ b/deps/oblib/src/lib/charset/str_uca_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef STR_UCA_TYPE_H @@ -232,4 +236,4 @@ inline bool ob_uca_can_be_contraction_tail(const char *flags, ob_wc_t wc) { const uint16 *ob_uca_contraction2_weight( const std::vector *cont_nodes, ob_wc_t wc1, ob_wc_t wc2); -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/charset/uca900_data.h b/deps/oblib/src/lib/charset/uca900_data.h index 3a4f12a65..c1482791e 100644 --- a/deps/oblib/src/lib/charset/uca900_data.h +++ b/deps/oblib/src/lib/charset/uca900_data.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef UCA900_DATA_H #define UCA900_DATA_H diff --git a/deps/oblib/src/lib/charset/uca900_ja_data.h b/deps/oblib/src/lib/charset/uca900_ja_data.h index 519f21a1f..f669ba03b 100644 --- a/deps/oblib/src/lib/charset/uca900_ja_data.h +++ b/deps/oblib/src/lib/charset/uca900_ja_data.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef UCA900_JA_DATA_H #define UCA900_JA_DATA_H @@ -568,4 +572,4 @@ static const char ja_cldr_30[]= extern uint16 *ja_han_pages[]; extern const int MIN_JA_HAN_PAGE; extern const int MAX_JA_HAN_PAGE; -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/charset/uca900_ja_tbls.cc b/deps/oblib/src/lib/charset/uca900_ja_tbls.cc index c0cb55291..38b372130 100644 --- a/deps/oblib/src/lib/charset/uca900_ja_tbls.cc +++ b/deps/oblib/src/lib/charset/uca900_ja_tbls.cc @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_mysql_global.h" diff --git a/deps/oblib/src/lib/charset/uca900_zh2_tbls.cc b/deps/oblib/src/lib/charset/uca900_zh2_tbls.cc index eed911eb1..3db5d6e76 100644 --- a/deps/oblib/src/lib/charset/uca900_zh2_tbls.cc +++ b/deps/oblib/src/lib/charset/uca900_zh2_tbls.cc @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_mysql_global.h" diff --git a/deps/oblib/src/lib/charset/uca900_zh3_tbls.cc b/deps/oblib/src/lib/charset/uca900_zh3_tbls.cc index 79d2e16a4..aee6fd7f3 100644 --- a/deps/oblib/src/lib/charset/uca900_zh3_tbls.cc +++ b/deps/oblib/src/lib/charset/uca900_zh3_tbls.cc @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_mysql_global.h" diff --git a/deps/oblib/src/lib/charset/uca900_zh_data.h b/deps/oblib/src/lib/charset/uca900_zh_data.h index 2b34e06d0..fc7270e2f 100644 --- a/deps/oblib/src/lib/charset/uca900_zh_data.h +++ b/deps/oblib/src/lib/charset/uca900_zh_data.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef UCA900_ZH_DATA_H #define UCA900_ZH_DATA_H diff --git a/deps/oblib/src/lib/charset/uca900_zh_tbls.cc b/deps/oblib/src/lib/charset/uca900_zh_tbls.cc index ed2769841..dec6aea5c 100644 --- a/deps/oblib/src/lib/charset/uca900_zh_tbls.cc +++ b/deps/oblib/src/lib/charset/uca900_zh_tbls.cc @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/charset/ob_mysql_global.h" diff --git a/deps/oblib/src/lib/checksum/check_sum.h b/deps/oblib/src/lib/checksum/check_sum.h index 518475d4d..69a139975 100644 --- a/deps/oblib/src/lib/checksum/check_sum.h +++ b/deps/oblib/src/lib/checksum/check_sum.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_CHECKSUM_H_ diff --git a/deps/oblib/src/lib/checksum/ob_crc16.h b/deps/oblib/src/lib/checksum/ob_crc16.h index c0e78bead..782cd0cd5 100644 --- a/deps/oblib/src/lib/checksum/ob_crc16.h +++ b/deps/oblib/src/lib/checksum/ob_crc16.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_CRC16_H_ diff --git a/deps/oblib/src/lib/checksum/ob_crc64.cpp b/deps/oblib/src/lib/checksum/ob_crc64.cpp index cd4814e82..4506a1764 100644 --- a/deps/oblib/src/lib/checksum/ob_crc64.cpp +++ b/deps/oblib/src/lib/checksum/ob_crc64.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/checksum/ob_crc64.h" diff --git a/deps/oblib/src/lib/checksum/ob_crc64.h b/deps/oblib/src/lib/checksum/ob_crc64.h index 7c90232a5..19094db14 100644 --- a/deps/oblib/src/lib/checksum/ob_crc64.h +++ b/deps/oblib/src/lib/checksum/ob_crc64.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_CRC64_H_ diff --git a/deps/oblib/src/lib/checksum/ob_parity_check.cpp b/deps/oblib/src/lib/checksum/ob_parity_check.cpp index e5ee88a5d..543987b0f 100644 --- a/deps/oblib/src/lib/checksum/ob_parity_check.cpp +++ b/deps/oblib/src/lib/checksum/ob_parity_check.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_parity_check.h" diff --git a/deps/oblib/src/lib/checksum/ob_parity_check.h b/deps/oblib/src/lib/checksum/ob_parity_check.h index cba62ee1e..c6c1ea85d 100644 --- a/deps/oblib/src/lib/checksum/ob_parity_check.h +++ b/deps/oblib/src/lib/checksum/ob_parity_check.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_PARITY_CHECK_H_ diff --git a/deps/oblib/src/lib/codec/generate_scalar_bitpakcing.py b/deps/oblib/src/lib/codec/generate_scalar_bitpakcing.py index c9c8e7c44..e1286c6c7 100755 --- a/deps/oblib/src/lib/codec/generate_scalar_bitpakcing.py +++ b/deps/oblib/src/lib/codec/generate_scalar_bitpakcing.py @@ -10,16 +10,20 @@ cpp_f = None h_f = None -copyright = """/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +copyright = """/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ """ diff --git a/deps/oblib/src/lib/codec/generate_simd_bitpakcing.py b/deps/oblib/src/lib/codec/generate_simd_bitpakcing.py index 3152c895c..bbbf1edb8 100755 --- a/deps/oblib/src/lib/codec/generate_simd_bitpakcing.py +++ b/deps/oblib/src/lib/codec/generate_simd_bitpakcing.py @@ -10,16 +10,20 @@ cpp_f = None h_f = None -copyright = """/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +copyright = """/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ """ diff --git a/deps/oblib/src/lib/codec/ob_bp_helpers.h b/deps/oblib/src/lib/codec/ob_bp_helpers.h index 6783f5f13..9b00df8df 100644 --- a/deps/oblib/src/lib/codec/ob_bp_helpers.h +++ b/deps/oblib/src/lib/codec/ob_bp_helpers.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_BP_HELPERS_ diff --git a/deps/oblib/src/lib/codec/ob_bp_util.h b/deps/oblib/src/lib/codec/ob_bp_util.h index fc40538cc..eea50763f 100644 --- a/deps/oblib/src/lib/codec/ob_bp_util.h +++ b/deps/oblib/src/lib/codec/ob_bp_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_BP_UTIL_ diff --git a/deps/oblib/src/lib/codec/ob_codecs.h b/deps/oblib/src/lib/codec/ob_codecs.h index 5c3bf348c..433fc7fee 100644 --- a/deps/oblib/src/lib/codec/ob_codecs.h +++ b/deps/oblib/src/lib/codec/ob_codecs.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_CODECS_H_ diff --git a/deps/oblib/src/lib/codec/ob_composite_codec.h b/deps/oblib/src/lib/codec/ob_composite_codec.h index 979d7334b..96dc683bd 100644 --- a/deps/oblib/src/lib/codec/ob_composite_codec.h +++ b/deps/oblib/src/lib/codec/ob_composite_codec.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_COMPOSITE_CODEC_H_ diff --git a/deps/oblib/src/lib/codec/ob_delta_zigzag_pfor.h b/deps/oblib/src/lib/codec/ob_delta_zigzag_pfor.h index 049b7f953..51da3de3f 100644 --- a/deps/oblib/src/lib/codec/ob_delta_zigzag_pfor.h +++ b/deps/oblib/src/lib/codec/ob_delta_zigzag_pfor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_DELTA_ZIGZAG_PFOR_H_ diff --git a/deps/oblib/src/lib/codec/ob_delta_zigzag_rle.h b/deps/oblib/src/lib/codec/ob_delta_zigzag_rle.h index ac935de34..f6b8959a6 100644 --- a/deps/oblib/src/lib/codec/ob_delta_zigzag_rle.h +++ b/deps/oblib/src/lib/codec/ob_delta_zigzag_rle.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_DELTA_ZIGZAG_RLE_H_ diff --git a/deps/oblib/src/lib/codec/ob_double_delta_zigzag_pfor.h b/deps/oblib/src/lib/codec/ob_double_delta_zigzag_pfor.h index 9c2e45bce..f329ff135 100644 --- a/deps/oblib/src/lib/codec/ob_double_delta_zigzag_pfor.h +++ b/deps/oblib/src/lib/codec/ob_double_delta_zigzag_pfor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_DOUBLE_DELTA_ZIGZAG_PFOR_H_ diff --git a/deps/oblib/src/lib/codec/ob_double_delta_zigzag_rle.h b/deps/oblib/src/lib/codec/ob_double_delta_zigzag_rle.h index fbb6cb479..7047bbba0 100644 --- a/deps/oblib/src/lib/codec/ob_double_delta_zigzag_rle.h +++ b/deps/oblib/src/lib/codec/ob_double_delta_zigzag_rle.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_DOUBLE_DELTA_ZIGZAG_RLE_H_ diff --git a/deps/oblib/src/lib/codec/ob_fast_bp_func.cpp b/deps/oblib/src/lib/codec/ob_fast_bp_func.cpp index bb7091068..0ed13ad7e 100644 --- a/deps/oblib/src/lib/codec/ob_fast_bp_func.cpp +++ b/deps/oblib/src/lib/codec/ob_fast_bp_func.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_fast_bp_func.h" diff --git a/deps/oblib/src/lib/codec/ob_fast_bp_func.h b/deps/oblib/src/lib/codec/ob_fast_bp_func.h index 858637a08..270852147 100644 --- a/deps/oblib/src/lib/codec/ob_fast_bp_func.h +++ b/deps/oblib/src/lib/codec/ob_fast_bp_func.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_FAST_BP_FUNC_ diff --git a/deps/oblib/src/lib/codec/ob_generated_scalar_bp_func.cpp b/deps/oblib/src/lib/codec/ob_generated_scalar_bp_func.cpp index 78008bcd3..b3adfa05f 100644 --- a/deps/oblib/src/lib/codec/ob_generated_scalar_bp_func.cpp +++ b/deps/oblib/src/lib/codec/ob_generated_scalar_bp_func.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_generated_scalar_bp_func.h" @@ -11587,4 +11591,3 @@ void scalar_fastunpack_32(const uint32 *__restrict__ in, uint32_t *__restrict__ } // end namespace share } // end namespace oceanbase - \ No newline at end of file diff --git a/deps/oblib/src/lib/codec/ob_generated_scalar_bp_func.h b/deps/oblib/src/lib/codec/ob_generated_scalar_bp_func.h index 388306e9f..eceac55f5 100644 --- a/deps/oblib/src/lib/codec/ob_generated_scalar_bp_func.h +++ b/deps/oblib/src/lib/codec/ob_generated_scalar_bp_func.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ @@ -44,4 +48,3 @@ void scalar_fastunpack_64(const uint64_t*__restrict__ in, uint64_t *__restrict__ } // end namespace common } // end namespace oceanbase #endif /* OB_GENERATED_SCALAR_BP_FUNC_H_ */ - \ No newline at end of file diff --git a/deps/oblib/src/lib/codec/ob_generated_unalign_simd_bp_func.cpp b/deps/oblib/src/lib/codec/ob_generated_unalign_simd_bp_func.cpp index a8de3f7f9..3742bd3a7 100644 --- a/deps/oblib/src/lib/codec/ob_generated_unalign_simd_bp_func.cpp +++ b/deps/oblib/src/lib/codec/ob_generated_unalign_simd_bp_func.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_generated_unalign_simd_bp_func.h" @@ -12698,4 +12702,3 @@ void uSIMD_fastunpack_128_32(const __m128i *__restrict__ in, } // end namespace share } // end namespace oceanbase - \ No newline at end of file diff --git a/deps/oblib/src/lib/codec/ob_generated_unalign_simd_bp_func.h b/deps/oblib/src/lib/codec/ob_generated_unalign_simd_bp_func.h index 8dca422c3..5cce63815 100644 --- a/deps/oblib/src/lib/codec/ob_generated_unalign_simd_bp_func.h +++ b/deps/oblib/src/lib/codec/ob_generated_unalign_simd_bp_func.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ @@ -44,4 +48,3 @@ void uSIMD_fastunpack_128_32(const __m128i *__restrict__ in, } // end namespace common } // end namespace oceanbase #endif /* OB_GENERATED_UNALIGN_SIMD_BP_FUNC_H_ */ - \ No newline at end of file diff --git a/deps/oblib/src/lib/codec/ob_simd_fixed_pfor.h b/deps/oblib/src/lib/codec/ob_simd_fixed_pfor.h index c90512fcd..d03e2915d 100644 --- a/deps/oblib/src/lib/codec/ob_simd_fixed_pfor.h +++ b/deps/oblib/src/lib/codec/ob_simd_fixed_pfor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_SIMD_FIXED_FAST_PFOR_H_ diff --git a/deps/oblib/src/lib/codec/ob_sse_to_neon.h b/deps/oblib/src/lib/codec/ob_sse_to_neon.h index 11c6d5887..ba9a516e6 100644 --- a/deps/oblib/src/lib/codec/ob_sse_to_neon.h +++ b/deps/oblib/src/lib/codec/ob_sse_to_neon.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_SSE_TO_NEON_H diff --git a/deps/oblib/src/lib/codec/ob_tiered_codec.h b/deps/oblib/src/lib/codec/ob_tiered_codec.h index 4404a2c7e..e0db46c5e 100644 --- a/deps/oblib/src/lib/codec/ob_tiered_codec.h +++ b/deps/oblib/src/lib/codec/ob_tiered_codec.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_TIRED_CODEC_H_ diff --git a/deps/oblib/src/lib/codec/ob_universal_compression.h b/deps/oblib/src/lib/codec/ob_universal_compression.h index 7d5ea9c51..10fc90a42 100644 --- a/deps/oblib/src/lib/codec/ob_universal_compression.h +++ b/deps/oblib/src/lib/codec/ob_universal_compression.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_UNIVERSAL_COMPRESSION_H_ diff --git a/deps/oblib/src/lib/codec/ob_xor_fixed_pfor.h b/deps/oblib/src/lib/codec/ob_xor_fixed_pfor.h index a1ac9342e..bdb49e8bc 100644 --- a/deps/oblib/src/lib/codec/ob_xor_fixed_pfor.h +++ b/deps/oblib/src/lib/codec/ob_xor_fixed_pfor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_XOF_FIEXED_PFOR_H_ diff --git a/deps/oblib/src/lib/compress/lz4/lz4_171_wrapper.cpp b/deps/oblib/src/lib/compress/lz4/lz4_171_wrapper.cpp index 7955eaab9..bda2ada3e 100644 --- a/deps/oblib/src/lib/compress/lz4/lz4_171_wrapper.cpp +++ b/deps/oblib/src/lib/compress/lz4/lz4_171_wrapper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lz4_src/lz4_171.h" diff --git a/deps/oblib/src/lib/compress/lz4/lz4_191_wrapper.cpp b/deps/oblib/src/lib/compress/lz4/lz4_191_wrapper.cpp index 15efa4091..f104ee4dc 100644 --- a/deps/oblib/src/lib/compress/lz4/lz4_191_wrapper.cpp +++ b/deps/oblib/src/lib/compress/lz4/lz4_191_wrapper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lz4_src/lz4_191.h" diff --git a/deps/oblib/src/lib/compress/lz4/lz4_wrapper.h b/deps/oblib/src/lib/compress/lz4/lz4_wrapper.h index 0e30a19c0..1e6b5567f 100644 --- a/deps/oblib/src/lib/compress/lz4/lz4_wrapper.h +++ b/deps/oblib/src/lib/compress/lz4/lz4_wrapper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LZ4_171_WRAPPER_H diff --git a/deps/oblib/src/lib/compress/lz4/ob_lz4_compressor.cpp b/deps/oblib/src/lib/compress/lz4/ob_lz4_compressor.cpp index 981555e60..29b4451d2 100644 --- a/deps/oblib/src/lib/compress/lz4/ob_lz4_compressor.cpp +++ b/deps/oblib/src/lib/compress/lz4/ob_lz4_compressor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/compress/lz4/ob_lz4_compressor.h" diff --git a/deps/oblib/src/lib/compress/lz4/ob_lz4_compressor.h b/deps/oblib/src/lib/compress/lz4/ob_lz4_compressor.h index c8b711646..256eef0ed 100644 --- a/deps/oblib/src/lib/compress/lz4/ob_lz4_compressor.h +++ b/deps/oblib/src/lib/compress/lz4/ob_lz4_compressor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_COMPRESS_LZ4_COMPRESSOR_H_ diff --git a/deps/oblib/src/lib/compress/lz4/ob_lz4_compressor_191.cpp b/deps/oblib/src/lib/compress/lz4/ob_lz4_compressor_191.cpp index c6da9705c..0c1f0d42b 100644 --- a/deps/oblib/src/lib/compress/lz4/ob_lz4_compressor_191.cpp +++ b/deps/oblib/src/lib/compress/lz4/ob_lz4_compressor_191.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/compress/lz4/ob_lz4_compressor.h" diff --git a/deps/oblib/src/lib/compress/lz4/ob_lz4_stream_compressor.cpp b/deps/oblib/src/lib/compress/lz4/ob_lz4_stream_compressor.cpp index 914634e99..527d3f140 100644 --- a/deps/oblib/src/lib/compress/lz4/ob_lz4_stream_compressor.cpp +++ b/deps/oblib/src/lib/compress/lz4/ob_lz4_stream_compressor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/compress/lz4/ob_lz4_stream_compressor.h" diff --git a/deps/oblib/src/lib/compress/lz4/ob_lz4_stream_compressor.h b/deps/oblib/src/lib/compress/lz4/ob_lz4_stream_compressor.h index fc38836e8..212701736 100644 --- a/deps/oblib/src/lib/compress/lz4/ob_lz4_stream_compressor.h +++ b/deps/oblib/src/lib/compress/lz4/ob_lz4_stream_compressor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_STREAM_COMPRESS_LZ4_COMPRESSOR_H_ diff --git a/deps/oblib/src/lib/compress/lz4/ob_lz4_stream_compressor_191.cpp b/deps/oblib/src/lib/compress/lz4/ob_lz4_stream_compressor_191.cpp index 8b953b101..43b7880f8 100644 --- a/deps/oblib/src/lib/compress/lz4/ob_lz4_stream_compressor_191.cpp +++ b/deps/oblib/src/lib/compress/lz4/ob_lz4_stream_compressor_191.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/compress/lz4/ob_lz4_stream_compressor.h" diff --git a/deps/oblib/src/lib/compress/none/ob_none_compressor.cpp b/deps/oblib/src/lib/compress/none/ob_none_compressor.cpp index ec393311c..1beca7f22 100644 --- a/deps/oblib/src/lib/compress/none/ob_none_compressor.cpp +++ b/deps/oblib/src/lib/compress/none/ob_none_compressor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/compress/none/ob_none_compressor.h" diff --git a/deps/oblib/src/lib/compress/none/ob_none_compressor.h b/deps/oblib/src/lib/compress/none/ob_none_compressor.h index f4e339cc0..d75a8ea6c 100644 --- a/deps/oblib/src/lib/compress/none/ob_none_compressor.h +++ b/deps/oblib/src/lib/compress/none/ob_none_compressor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_COMPRESS_NONE_COMPRESSOR_H_ diff --git a/deps/oblib/src/lib/compress/ob_compress_util.h b/deps/oblib/src/lib/compress/ob_compress_util.h index 0820c6a8d..7a5492ee9 100644 --- a/deps/oblib/src/lib/compress/ob_compress_util.h +++ b/deps/oblib/src/lib/compress/ob_compress_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_COMPRESSOR_UTIL_H_ diff --git a/deps/oblib/src/lib/compress/ob_compressor.cpp b/deps/oblib/src/lib/compress/ob_compressor.cpp index 45207ccc1..fae798362 100644 --- a/deps/oblib/src/lib/compress/ob_compressor.cpp +++ b/deps/oblib/src/lib/compress/ob_compressor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/compress/ob_compressor.h" diff --git a/deps/oblib/src/lib/compress/ob_compressor.h b/deps/oblib/src/lib/compress/ob_compressor.h index 676bb9c7d..a744fe054 100644 --- a/deps/oblib/src/lib/compress/ob_compressor.h +++ b/deps/oblib/src/lib/compress/ob_compressor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_COMPRESS_OB_COMPRESSOR_H_ diff --git a/deps/oblib/src/lib/compress/ob_compressor_pool.cpp b/deps/oblib/src/lib/compress/ob_compressor_pool.cpp index 50d17f91c..91c7549e2 100644 --- a/deps/oblib/src/lib/compress/ob_compressor_pool.cpp +++ b/deps/oblib/src/lib/compress/ob_compressor_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/compress/ob_compressor_pool.h" diff --git a/deps/oblib/src/lib/compress/ob_compressor_pool.h b/deps/oblib/src/lib/compress/ob_compressor_pool.h index e13460d80..50ad4d30a 100644 --- a/deps/oblib/src/lib/compress/ob_compressor_pool.h +++ b/deps/oblib/src/lib/compress/ob_compressor_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_COMPRESSOR_POOL_H_ diff --git a/deps/oblib/src/lib/compress/ob_stream_compressor.cpp b/deps/oblib/src/lib/compress/ob_stream_compressor.cpp index 41b630bbf..a7cc503d0 100644 --- a/deps/oblib/src/lib/compress/ob_stream_compressor.cpp +++ b/deps/oblib/src/lib/compress/ob_stream_compressor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/compress/ob_stream_compressor.h" diff --git a/deps/oblib/src/lib/compress/ob_stream_compressor.h b/deps/oblib/src/lib/compress/ob_stream_compressor.h index 37e71e058..9ade00c0c 100644 --- a/deps/oblib/src/lib/compress/ob_stream_compressor.h +++ b/deps/oblib/src/lib/compress/ob_stream_compressor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_STREAM_COMPRESS_OB_COMPRESSOR_H_ diff --git a/deps/oblib/src/lib/compress/snappy/ob_snappy_compressor.cpp b/deps/oblib/src/lib/compress/snappy/ob_snappy_compressor.cpp index ba3bd28be..142b2675d 100644 --- a/deps/oblib/src/lib/compress/snappy/ob_snappy_compressor.cpp +++ b/deps/oblib/src/lib/compress/snappy/ob_snappy_compressor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/compress/snappy/ob_snappy_compressor.h" diff --git a/deps/oblib/src/lib/compress/snappy/ob_snappy_compressor.h b/deps/oblib/src/lib/compress/snappy/ob_snappy_compressor.h index ab5833edb..cf279a1b3 100644 --- a/deps/oblib/src/lib/compress/snappy/ob_snappy_compressor.h +++ b/deps/oblib/src/lib/compress/snappy/ob_snappy_compressor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_COMPRESS_SNAPPY_COMPRESSOR_H_ diff --git a/deps/oblib/src/lib/compress/zlib/ob_zlib_compressor.cpp b/deps/oblib/src/lib/compress/zlib/ob_zlib_compressor.cpp index 765f7088d..18b0bf637 100644 --- a/deps/oblib/src/lib/compress/zlib/ob_zlib_compressor.cpp +++ b/deps/oblib/src/lib/compress/zlib/ob_zlib_compressor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_zlib_compressor.h" diff --git a/deps/oblib/src/lib/compress/zlib/ob_zlib_compressor.h b/deps/oblib/src/lib/compress/zlib/ob_zlib_compressor.h index 31a1e1f5b..39c6cd5cc 100644 --- a/deps/oblib/src/lib/compress/zlib/ob_zlib_compressor.h +++ b/deps/oblib/src/lib/compress/zlib/ob_zlib_compressor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMOM_COMPRESS_ZLIB_COMPRESSOR_ diff --git a/deps/oblib/src/lib/compress/zlib_lite/codec_deflate_qpl.cpp b/deps/oblib/src/lib/compress/zlib_lite/codec_deflate_qpl.cpp index b1519861c..a7fca06cd 100644 --- a/deps/oblib/src/lib/compress/zlib_lite/codec_deflate_qpl.cpp +++ b/deps/oblib/src/lib/compress/zlib_lite/codec_deflate_qpl.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef ENABLE_QPL_COMPRESSION diff --git a/deps/oblib/src/lib/compress/zlib_lite/codec_deflate_qpl.h b/deps/oblib/src/lib/compress/zlib_lite/codec_deflate_qpl.h index 87e2e11f2..55628bb69 100644 --- a/deps/oblib/src/lib/compress/zlib_lite/codec_deflate_qpl.h +++ b/deps/oblib/src/lib/compress/zlib_lite/codec_deflate_qpl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/deps/oblib/src/lib/compress/zlib_lite/ob_zlib_lite_compressor.cpp b/deps/oblib/src/lib/compress/zlib_lite/ob_zlib_lite_compressor.cpp index 3338c17e3..93dae186a 100644 --- a/deps/oblib/src/lib/compress/zlib_lite/ob_zlib_lite_compressor.cpp +++ b/deps/oblib/src/lib/compress/zlib_lite/ob_zlib_lite_compressor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_zlib_lite_compressor.h" diff --git a/deps/oblib/src/lib/compress/zlib_lite/ob_zlib_lite_compressor.h b/deps/oblib/src/lib/compress/zlib_lite/ob_zlib_lite_compressor.h index 832caa101..c7ac89460 100644 --- a/deps/oblib/src/lib/compress/zlib_lite/ob_zlib_lite_compressor.h +++ b/deps/oblib/src/lib/compress/zlib_lite/ob_zlib_lite_compressor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_COMPRESS_ZLIB_LITE_COMPRESSOR_H_ diff --git a/deps/oblib/src/lib/compress/zlib_lite/zlib_lite_adaptor.cpp b/deps/oblib/src/lib/compress/zlib_lite/zlib_lite_adaptor.cpp index 38160d214..7904cc386 100644 --- a/deps/oblib/src/lib/compress/zlib_lite/zlib_lite_adaptor.cpp +++ b/deps/oblib/src/lib/compress/zlib_lite/zlib_lite_adaptor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "zlib_lite_adaptor.h" diff --git a/deps/oblib/src/lib/compress/zlib_lite/zlib_lite_adaptor.h b/deps/oblib/src/lib/compress/zlib_lite/zlib_lite_adaptor.h index 18c79a947..6e8059c77 100644 --- a/deps/oblib/src/lib/compress/zlib_lite/zlib_lite_adaptor.h +++ b/deps/oblib/src/lib/compress/zlib_lite/zlib_lite_adaptor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_COMPRESS_ZLIB_LITE_ADAPTOR_H_ diff --git a/deps/oblib/src/lib/compress/zstd/ob_zstd_compressor.cpp b/deps/oblib/src/lib/compress/zstd/ob_zstd_compressor.cpp index 345b76440..03f6338f6 100644 --- a/deps/oblib/src/lib/compress/zstd/ob_zstd_compressor.cpp +++ b/deps/oblib/src/lib/compress/zstd/ob_zstd_compressor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_zstd_compressor.h" diff --git a/deps/oblib/src/lib/compress/zstd/ob_zstd_compressor.h b/deps/oblib/src/lib/compress/zstd/ob_zstd_compressor.h index ec30c1cb9..517457512 100644 --- a/deps/oblib/src/lib/compress/zstd/ob_zstd_compressor.h +++ b/deps/oblib/src/lib/compress/zstd/ob_zstd_compressor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_COMPRESS_ZSTD_COMPRESSOR_ diff --git a/deps/oblib/src/lib/compress/zstd/ob_zstd_stream_compressor.cpp b/deps/oblib/src/lib/compress/zstd/ob_zstd_stream_compressor.cpp index 592047100..e53486fd3 100644 --- a/deps/oblib/src/lib/compress/zstd/ob_zstd_stream_compressor.cpp +++ b/deps/oblib/src/lib/compress/zstd/ob_zstd_stream_compressor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_zstd_stream_compressor.h" diff --git a/deps/oblib/src/lib/compress/zstd/ob_zstd_stream_compressor.h b/deps/oblib/src/lib/compress/zstd/ob_zstd_stream_compressor.h index b8f798a66..7af318979 100644 --- a/deps/oblib/src/lib/compress/zstd/ob_zstd_stream_compressor.h +++ b/deps/oblib/src/lib/compress/zstd/ob_zstd_stream_compressor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_STREAM_COMPRESS_ZSTD_COMPRESSOR_ diff --git a/deps/oblib/src/lib/compress/zstd/ob_zstd_wrapper.cpp b/deps/oblib/src/lib/compress/zstd/ob_zstd_wrapper.cpp index e9f4749a7..cbedf2cf1 100644 --- a/deps/oblib/src/lib/compress/zstd/ob_zstd_wrapper.cpp +++ b/deps/oblib/src/lib/compress/zstd/ob_zstd_wrapper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_zstd_wrapper.h" diff --git a/deps/oblib/src/lib/compress/zstd/ob_zstd_wrapper.h b/deps/oblib/src/lib/compress/zstd/ob_zstd_wrapper.h index 998f718a1..93ef99834 100644 --- a/deps/oblib/src/lib/compress/zstd/ob_zstd_wrapper.h +++ b/deps/oblib/src/lib/compress/zstd/ob_zstd_wrapper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef DEPS_OBLIB_SRC_LIB_COMPRESS_ZSTD_OB_ZSTD_WRAPPER_H_ diff --git a/deps/oblib/src/lib/compress/zstd/zstd_src/ob_empty.c b/deps/oblib/src/lib/compress/zstd/zstd_src/ob_empty.c index 52a2e0172..c12234483 100644 --- a/deps/oblib/src/lib/compress/zstd/zstd_src/ob_empty.c +++ b/deps/oblib/src/lib/compress/zstd/zstd_src/ob_empty.c @@ -1,12 +1,16 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_empty.c b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_empty.c index 52a2e0172..c12234483 100644 --- a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_empty.c +++ b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_empty.c @@ -1,12 +1,16 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_compressor_1_3_8.cpp b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_compressor_1_3_8.cpp index f6aa47202..597897a39 100644 --- a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_compressor_1_3_8.cpp +++ b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_compressor_1_3_8.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_zstd_compressor_1_3_8.h" diff --git a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_compressor_1_3_8.h b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_compressor_1_3_8.h index e0c7bf56f..340ff5469 100644 --- a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_compressor_1_3_8.h +++ b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_compressor_1_3_8.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_COMPRESS_ZSTD_1_3_8_COMPRESSOR_ diff --git a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_stream_compressor_1_3_8.cpp b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_stream_compressor_1_3_8.cpp index f6c525952..33100f667 100644 --- a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_stream_compressor_1_3_8.cpp +++ b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_stream_compressor_1_3_8.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_zstd_stream_compressor_1_3_8.h" diff --git a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_stream_compressor_1_3_8.h b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_stream_compressor_1_3_8.h index deaeff236..e00a3af50 100644 --- a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_stream_compressor_1_3_8.h +++ b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_stream_compressor_1_3_8.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_STREAM_COMPRESS_ZSTD_1_3_8_COMPRESSOR_ diff --git a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_wrapper.cpp b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_wrapper.cpp index b09949075..ab9ab1689 100644 --- a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_wrapper.cpp +++ b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_wrapper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_zstd_wrapper.h" diff --git a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_wrapper.h b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_wrapper.h index 9ed7d29ad..bf2ddf6fe 100644 --- a/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_wrapper.h +++ b/deps/oblib/src/lib/compress/zstd_1_3_8/ob_zstd_wrapper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef DEPS_OBLIB_SRC_LIB_COMPRESS_ZSTD_OB_ZSTD_WRAPPER_H_ diff --git a/deps/oblib/src/lib/container/limit_array.h b/deps/oblib/src/lib/container/limit_array.h index a36bfde6e..30d0dac40 100644 --- a/deps/oblib/src/lib/container/limit_array.h +++ b/deps/oblib/src/lib/container/limit_array.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_LIMIT_ARRAY_H_ diff --git a/deps/oblib/src/lib/container/ob_2d_array.h b/deps/oblib/src/lib/container/ob_2d_array.h index d4c0d3a46..2a0c9e492 100644 --- a/deps/oblib/src/lib/container/ob_2d_array.h +++ b/deps/oblib/src/lib/container/ob_2d_array.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_2D_ARRAY_H diff --git a/deps/oblib/src/lib/container/ob_array.h b/deps/oblib/src/lib/container/ob_array.h index a1376cee5..da5e0c6ed 100644 --- a/deps/oblib/src/lib/container/ob_array.h +++ b/deps/oblib/src/lib/container/ob_array.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_ARRAY_H diff --git a/deps/oblib/src/lib/container/ob_array_array.h b/deps/oblib/src/lib/container/ob_array_array.h index 4f8a0ebe0..c699476fd 100644 --- a/deps/oblib/src/lib/container/ob_array_array.h +++ b/deps/oblib/src/lib/container/ob_array_array.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_CONTAINER_ARRAY_ARRAY_ diff --git a/deps/oblib/src/lib/container/ob_array_helper.h b/deps/oblib/src/lib/container/ob_array_helper.h index 713703edb..1cec16773 100644 --- a/deps/oblib/src/lib/container/ob_array_helper.h +++ b/deps/oblib/src/lib/container/ob_array_helper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_ARRAY_HELPER_H_ diff --git a/deps/oblib/src/lib/container/ob_array_iterator.h b/deps/oblib/src/lib/container/ob_array_iterator.h index 9eb65f763..d722d437f 100644 --- a/deps/oblib/src/lib/container/ob_array_iterator.h +++ b/deps/oblib/src/lib/container/ob_array_iterator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_ARRAY_ITERATOR_H diff --git a/deps/oblib/src/lib/container/ob_array_serialization.h b/deps/oblib/src/lib/container/ob_array_serialization.h index 0e432c419..2c61c38c3 100644 --- a/deps/oblib/src/lib/container/ob_array_serialization.h +++ b/deps/oblib/src/lib/container/ob_array_serialization.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_ARRAY_SERIALIZATION_H diff --git a/deps/oblib/src/lib/container/ob_array_wrap.h b/deps/oblib/src/lib/container/ob_array_wrap.h index f71596464..8eced8492 100644 --- a/deps/oblib/src/lib/container/ob_array_wrap.h +++ b/deps/oblib/src/lib/container/ob_array_wrap.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_ARRAY_WRAP_H diff --git a/deps/oblib/src/lib/container/ob_bit_set.h b/deps/oblib/src/lib/container/ob_bit_set.h index 0ea4ea3a7..285fb6bac 100644 --- a/deps/oblib/src/lib/container/ob_bit_set.h +++ b/deps/oblib/src/lib/container/ob_bit_set.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_CONTAINER_BITSET_ diff --git a/deps/oblib/src/lib/container/ob_bitmap.cpp b/deps/oblib/src/lib/container/ob_bitmap.cpp index e26b8170d..144cca093 100644 --- a/deps/oblib/src/lib/container/ob_bitmap.cpp +++ b/deps/oblib/src/lib/container/ob_bitmap.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/container/ob_bitmap.h" diff --git a/deps/oblib/src/lib/container/ob_bitmap.h b/deps/oblib/src/lib/container/ob_bitmap.h index 5d55d7615..f6bcfeac1 100644 --- a/deps/oblib/src/lib/container/ob_bitmap.h +++ b/deps/oblib/src/lib/container/ob_bitmap.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_BITMAP_H_ diff --git a/deps/oblib/src/lib/container/ob_concurrent_bitset.h b/deps/oblib/src/lib/container/ob_concurrent_bitset.h index e733f8b17..836ecdbf7 100644 --- a/deps/oblib/src/lib/container/ob_concurrent_bitset.h +++ b/deps/oblib/src/lib/container/ob_concurrent_bitset.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/ob_define.h" diff --git a/deps/oblib/src/lib/container/ob_ext_ring_buffer.h b/deps/oblib/src/lib/container/ob_ext_ring_buffer.h index c61f46834..994e8a2c8 100644 --- a/deps/oblib/src/lib/container/ob_ext_ring_buffer.h +++ b/deps/oblib/src/lib/container/ob_ext_ring_buffer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_CONTAINER_OB_EXT_RING_BUFFER_H_ diff --git a/deps/oblib/src/lib/container/ob_ext_ring_buffer_impl.h b/deps/oblib/src/lib/container/ob_ext_ring_buffer_impl.h index 54f1ef904..2e19e8db9 100644 --- a/deps/oblib/src/lib/container/ob_ext_ring_buffer_impl.h +++ b/deps/oblib/src/lib/container/ob_ext_ring_buffer_impl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_CONTAINER_OB_EXT_RING_BUFFER_H_ diff --git a/deps/oblib/src/lib/container/ob_fast_array.h b/deps/oblib/src/lib/container/ob_fast_array.h index 79539ba30..8c4df1875 100644 --- a/deps/oblib/src/lib/container/ob_fast_array.h +++ b/deps/oblib/src/lib/container/ob_fast_array.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBAFast_LIB_CONTAINER_FAST_ARRAY_ diff --git a/deps/oblib/src/lib/container/ob_fixed_array.h b/deps/oblib/src/lib/container/ob_fixed_array.h index 276dbb2ff..f6c700d7f 100644 --- a/deps/oblib/src/lib/container/ob_fixed_array.h +++ b/deps/oblib/src/lib/container/ob_fixed_array.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_FIXED_ARRAY_H diff --git a/deps/oblib/src/lib/container/ob_fixed_array_iterator.h b/deps/oblib/src/lib/container/ob_fixed_array_iterator.h index 5c40f7e9c..7ef9aba03 100644 --- a/deps/oblib/src/lib/container/ob_fixed_array_iterator.h +++ b/deps/oblib/src/lib/container/ob_fixed_array_iterator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_FIXED_ARRAY_ITERATOR_H_ diff --git a/deps/oblib/src/lib/container/ob_heap.h b/deps/oblib/src/lib/container/ob_heap.h index 185f4e637..d8c0aa0d6 100644 --- a/deps/oblib/src/lib/container/ob_heap.h +++ b/deps/oblib/src/lib/container/ob_heap.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_HEAP_H diff --git a/deps/oblib/src/lib/container/ob_iarray.h b/deps/oblib/src/lib/container/ob_iarray.h index b77902f71..52d11927b 100644 --- a/deps/oblib/src/lib/container/ob_iarray.h +++ b/deps/oblib/src/lib/container/ob_iarray.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_CONTAINER_IARRAY_ diff --git a/deps/oblib/src/lib/container/ob_id_map.h b/deps/oblib/src/lib/container/ob_id_map.h index cd4e35112..9ded9d957 100644 --- a/deps/oblib/src/lib/container/ob_id_map.h +++ b/deps/oblib/src/lib/container/ob_id_map.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_ID_MAP_H_ diff --git a/deps/oblib/src/lib/container/ob_int_flags.h b/deps/oblib/src/lib/container/ob_int_flags.h index 156365ab8..a92fdf33a 100644 --- a/deps/oblib/src/lib/container/ob_int_flags.h +++ b/deps/oblib/src/lib/container/ob_int_flags.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_INT_FLAGS_ diff --git a/deps/oblib/src/lib/container/ob_loser_tree.h b/deps/oblib/src/lib/container/ob_loser_tree.h index c2894ae01..8502e20af 100644 --- a/deps/oblib/src/lib/container/ob_loser_tree.h +++ b/deps/oblib/src/lib/container/ob_loser_tree.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_LOSER_TREE_H_ @@ -34,7 +38,7 @@ class ObRowsMerger public: virtual ~ObRowsMerger() = default; virtual ObRowMergerType type() = 0; - virtual int init(const int64_t table_cnt, common::ObIAllocator &allocator) = 0; + virtual int init(const int64_t max_table_cnt, const int64_t table_cnt, common::ObIAllocator &allocator) = 0; virtual bool is_inited() const = 0; virtual int open(const int64_t table_cnt) = 0; virtual void reset() = 0; @@ -50,7 +54,7 @@ class ObRowsMerger TO_STRING_KV("name", "ObRowsMerger") }; -template +template class ObLoserTree : public ObRowsMerger { public: @@ -58,7 +62,7 @@ class ObLoserTree : public ObRowsMerger explicit ObLoserTree(CompareFunctor &cmp); virtual ~ObLoserTree() { reset(); }; - virtual int init(const int64_t total_player_cnt, common::ObIAllocator &allocator); + virtual int init(const int64_t max_player_cnt, const int64_t player_cnt, common::ObIAllocator &allocator); virtual bool is_inited() const { return is_inited_; } virtual int open(const int64_t total_player_cnt); virtual void reset(); @@ -105,7 +109,7 @@ class ObLoserTree : public ObRowsMerger int set_replay_type(const int64_t player); }; - int alloc_max_space(); + int alloc_max_space(const int64_t player_cnt); int inner_rebuild(); int update_champion_path(const int64_t idx); int get_match_result( @@ -132,7 +136,7 @@ class ObLoserTree : public ObRowsMerger protected: static const int64_t INVALID_IDX = -1; - bool is_inited_; + int64_t max_player_cnt_; int64_t player_cnt_; int64_t match_cnt_; int64_t leaf_offset_; @@ -142,12 +146,13 @@ class ObLoserTree : public ObRowsMerger int64_t cur_free_cnt_; bool need_rebuild_; bool is_unique_champion_; //if the champion has draw game in the tree + bool is_inited_; CompareFunctor &cmp_; common::ObIAllocator *allocator_; }; -template -int ObLoserTree::MatchResult::set_replay_type( +template +int ObLoserTree::MatchResult::set_replay_type( const int64_t player) { int ret = OB_SUCCESS; @@ -189,18 +194,17 @@ int ObLoserTree::MatchResult::set_replay_type return ret; } -template -ObLoserTree::ObLoserTree(CompareFunctor &cmp) - :is_inited_(false), player_cnt_(0), match_cnt_(0), leaf_offset_(0), +template +ObLoserTree::ObLoserTree(CompareFunctor &cmp) + :max_player_cnt_(0), player_cnt_(0), match_cnt_(0), leaf_offset_(0), players_(nullptr), matches_(nullptr), free_players_(nullptr), cur_free_cnt_(0), - need_rebuild_(false), is_unique_champion_(true), cmp_(cmp), allocator_(nullptr) + need_rebuild_(false), is_unique_champion_(true), is_inited_(false), cmp_(cmp), allocator_(nullptr) { - STATIC_ASSERT(MAX_PLAYER_CNT > 0, "invalid player count"); STATIC_ASSERT(std::is_trivially_copyable::value, "class is not supported"); } -template -int64_t ObLoserTree::get_match_cnt( +template +int64_t ObLoserTree::get_match_cnt( const int64_t player_cnt) { int64_t match_cnt = 0; @@ -214,13 +218,15 @@ int64_t ObLoserTree::get_match_cnt( return match_cnt; } -template -int ObLoserTree::alloc_max_space() +template +int ObLoserTree::alloc_max_space(const int64_t player_cnt) { int ret = OB_SUCCESS; - int64_t player_cnt = MAX_PLAYER_CNT; - int64_t match_cnt = get_match_cnt(MAX_PLAYER_CNT); - if (nullptr == (players_ = static_cast(allocator_->alloc(sizeof(T) * player_cnt)))) { + const int64_t match_cnt = get_match_cnt(player_cnt); + if (OB_UNLIKELY(player_cnt <= 0)) { + ret = OB_INVALID_ARGUMENT; + LIB_LOG(WARN, "invalid player count", K(ret), K(player_cnt)); + } else if (nullptr == (players_ = static_cast(allocator_->alloc(sizeof(T) * player_cnt)))) { ret = OB_ALLOCATE_MEMORY_FAILED; LIB_LOG(WARN, "allocate players failed", K(ret), K(player_cnt), K(match_cnt)); } else if (nullptr == (matches_ = static_cast(allocator_->alloc(sizeof(MatchResult) * match_cnt)))) { @@ -233,9 +239,10 @@ int ObLoserTree::alloc_max_space() return ret; } -template -int ObLoserTree::init( - const int64_t total_player_cnt, +template +int ObLoserTree::init( + const int64_t max_player_cnt, + const int64_t player_cnt, ObIAllocator &allocator) { int ret = OB_SUCCESS; @@ -244,10 +251,11 @@ int ObLoserTree::init( LIB_LOG(WARN, "init twice", K(ret)); } else { allocator_ = &allocator; - if (OB_FAIL(alloc_max_space())) { + max_player_cnt_ = max_player_cnt; + if (OB_FAIL(alloc_max_space(max_player_cnt))) { LIB_LOG(WARN, "alloc space fail,", K(ret)); - } else if (OB_FAIL(init_basic_info(total_player_cnt))) { - LIB_LOG(WARN, "fail to init basic info", K(ret), K(total_player_cnt)); + } else if (OB_FAIL(init_basic_info(player_cnt))) { + LIB_LOG(WARN, "fail to init basic info", K(ret), K(max_player_cnt)); } else { is_inited_ = true; } @@ -259,24 +267,27 @@ int ObLoserTree::init( return ret; } -template -int ObLoserTree::open(const int64_t total_player_cnt) +template +int ObLoserTree::open(const int64_t total_player_cnt) { int ret = OB_SUCCESS; if (IS_NOT_INIT) { ret = OB_NOT_INIT; LIB_LOG(WARN, "not init", K(ret)); + } else if (OB_UNLIKELY(total_player_cnt > max_player_cnt_)) { + ret = OB_INVALID_ARGUMENT; + LIB_LOG(WARN, "invalid total player count", K(ret), K(total_player_cnt), K_(max_player_cnt)); } else if (OB_FAIL(init_basic_info(total_player_cnt))) { LIB_LOG(WARN, "fail to init basic info", K(ret), K(total_player_cnt)); } return ret; } -template -int ObLoserTree::init_basic_info(const int64_t total_player_cnt) +template +int ObLoserTree::init_basic_info(const int64_t total_player_cnt) { int ret = OB_SUCCESS; - if (total_player_cnt <= 0 || total_player_cnt > MAX_PLAYER_CNT) { + if (total_player_cnt <= 0) { ret = OB_INVALID_ARGUMENT; LIB_LOG(WARN, "total player count is invalid", K(ret), K(total_player_cnt)); } else { @@ -295,8 +306,8 @@ int ObLoserTree::init_basic_info(const int64_ return ret; } -template -void ObLoserTree::reuse() +template +void ObLoserTree::reuse() { player_cnt_ = 0; match_cnt_ = 0; @@ -306,8 +317,8 @@ void ObLoserTree::reuse() is_unique_champion_= true; } -template -void ObLoserTree::reset() +template +void ObLoserTree::reset() { if (nullptr != allocator_) { if (nullptr != players_) { @@ -320,6 +331,7 @@ void ObLoserTree::reset() allocator_->free(free_players_); } } + max_player_cnt_ = 0; player_cnt_ = 0; match_cnt_ = 0; leaf_offset_ = 0; @@ -333,8 +345,8 @@ void ObLoserTree::reset() is_inited_ = false; } -template -int ObLoserTree::get_match_result( +template +int ObLoserTree::get_match_result( const int64_t offender, const int64_t defender, const int64_t match_idx) @@ -361,8 +373,8 @@ int ObLoserTree::get_match_result( return ret; } -template -int ObLoserTree::duel( +template +int ObLoserTree::duel( T &offender, T &defender, const int64_t match_idx, bool &is_offender_win) { int ret = OB_SUCCESS; @@ -376,8 +388,8 @@ int ObLoserTree::duel( return ret; } -template -void ObLoserTree::set_unique_champion() +template +void ObLoserTree::set_unique_champion() { is_unique_champion_ = true; const int64_t champion = matches_[0].winner_idx_; @@ -394,8 +406,8 @@ void ObLoserTree::set_unique_champion() } } -template -int ObLoserTree::rebuild() +template +int ObLoserTree::rebuild() { int ret = OB_SUCCESS; if (is_single_player()) { @@ -412,8 +424,8 @@ int ObLoserTree::rebuild() return ret; } -template -int ObLoserTree::inner_rebuild() +template +int ObLoserTree::inner_rebuild() { int ret = OB_SUCCESS; int64_t l_player = INVALID_IDX; @@ -450,8 +462,8 @@ int ObLoserTree::inner_rebuild() return ret; } -template -int ObLoserTree::update_champion_path( +template +int ObLoserTree::update_champion_path( const int64_t idx) { int ret = OB_SUCCESS; @@ -481,8 +493,8 @@ int ObLoserTree::update_champion_path( return ret; } -template -int ObLoserTree::top(const T *&player) +template +int ObLoserTree::top(const T *&player) { int ret = OB_SUCCESS; if (!IS_INIT) { @@ -508,8 +520,8 @@ int ObLoserTree::top(const T *&player) return ret; } -template -int ObLoserTree::push(const T &player) +template +int ObLoserTree::push(const T &player) { int ret = OB_SUCCESS; if (!IS_INIT) { @@ -540,15 +552,15 @@ int ObLoserTree::push(const T &player) return ret; } -template -int ObLoserTree::push_top(const T &player) +template +int ObLoserTree::push_top(const T &player) { UNUSED(player); return OB_NOT_SUPPORTED; } -template -int ObLoserTree::pop() +template +int ObLoserTree::pop() { int ret = OB_SUCCESS; if (IS_NOT_INIT) { diff --git a/deps/oblib/src/lib/container/ob_mask_set2.h b/deps/oblib/src/lib/container/ob_mask_set2.h index ca953fa20..13054f5da 100644 --- a/deps/oblib/src/lib/container/ob_mask_set2.h +++ b/deps/oblib/src/lib/container/ob_mask_set2.h @@ -1,174 +1,178 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ -#ifndef OCEANBASE_COMMON_OB_MASK_SET2_ -#define OCEANBASE_COMMON_OB_MASK_SET2_ - -#include "ob_bit_set.h" -#include "ob_iarray.h" - -namespace oceanbase -{ -namespace common -{ - -template -class ObMaskSet2 -{ -public: - ObMaskSet2() : is_inited_(false), array_(NULL), bitset_() {} - ~ObMaskSet2() {} - int init(const ObIArray *array) - { - int ret = OB_SUCCESS; - if (NULL == array) { - ret = OB_INVALID_ARGUMENT; - } else if (OB_FAIL(bitset_.reserve(array->count()))) { - } else { - array_ = array; - is_inited_ = true; - } - return ret; - } - void reset() - { - is_inited_ = false; - array_ = NULL; - bitset_.reuse(); - } - void clear() - { - bitset_.reuse(); - } -public: - int mask(const T &key) - { - int ret = OB_SUCCESS; - if (!is_inited_) { - ret = OB_NOT_INIT; - } else { - bool hit = false; - for (int64_t i = 0 ; OB_SUCCESS == ret && i < array_->count(); i++) { - if (array_->at(i) == key) { - hit = true; - if (OB_FAIL(bitset_.add_member(i))) { - } - break; - } - } - if (OB_SUCCESS == ret) { - if (!hit) { - ret = OB_MASK_SET_NO_NODE; - } - } - } - return ret; - } - int unmask(const T &key) - { - int ret = OB_SUCCESS; - if (!is_inited_) { - ret = OB_NOT_INIT; - } else { - bool hit = false; - for (int64_t i = 0 ; OB_SUCCESS == ret && i < array_->count(); i++) { - if (array_->at(i) == key) { - hit = true; - if (OB_FAIL(bitset_.del_member(i))) { - } - break; - } - } - if (OB_SUCCESS == ret) { - if (!hit) { - ret = OB_MASK_SET_NO_NODE; - } - } - } - return ret; - } - int mask(const T &key, bool &is_new_mask) - { - int ret = OB_SUCCESS; - bool tmp_new_mask = false; - if (!is_inited_) { - ret = OB_NOT_INIT; - } else { - bool hit = false; - for (int64_t i = 0 ; OB_SUCCESS == ret && i < array_->count(); i++) { - if (array_->at(i) == key) { - hit = true; - if (bitset_.has_member(i)) { - tmp_new_mask = false; - } else if (OB_FAIL(bitset_.add_member(i))) { - } else { - tmp_new_mask = true; - } - break; - } - } - if (OB_SUCCESS == ret) { - if (!hit) { - ret = OB_MASK_SET_NO_NODE; - } else { - is_new_mask = tmp_new_mask; - } - } - } - return ret; - } - bool is_all_mask() const - { - bool bool_ret = false; - if (is_inited_) { - bool_ret = (array_->count() == bitset_.num_members()); - } - return bool_ret; - } - int get_not_mask(ObIArray &array) const - { - int ret = OB_SUCCESS; - if (!is_inited_) { - ret = OB_NOT_INIT; - } else { - array.reset(); - for (int64_t i = 0; OB_SUCC(ret) && i < array_->count(); ++i) { - if (!bitset_.has_member(i)) { - if (OB_FAIL(array.push_back(array_->at(i)))) { - } - } - } - } - return ret; - } - bool is_mask(const T &key) - { - bool bool_ret = false; - if (is_inited_) { - for (int64_t i = 0; i < array_->count(); ++i) { - if (array_->at(i) == key && bitset_.has_member(i)) { - bool_ret = true; - break; - } - } - } - return bool_ret; - } -private: - bool is_inited_; - const ObIArray *array_; - ObBitSet<> bitset_; -}; - -} // common -} // oceanbase -#endif // OCEANBASE_COMMON_OB_MASK_SET_ +#ifndef OCEANBASE_COMMON_OB_MASK_SET2_ +#define OCEANBASE_COMMON_OB_MASK_SET2_ + +#include "ob_bit_set.h" +#include "ob_iarray.h" + +namespace oceanbase +{ +namespace common +{ + +template +class ObMaskSet2 +{ +public: + ObMaskSet2() : is_inited_(false), array_(NULL), bitset_() {} + ~ObMaskSet2() {} + int init(const ObIArray *array) + { + int ret = OB_SUCCESS; + if (NULL == array) { + ret = OB_INVALID_ARGUMENT; + } else if (OB_FAIL(bitset_.reserve(array->count()))) { + } else { + array_ = array; + is_inited_ = true; + } + return ret; + } + void reset() + { + is_inited_ = false; + array_ = NULL; + bitset_.reuse(); + } + void clear() + { + bitset_.reuse(); + } +public: + int mask(const T &key) + { + int ret = OB_SUCCESS; + if (!is_inited_) { + ret = OB_NOT_INIT; + } else { + bool hit = false; + for (int64_t i = 0 ; OB_SUCCESS == ret && i < array_->count(); i++) { + if (array_->at(i) == key) { + hit = true; + if (OB_FAIL(bitset_.add_member(i))) { + } + break; + } + } + if (OB_SUCCESS == ret) { + if (!hit) { + ret = OB_MASK_SET_NO_NODE; + } + } + } + return ret; + } + int unmask(const T &key) + { + int ret = OB_SUCCESS; + if (!is_inited_) { + ret = OB_NOT_INIT; + } else { + bool hit = false; + for (int64_t i = 0 ; OB_SUCCESS == ret && i < array_->count(); i++) { + if (array_->at(i) == key) { + hit = true; + if (OB_FAIL(bitset_.del_member(i))) { + } + break; + } + } + if (OB_SUCCESS == ret) { + if (!hit) { + ret = OB_MASK_SET_NO_NODE; + } + } + } + return ret; + } + int mask(const T &key, bool &is_new_mask) + { + int ret = OB_SUCCESS; + bool tmp_new_mask = false; + if (!is_inited_) { + ret = OB_NOT_INIT; + } else { + bool hit = false; + for (int64_t i = 0 ; OB_SUCCESS == ret && i < array_->count(); i++) { + if (array_->at(i) == key) { + hit = true; + if (bitset_.has_member(i)) { + tmp_new_mask = false; + } else if (OB_FAIL(bitset_.add_member(i))) { + } else { + tmp_new_mask = true; + } + break; + } + } + if (OB_SUCCESS == ret) { + if (!hit) { + ret = OB_MASK_SET_NO_NODE; + } else { + is_new_mask = tmp_new_mask; + } + } + } + return ret; + } + bool is_all_mask() const + { + bool bool_ret = false; + if (is_inited_) { + bool_ret = (array_->count() == bitset_.num_members()); + } + return bool_ret; + } + int get_not_mask(ObIArray &array) const + { + int ret = OB_SUCCESS; + if (!is_inited_) { + ret = OB_NOT_INIT; + } else { + array.reset(); + for (int64_t i = 0; OB_SUCC(ret) && i < array_->count(); ++i) { + if (!bitset_.has_member(i)) { + if (OB_FAIL(array.push_back(array_->at(i)))) { + } + } + } + } + return ret; + } + bool is_mask(const T &key) + { + bool bool_ret = false; + if (is_inited_) { + for (int64_t i = 0; i < array_->count(); ++i) { + if (array_->at(i) == key && bitset_.has_member(i)) { + bool_ret = true; + break; + } + } + } + return bool_ret; + } +private: + bool is_inited_; + const ObIArray *array_; + ObBitSet<> bitset_; +}; + +} // common +} // oceanbase +#endif // OCEANBASE_COMMON_OB_MASK_SET_ diff --git a/deps/oblib/src/lib/container/ob_paringheap.h b/deps/oblib/src/lib/container/ob_paringheap.h index 61ca8a58b..cfeec4169 100644 --- a/deps/oblib/src/lib/container/ob_paringheap.h +++ b/deps/oblib/src/lib/container/ob_paringheap.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_PARING_HEAP_H_ diff --git a/deps/oblib/src/lib/container/ob_raw_se_array.h b/deps/oblib/src/lib/container/ob_raw_se_array.h index d5c752bd4..2f77e1795 100644 --- a/deps/oblib/src/lib/container/ob_raw_se_array.h +++ b/deps/oblib/src/lib/container/ob_raw_se_array.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_CONTAINER_RAW_SE_ARRAY_ diff --git a/deps/oblib/src/lib/container/ob_rbtree.h b/deps/oblib/src/lib/container/ob_rbtree.h index d3acdb32a..5d3cf6a0e 100644 --- a/deps/oblib/src/lib/container/ob_rbtree.h +++ b/deps/oblib/src/lib/container/ob_rbtree.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RBTREE_REDBLACKTREE_ diff --git a/deps/oblib/src/lib/container/ob_ring_array.h b/deps/oblib/src/lib/container/ob_ring_array.h index 0f6ca308c..d471a050f 100644 --- a/deps/oblib/src/lib/container/ob_ring_array.h +++ b/deps/oblib/src/lib/container/ob_ring_array.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_CONTAINER_OB_RING_ARRAY_ diff --git a/deps/oblib/src/lib/container/ob_ring_buffer.cpp b/deps/oblib/src/lib/container/ob_ring_buffer.cpp index ba6eae77d..285f8046e 100644 --- a/deps/oblib/src/lib/container/ob_ring_buffer.cpp +++ b/deps/oblib/src/lib/container/ob_ring_buffer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/container/ob_ring_buffer.h" diff --git a/deps/oblib/src/lib/container/ob_ring_buffer.h b/deps/oblib/src/lib/container/ob_ring_buffer.h index b1c365889..a6392345d 100644 --- a/deps/oblib/src/lib/container/ob_ring_buffer.h +++ b/deps/oblib/src/lib/container/ob_ring_buffer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_CONTAINER_OB_RING_BUFFER_ diff --git a/deps/oblib/src/lib/container/ob_se_array.h b/deps/oblib/src/lib/container/ob_se_array.h index 457284ce8..3085a8d8c 100644 --- a/deps/oblib/src/lib/container/ob_se_array.h +++ b/deps/oblib/src/lib/container/ob_se_array.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_CONTAINER_SE_ARRAY_ diff --git a/deps/oblib/src/lib/container/ob_se_array_iterator.h b/deps/oblib/src/lib/container/ob_se_array_iterator.h index b00020097..96d441545 100644 --- a/deps/oblib/src/lib/container/ob_se_array_iterator.h +++ b/deps/oblib/src/lib/container/ob_se_array_iterator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_SE_ARRAY_ITERATOR_H diff --git a/deps/oblib/src/lib/container/ob_tuple.h b/deps/oblib/src/lib/container/ob_tuple.h index fc62cc907..d56356ccf 100644 --- a/deps/oblib/src/lib/container/ob_tuple.h +++ b/deps/oblib/src/lib/container/ob_tuple.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_COORDINATOR_OB_TUPLR_H @@ -463,4 +467,4 @@ constexpr bool operator==(const ObTuple &lhs, const ObTuple &rhs) { } } -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/container/ob_vector.h b/deps/oblib/src/lib/container/ob_vector.h index ea944b874..d45ca11af 100644 --- a/deps/oblib/src/lib/container/ob_vector.h +++ b/deps/oblib/src/lib/container/ob_vector.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_VECTOR_H_ diff --git a/deps/oblib/src/lib/container/ob_vector.ipp b/deps/oblib/src/lib/container/ob_vector.ipp index 7720731b8..e3282fdd0 100644 --- a/deps/oblib/src/lib/container/ob_vector.ipp +++ b/deps/oblib/src/lib/container/ob_vector.ipp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/src/lib/core_local/ob_core_local_storage.h b/deps/oblib/src/lib/core_local/ob_core_local_storage.h index f0122485f..2518ecbc8 100644 --- a/deps/oblib/src/lib/core_local/ob_core_local_storage.h +++ b/deps/oblib/src/lib/core_local/ob_core_local_storage.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_CORE_LOCAL_OB_CORE_LOCAL_STORAGE_ diff --git a/deps/oblib/src/lib/coro/co_var.h b/deps/oblib/src/lib/coro/co_var.h index f43a7813f..6a9ede906 100644 --- a/deps/oblib/src/lib/coro/co_var.h +++ b/deps/oblib/src/lib/coro/co_var.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OBLIB_CO_VAR_H diff --git a/deps/oblib/src/lib/cpu/ob_cpu_topology.cpp b/deps/oblib/src/lib/cpu/ob_cpu_topology.cpp index c140c3527..9c82d9b20 100644 --- a/deps/oblib/src/lib/cpu/ob_cpu_topology.cpp +++ b/deps/oblib/src/lib/cpu/ob_cpu_topology.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON @@ -89,11 +93,11 @@ int CpuFlagSet::init_from_os(uint64_t& flags) { int ret = OB_SUCCESS; flags = 0; - const char* const CPU_FLAG_CMDS[(int)CpuFlag::MAX] = {"grep -E ' sse4_2( |$)' /proc/cpuinfo", - "grep -E ' avx( |$)' /proc/cpuinfo", - "grep -E ' avx2( |$)' /proc/cpuinfo", - "grep -E ' avx512bw( |$)' /proc/cpuinfo", - "grep -E ' asimd( |$)' /proc/cpuinfo"}; + const char* const CPU_FLAG_CMDS[(int)CpuFlag::MAX] = {"grep -E ' sse4_2( |$)' /proc/cpuinfo > /dev/null 2>&1", + "grep -E ' avx( |$)' /proc/cpuinfo > /dev/null 2>&1", + "grep -E ' avx2( |$)' /proc/cpuinfo > /dev/null 2>&1", + "grep -E ' avx512bw( |$)' /proc/cpuinfo > /dev/null 2>&1", + "grep -E ' asimd( |$)' /proc/cpuinfo > /dev/null 2>&1"}; for (int i = 0; i < (int)CpuFlag::MAX; ++i) { int system_ret = system(CPU_FLAG_CMDS[i]); if (system_ret != 0) { diff --git a/deps/oblib/src/lib/cpu/ob_cpu_topology.h b/deps/oblib/src/lib/cpu/ob_cpu_topology.h index 702eccb54..04aabac09 100644 --- a/deps/oblib/src/lib/cpu/ob_cpu_topology.h +++ b/deps/oblib/src/lib/cpu/ob_cpu_topology.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_CPU_TOPOLOGY_ diff --git a/deps/oblib/src/lib/encode/ob_base64_encode.cpp b/deps/oblib/src/lib/encode/ob_base64_encode.cpp index 9d480fcd6..4bcb83544 100644 --- a/deps/oblib/src/lib/encode/ob_base64_encode.cpp +++ b/deps/oblib/src/lib/encode/ob_base64_encode.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/encode/ob_base64_encode.h" diff --git a/deps/oblib/src/lib/encode/ob_base64_encode.h b/deps/oblib/src/lib/encode/ob_base64_encode.h index ac2142300..46cd89412 100644 --- a/deps/oblib/src/lib/encode/ob_base64_encode.h +++ b/deps/oblib/src/lib/encode/ob_base64_encode.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_BASE64_ENCODE_H_ diff --git a/deps/oblib/src/lib/encode/ob_quoted_printable_encode.cpp b/deps/oblib/src/lib/encode/ob_quoted_printable_encode.cpp index 33712c6b9..2e059b561 100644 --- a/deps/oblib/src/lib/encode/ob_quoted_printable_encode.cpp +++ b/deps/oblib/src/lib/encode/ob_quoted_printable_encode.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/encode/ob_quoted_printable_encode.h" @@ -22,8 +26,8 @@ char ObQuotedPrintableEncoder::hex[] = "0123456789ABCDEF"; //todo for mime '?' is not printable //this func only for encode raw to one line, do not do soft break -//为text encode 设计, 换行可以没有CR +// Designed for text encoding, newline can have no CR } //namespace common -} //namespace oceanbase \ No newline at end of file +} //namespace oceanbase diff --git a/deps/oblib/src/lib/encode/ob_quoted_printable_encode.h b/deps/oblib/src/lib/encode/ob_quoted_printable_encode.h index f44621cf7..9927fdd78 100644 --- a/deps/oblib/src/lib/encode/ob_quoted_printable_encode.h +++ b/deps/oblib/src/lib/encode/ob_quoted_printable_encode.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_QUOTED_PRINTABLE_ENCODE_H_ diff --git a/deps/oblib/src/lib/encode/ob_uuencode.cpp b/deps/oblib/src/lib/encode/ob_uuencode.cpp index 77d080e3c..2e0548d69 100644 --- a/deps/oblib/src/lib/encode/ob_uuencode.cpp +++ b/deps/oblib/src/lib/encode/ob_uuencode.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/encode/ob_uuencode.h" @@ -23,4 +27,4 @@ namespace common } //namespace common -} //namespace oceanbase \ No newline at end of file +} //namespace oceanbase diff --git a/deps/oblib/src/lib/encode/ob_uuencode.h b/deps/oblib/src/lib/encode/ob_uuencode.h index 8e26cffe3..cae854a5a 100644 --- a/deps/oblib/src/lib/encode/ob_uuencode.h +++ b/deps/oblib/src/lib/encode/ob_uuencode.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_UUENCODE_H_ diff --git a/deps/oblib/src/lib/encrypt/ob_encrypt.cpp b/deps/oblib/src/lib/encrypt/ob_encrypt.cpp index 30cb6180b..723cb444b 100644 --- a/deps/oblib/src/lib/encrypt/ob_encrypt.cpp +++ b/deps/oblib/src/lib/encrypt/ob_encrypt.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/encrypt/ob_encrypt.h" diff --git a/deps/oblib/src/lib/encrypt/ob_encrypt.h b/deps/oblib/src/lib/encrypt/ob_encrypt.h index 4a39c3cdf..00b694050 100644 --- a/deps/oblib/src/lib/encrypt/ob_encrypt.h +++ b/deps/oblib/src/lib/encrypt/ob_encrypt.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEANBASE_COMMON_DES_CRYPT_H_ diff --git a/deps/oblib/src/lib/encrypt/ob_encrypted_helper.cpp b/deps/oblib/src/lib/encrypt/ob_encrypted_helper.cpp index 0f929cc55..4dd6a0562 100644 --- a/deps/oblib/src/lib/encrypt/ob_encrypted_helper.cpp +++ b/deps/oblib/src/lib/encrypt/ob_encrypted_helper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE_SCHEMA diff --git a/deps/oblib/src/lib/encrypt/ob_encrypted_helper.h b/deps/oblib/src/lib/encrypt/ob_encrypted_helper.h index 0770955a4..43713b83c 100644 --- a/deps/oblib/src/lib/encrypt/ob_encrypted_helper.h +++ b/deps/oblib/src/lib/encrypt/ob_encrypted_helper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_ENCRYPT_OB_ENCRYPTED_HELPER_ diff --git a/deps/oblib/src/lib/enumset/ob_enum_set_meta.cpp b/deps/oblib/src/lib/enumset/ob_enum_set_meta.cpp index 2675cba4f..0a3ed741c 100644 --- a/deps/oblib/src/lib/enumset/ob_enum_set_meta.cpp +++ b/deps/oblib/src/lib/enumset/ob_enum_set_meta.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -176,4 +180,4 @@ OB_DEF_SERIALIZE_SIZE(ObEnumSetMeta) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/enumset/ob_enum_set_meta.h b/deps/oblib/src/lib/enumset/ob_enum_set_meta.h index b7e0520a5..f41c22fd7 100644 --- a/deps/oblib/src/lib/enumset/ob_enum_set_meta.h +++ b/deps/oblib/src/lib/enumset/ob_enum_set_meta.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_ENUM_SET_EMTA_TYPE_ diff --git a/deps/oblib/src/lib/file/config.cpp b/deps/oblib/src/lib/file/config.cpp index cd15c7f94..67d27aefb 100644 --- a/deps/oblib/src/lib/file/config.cpp +++ b/deps/oblib/src/lib/file/config.cpp @@ -23,7 +23,7 @@ namespace obsys { } /** - * 解析字符串 + * Parse string */ int ObSysConfig::parseValue(char *str, char *key, char *val) { @@ -125,7 +125,7 @@ namespace obsys { } /** - * 加载文件 + * load file */ int ObSysConfig::load(const char *filename) { @@ -205,7 +205,7 @@ namespace obsys { } /** - * 取一个string + * take a string */ const char *ObSysConfig::getString(const char *section, const string& key, const char *d) { @@ -221,7 +221,7 @@ namespace obsys { } /** - * 取一string列表 + * get a string list */ vector ObSysConfig::getStringList(const char *section, const string& key) { vector ret; @@ -246,7 +246,7 @@ namespace obsys { } /** - * 取一整型 + * Get an integer */ int ObSysConfig::getInt(const char *section, const string& key, int d) { @@ -255,7 +255,7 @@ namespace obsys { } /** - * 取一int list + * get an int list */ vector ObSysConfig::getIntList(const char *section, const string& key) { vector ret; diff --git a/deps/oblib/src/lib/file/config.h b/deps/oblib/src/lib/file/config.h index 82d2db966..1c85e415b 100644 --- a/deps/oblib/src/lib/file/config.h +++ b/deps/oblib/src/lib/file/config.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef TBSYS_CONFIG_H @@ -20,7 +24,7 @@ namespace obsys { /** -* @brief 生成string的hash值 +* @brief Generate the hash value of string */ struct st_str_hash { size_t operator()(const std::string& str) const { @@ -35,7 +39,7 @@ namespace obsys { #define OB_TBSYS_CONFIG obsys::ObSysConfig::getCConfig() /** - * @brief 解析配置文件,并将配置项以key-value的形式存储到内存中 + * @brief Parse the configuration file, and store the configuration items as key-value pairs in memory */ class ObSysConfig { diff --git a/deps/oblib/src/lib/file/file_directory_utils.cpp b/deps/oblib/src/lib/file/file_directory_utils.cpp index b739b42f2..5c940e9ad 100644 --- a/deps/oblib/src/lib/file/file_directory_utils.cpp +++ b/deps/oblib/src/lib/file/file_directory_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/file/file_directory_utils.h" @@ -40,8 +44,7 @@ int FileDirectoryUtils::is_exists(const char *file_path, bool &result) return ret; } -//return true if file is accessible -int FileDirectoryUtils::is_accessible(const char *file_path, bool &result) +int FileDirectoryUtils::check_directory_mode(const char *file_path, int mode, bool &result) { int ret = OB_SUCCESS; result = false; @@ -49,7 +52,7 @@ int FileDirectoryUtils::is_accessible(const char *file_path, bool &result) ret = OB_INVALID_ARGUMENT; LIB_LOG(WARN, "invalid arguments.", KCSTRING(file_path), K(ret)); } else { - if (0 == access(file_path, R_OK)) { + if (0 == access(file_path, mode)) { result = true; } else { LIB_LOG(WARN, "access file failed", KERRMSG, K(file_path)); @@ -57,6 +60,16 @@ int FileDirectoryUtils::is_accessible(const char *file_path, bool &result) } return ret; } +//return true if file is accessible +int FileDirectoryUtils::is_accessible(const char *file_path, bool &result) +{ + return check_directory_mode(file_path, R_OK, result); +} + +int FileDirectoryUtils::is_writable(const char *file_path, bool &result) +{ + return check_directory_mode(file_path, W_OK, result); +} //return ture if dirname is a directory int FileDirectoryUtils::is_directory(const char *directory_path, bool &result) diff --git a/deps/oblib/src/lib/file/file_directory_utils.h b/deps/oblib/src/lib/file/file_directory_utils.h index 207619de8..1af28b7d0 100644 --- a/deps/oblib/src/lib/file/file_directory_utils.h +++ b/deps/oblib/src/lib/file/file_directory_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_FILE_DIRECTORY_UTILS_H_ @@ -30,6 +34,7 @@ class FileDirectoryUtils public: static const int MAX_PATH = 512; static int is_exists(const char *file_path, bool &result); + static int is_writable(const char *file_path, bool &result); static int is_accessible(const char *file_path, bool &result); static int is_directory(const char *directory_path, bool &result); static int is_link(const char *link_path, bool &result); @@ -49,6 +54,9 @@ class FileDirectoryUtils static int delete_directory_rec(const char *path); static int delete_tmp_file_or_directory_at(const char *path); static int fsync_dir(const char *dir_path); + +private: + static int check_directory_mode(const char *file_path, int mode, bool &result); }; typedef FileDirectoryUtils FSU; diff --git a/deps/oblib/src/lib/file/ob_file.cpp b/deps/oblib/src/lib/file/ob_file.cpp index 7faf8a165..88950dcef 100644 --- a/deps/oblib/src/lib/file/ob_file.cpp +++ b/deps/oblib/src/lib/file/ob_file.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/file/ob_file.h" diff --git a/deps/oblib/src/lib/file/ob_file.h b/deps/oblib/src/lib/file/ob_file.h index 54b41f80e..1c838cdf9 100644 --- a/deps/oblib/src/lib/file/ob_file.h +++ b/deps/oblib/src/lib/file/ob_file.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_FILE_H_ diff --git a/deps/oblib/src/lib/file/ob_fileinfo_manager.h b/deps/oblib/src/lib/file/ob_fileinfo_manager.h index bf20be184..8525df08f 100644 --- a/deps/oblib/src/lib/file/ob_fileinfo_manager.h +++ b/deps/oblib/src/lib/file/ob_fileinfo_manager.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_UPDATESERVER_FILEINFO_MANAGER_H_ diff --git a/deps/oblib/src/lib/file/ob_string_util.cpp b/deps/oblib/src/lib/file/ob_string_util.cpp index b816bc7ba..f79d5d147 100644 --- a/deps/oblib/src/lib/file/ob_string_util.cpp +++ b/deps/oblib/src/lib/file/ob_string_util.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/file/ob_string_util.h" diff --git a/deps/oblib/src/lib/file/ob_string_util.h b/deps/oblib/src/lib/file/ob_string_util.h index 48e38a767..99b7f0221 100644 --- a/deps/oblib/src/lib/file/ob_string_util.h +++ b/deps/oblib/src/lib/file/ob_string_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_STRING_UTIL_H_ diff --git a/deps/oblib/src/lib/function/ob_function.h b/deps/oblib/src/lib/function/ob_function.h index a328126b1..ce5482cc5 100644 --- a/deps/oblib/src/lib/function/ob_function.h +++ b/deps/oblib/src/lib/function/ob_function.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ /** diff --git a/deps/oblib/src/lib/future/ob_future.h b/deps/oblib/src/lib/future/ob_future.h index f8aef26e3..734461cf5 100644 --- a/deps/oblib/src/lib/future/ob_future.h +++ b/deps/oblib/src/lib/future/ob_future.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ /** diff --git a/deps/oblib/src/lib/geo/ob_geo.cpp b/deps/oblib/src/lib/geo/ob_geo.cpp index baef6fcca..1e3682897 100644 --- a/deps/oblib/src/lib/geo/ob_geo.cpp +++ b/deps/oblib/src/lib/geo/ob_geo.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the JSON tree abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -18,4 +21,4 @@ namespace oceanbase { namespace common { } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo.h b/deps/oblib/src/lib/geo/ob_geo.h index f26657fde..cf386e055 100644 --- a/deps/oblib/src/lib/geo/ob_geo.h +++ b/deps/oblib/src/lib/geo/ob_geo.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_ diff --git a/deps/oblib/src/lib/geo/ob_geo_3d.cpp b/deps/oblib/src/lib/geo/ob_geo_3d.cpp index 05e894819..25d2eef5f 100644 --- a/deps/oblib/src/lib/geo/ob_geo_3d.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_3d.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -1428,4 +1432,4 @@ int ObGeo3DLonLatChecker::visit_pointz_start(ObGeometry3D *geo, bool is_inner) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_3d.h b/deps/oblib/src/lib/geo/ob_geo_3d.h index e273c81d5..10c58f04d 100644 --- a/deps/oblib/src/lib/geo/ob_geo_3d.h +++ b/deps/oblib/src/lib/geo/ob_geo_3d.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_3D_ @@ -285,4 +289,4 @@ class ObGeo3DLonLatChecker : public ObGeo3DVisitor } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_GEO_OB_GEO_3D_ \ No newline at end of file +#endif // OCEANBASE_LIB_GEO_OB_GEO_3D_ diff --git a/deps/oblib/src/lib/geo/ob_geo_affine_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_affine_visitor.cpp index f944c6131..1f9444e2f 100644 --- a/deps/oblib/src/lib/geo/ob_geo_affine_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_affine_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -49,4 +53,4 @@ int ObGeoAffineVisitor::visit(ObCartesianPoint *geo) return OB_SUCCESS; } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_affine_visitor.h b/deps/oblib/src/lib/geo/ob_geo_affine_visitor.h index 2358eca3c..7d920cec2 100644 --- a/deps/oblib/src/lib/geo/ob_geo_affine_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_affine_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_AFFINE_VISITOR_ #define OCEANBASE_LIB_GEO_OB_GEO_AFFINE_VISITOR_ @@ -44,4 +48,4 @@ class ObGeoAffineVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_GEO_OB_GEO_AFFINE_VISITOR_ \ No newline at end of file +#endif // OCEANBASE_LIB_GEO_OB_GEO_AFFINE_VISITOR_ diff --git a/deps/oblib/src/lib/geo/ob_geo_bin.cpp b/deps/oblib/src/lib/geo/ob_geo_bin.cpp index 0fee6738c..45f9783b6 100644 --- a/deps/oblib/src/lib/geo/ob_geo_bin.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_bin.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the geo bin abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/geo/ob_geo_bin.h b/deps/oblib/src/lib/geo/ob_geo_bin.h index 83300c7a8..c22e650b2 100644 --- a/deps/oblib/src/lib/geo/ob_geo_bin.h +++ b/deps/oblib/src/lib/geo/ob_geo_bin.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_BIN_ diff --git a/deps/oblib/src/lib/geo/ob_geo_bin_iter.h b/deps/oblib/src/lib/geo/ob_geo_bin_iter.h index fb8d44a65..9b8c8f682 100644 --- a/deps/oblib/src/lib/geo/ob_geo_bin_iter.h +++ b/deps/oblib/src/lib/geo/ob_geo_bin_iter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_BIN_ITER_ diff --git a/deps/oblib/src/lib/geo/ob_geo_bin_iter.ipp b/deps/oblib/src/lib/geo/ob_geo_bin_iter.ipp index 7b487f633..1582e3007 100644 --- a/deps/oblib/src/lib/geo/ob_geo_bin_iter.ipp +++ b/deps/oblib/src/lib/geo/ob_geo_bin_iter.ipp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the geo bin wkb iterator. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_geo.h" @@ -431,4 +434,4 @@ void ObWkbUtils::get_sub_addr_common(const T& obj, } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_bin_traits.h b/deps/oblib/src/lib/geo/ob_geo_bin_traits.h index 981920fd6..2e5d706e0 100644 --- a/deps/oblib/src/lib/geo/ob_geo_bin_traits.h +++ b/deps/oblib/src/lib/geo/ob_geo_bin_traits.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_BIN_TRAITS_ diff --git a/deps/oblib/src/lib/geo/ob_geo_box_clip_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_box_clip_visitor.cpp index 8c7e6b73c..f9a2e0867 100644 --- a/deps/oblib/src/lib/geo/ob_geo_box_clip_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_box_clip_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -1016,4 +1020,4 @@ int ObGeoBoxClipVisitor::visit(ObCartesianMultipolygon *geo) return ret; } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_box_clip_visitor.h b/deps/oblib/src/lib/geo/ob_geo_box_clip_visitor.h index 1bcc90233..56d1c02ad 100644 --- a/deps/oblib/src/lib/geo/ob_geo_box_clip_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_box_clip_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_BOX_CLIP_VISITOR_ @@ -149,4 +153,4 @@ class ObGeoBoxClipVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_cache.cpp b/deps/oblib/src/lib/geo/ob_geo_cache.cpp index 7cfb61bbf..3ba34a5e4 100644 --- a/deps/oblib/src/lib/geo/ob_geo_cache.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_cache.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -102,4 +106,4 @@ int ObCachedGeomBase::check_any_vertexes_in_geo(ObGeometry& geo, bool &res) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_cache.h b/deps/oblib/src/lib/geo/ob_geo_cache.h index 4ea127e75..021ca082a 100644 --- a/deps/oblib/src/lib/geo/ob_geo_cache.h +++ b/deps/oblib/src/lib/geo/ob_geo_cache.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_CACHE_ diff --git a/deps/oblib/src/lib/geo/ob_geo_cache_linestring.cpp b/deps/oblib/src/lib/geo/ob_geo_cache_linestring.cpp index 7fd032f30..a29ca6d68 100644 --- a/deps/oblib/src/lib/geo/ob_geo_cache_linestring.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_cache_linestring.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -92,4 +96,4 @@ int ObCachedGeoLinestring::intersects(ObGeometry& geo, ObGeoEvalCtx& gis_context } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_cache_linestring.h b/deps/oblib/src/lib/geo/ob_geo_cache_linestring.h index 88b198bd1..36c73042c 100644 --- a/deps/oblib/src/lib/geo/ob_geo_cache_linestring.h +++ b/deps/oblib/src/lib/geo/ob_geo_cache_linestring.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_CACHE_LINESTRING_ @@ -46,4 +50,4 @@ class ObCachedGeoLinestring : public ObCachedGeomBase { } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_GEO_OB_CACHE_LINESTRING_ \ No newline at end of file +#endif // OCEANBASE_LIB_GEO_OB_CACHE_LINESTRING_ diff --git a/deps/oblib/src/lib/geo/ob_geo_cache_point.cpp b/deps/oblib/src/lib/geo/ob_geo_cache_point.cpp index ba2d8ea24..837ad1a59 100644 --- a/deps/oblib/src/lib/geo/ob_geo_cache_point.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_cache_point.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -32,4 +36,4 @@ int ObCachedGeoPoint::intersects(ObGeometry& geo, ObGeoEvalCtx& gis_context, boo } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_cache_point.h b/deps/oblib/src/lib/geo/ob_geo_cache_point.h index 8bd3a1b60..6b8689178 100644 --- a/deps/oblib/src/lib/geo/ob_geo_cache_point.h +++ b/deps/oblib/src/lib/geo/ob_geo_cache_point.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_CACHE_POINT_ diff --git a/deps/oblib/src/lib/geo/ob_geo_cache_polygon.cpp b/deps/oblib/src/lib/geo/ob_geo_cache_polygon.cpp index f00ec352f..682602328 100644 --- a/deps/oblib/src/lib/geo/ob_geo_cache_polygon.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_cache_polygon.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/geo/ob_geo_cache_polygon.h b/deps/oblib/src/lib/geo/ob_geo_cache_polygon.h index 8d0ee558e..f7052ec38 100644 --- a/deps/oblib/src/lib/geo/ob_geo_cache_polygon.h +++ b/deps/oblib/src/lib/geo/ob_geo_cache_polygon.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_CACHE_POLYGON_ diff --git a/deps/oblib/src/lib/geo/ob_geo_check_empty_visitor.h b/deps/oblib/src/lib/geo/ob_geo_check_empty_visitor.h index 9a843787e..20827a426 100644 --- a/deps/oblib/src/lib/geo/ob_geo_check_empty_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_check_empty_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_CHECK_EMPTY_VISITOR_ #define OCEANBASE_LIB_GEO_OB_GEO_CHECK_EMPTY_VISITOR_ @@ -46,4 +50,4 @@ class ObGeoCheckEmptyVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_GEO_OB_GEO_CHECK_EMPTY_VISITOR_ \ No newline at end of file +#endif // OCEANBASE_LIB_GEO_OB_GEO_CHECK_EMPTY_VISITOR_ diff --git a/deps/oblib/src/lib/geo/ob_geo_close_ring_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_close_ring_visitor.cpp index 61ef43482..566ed930a 100644 --- a/deps/oblib/src/lib/geo/ob_geo_close_ring_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_close_ring_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -44,4 +48,4 @@ int ObGeoCloseRingVisitor::visit(ObCartesianLinearring *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_close_ring_visitor.h b/deps/oblib/src/lib/geo/ob_geo_close_ring_visitor.h index 301dc636f..1cf4e41f6 100644 --- a/deps/oblib/src/lib/geo/ob_geo_close_ring_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_close_ring_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_CLOSE_RING_VISITOR_ @@ -49,4 +53,4 @@ class ObGeoCloseRingVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_common.cpp b/deps/oblib/src/lib/geo/ob_geo_common.cpp index f94e6ffe3..501a6e274 100644 --- a/deps/oblib/src/lib/geo/ob_geo_common.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_common.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the geometry common abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -182,4 +185,4 @@ const char *ObWkbBuffer::ptr() } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_common.h b/deps/oblib/src/lib/geo/ob_geo_common.h index d2d021fc8..cdbcfcf55 100644 --- a/deps/oblib/src/lib/geo/ob_geo_common.h +++ b/deps/oblib/src/lib/geo/ob_geo_common.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the geometry common abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_COMMON_ @@ -144,7 +147,7 @@ class ObGeoNotImplementedException : public std::exception // for st_buffer_strategy and st_buffer -// 不能放lib/geo/ob_geo_func_common.h,由于这个func_common包含了boost库,st_buff头文件不能包含boost,会有编译问题 +// Cannot place lib/geo/ob_geo_func_common.h, as this func_common includes the boost library, and the st_buff header file cannot include boost, which would cause compilation issues struct ObGeoBufferStrategy { // default value @@ -208,4 +211,4 @@ struct ObGeoErrLogInfo } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_coordinate_range_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_coordinate_range_visitor.cpp index 7fb684b8e..2be05d51b 100644 --- a/deps/oblib/src/lib/geo/ob_geo_coordinate_range_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_coordinate_range_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -126,4 +130,4 @@ void ObGeoCoordinateRangeVisitor::reset() } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_coordinate_range_visitor.h b/deps/oblib/src/lib/geo/ob_geo_coordinate_range_visitor.h index f6292d5c1..fd0b3482d 100644 --- a/deps/oblib/src/lib/geo/ob_geo_coordinate_range_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_coordinate_range_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_COORDINATE_RANGE_VISITOR_ @@ -63,4 +67,4 @@ class ObGeoCoordinateRangeVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_denormalize_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_denormalize_visitor.cpp index a29728632..4ed269f10 100644 --- a/deps/oblib/src/lib/geo/ob_geo_denormalize_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_denormalize_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -41,4 +45,4 @@ int ObGeoDeNormalizeVisitor::visit(ObCartesianPoint *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_denormalize_visitor.h b/deps/oblib/src/lib/geo/ob_geo_denormalize_visitor.h index 9c681bc21..f31f0b48c 100644 --- a/deps/oblib/src/lib/geo/ob_geo_denormalize_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_denormalize_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_DENORMALIZE_VISITOR_ #define OCEANBASE_LIB_GEO_OB_GEO_DENORMALIZE_VISITOR_ @@ -45,4 +49,4 @@ class ObGeoDeNormalizeVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif //OCEANBASE_LIB_GEO_OB_GEO_DENORMALIZE_VISITOR_ \ No newline at end of file +#endif //OCEANBASE_LIB_GEO_OB_GEO_DENORMALIZE_VISITOR_ diff --git a/deps/oblib/src/lib/geo/ob_geo_dispatcher.h b/deps/oblib/src/lib/geo/ob_geo_dispatcher.h index 30d879b10..9d3aabe5a 100644 --- a/deps/oblib/src/lib/geo/ob_geo_dispatcher.h +++ b/deps/oblib/src/lib/geo/ob_geo_dispatcher.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_DISPATCHER_H_ @@ -1349,4 +1353,4 @@ struct FUNC_TYPE:: EvalTreeBiGeog { } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_OB_GEO_DISPATCHER_H_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_DISPATCHER_H_ diff --git a/deps/oblib/src/lib/geo/ob_geo_elevation_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_elevation_visitor.cpp index 5267dc24d..ec9583ffc 100644 --- a/deps/oblib/src/lib/geo/ob_geo_elevation_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_elevation_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -503,4 +507,4 @@ int ObGeoElevationVisitor::get_geometry_3D(ObGeometry *&geo) return ret; } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_elevation_visitor.h b/deps/oblib/src/lib/geo/ob_geo_elevation_visitor.h index f88f92b76..b121838ce 100644 --- a/deps/oblib/src/lib/geo/ob_geo_elevation_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_elevation_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_ELEVATION_VISITOR_ @@ -160,4 +164,4 @@ class ObGeoElevationVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_func_area.cpp b/deps/oblib/src/lib/geo/ob_geo_func_area.cpp index 0b40f6ae4..49e2eebe6 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_area.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_area.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_area. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -95,4 +98,4 @@ int ObGeoFuncArea::eval(const ObGeoEvalCtx &gis_context, double &result) } } // sql -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_area.h b/deps/oblib/src/lib/geo/ob_geo_func_area.h index f890f6142..d6b6299f0 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_area.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_area.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_area. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_AREA_ @@ -31,4 +34,4 @@ class ObGeoFuncArea } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_AREA_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_AREA_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_box.cpp b/deps/oblib/src/lib/geo/ob_geo_func_box.cpp index cc65d0d05..3b7f81fe4 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_box.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_box.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_box. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -418,4 +421,4 @@ int ObGeoFuncBox::eval(const ObGeoEvalCtx &gis_context, ObGeogBox *&result) } } // sql -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_box.h b/deps/oblib/src/lib/geo/ob_geo_func_box.h index 7b266e6b0..45c1b795d 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_box.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_box.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_box. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_BOX_H_ @@ -32,4 +35,4 @@ class ObGeoFuncBox } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_BOX_H_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_BOX_H_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_buffer.cpp b/deps/oblib/src/lib/geo/ob_geo_func_buffer.cpp index 719ba5dbe..29e4db14c 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_buffer.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_buffer.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_buffer. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/geo/ob_geo_func_buffer.h b/deps/oblib/src/lib/geo/ob_geo_func_buffer.h index 904365cc3..0a639f5a5 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_buffer.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_buffer.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_buffer. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_BUFFER_ @@ -43,4 +46,4 @@ class ObGeoFuncBuffer } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_BUFFER \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_BUFFER diff --git a/deps/oblib/src/lib/geo/ob_geo_func_centroid.cpp b/deps/oblib/src/lib/geo/ob_geo_func_centroid.cpp index 32ddc3fdd..6dc2c5d3d 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_centroid.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_centroid.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_centroid. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -152,4 +155,4 @@ int ObGeoFuncCentroid::eval(const ObGeoEvalCtx &gis_context, ObGeometry *&result } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_centroid.h b/deps/oblib/src/lib/geo/ob_geo_func_centroid.h index b842c71c1..23a43cf25 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_centroid.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_centroid.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_centroid. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_CENTROID_ @@ -31,4 +34,4 @@ class ObGeoFuncCentroid } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_CENTROID_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_CENTROID_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_common.h b/deps/oblib/src/lib/geo/ob_geo_func_common.h index 980f60b70..27619760d 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_common.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_common.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_common +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_COMMON_H_ @@ -195,4 +198,4 @@ struct ObGeoFuncResWithNull { } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_COMMON_H_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_COMMON_H_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_correct.cpp b/deps/oblib/src/lib/geo/ob_geo_func_correct.cpp index ab784e3d8..c533d43b2 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_correct.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_correct.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_correct. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -225,4 +228,4 @@ int ObGeoFuncCorrect::eval(const ObGeoEvalCtx &gis_context, int &result) } } // sql -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_correct.h b/deps/oblib/src/lib/geo/ob_geo_func_correct.h index dedc14d60..780df19c5 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_correct.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_correct.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_correct. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_CORRECT_ @@ -31,4 +34,4 @@ class ObGeoFuncCorrect } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_CORRECT_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_CORRECT_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_covered_by.cpp b/deps/oblib/src/lib/geo/ob_geo_func_covered_by.cpp index 1b6e7d517..5569bd25e 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_covered_by.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_covered_by.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_covered_by. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -1287,4 +1290,4 @@ int ObGeoFuncCoveredBy::eval(const ObGeoEvalCtx &gis_context, bool &result) } } // sql -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_covered_by.h b/deps/oblib/src/lib/geo/ob_geo_func_covered_by.h index afbdb9983..bba787567 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_covered_by.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_covered_by.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_covered_by. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_COVERED_BY_H_ @@ -31,4 +34,4 @@ class ObGeoFuncCoveredBy } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_COVERED_BY_H_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_COVERED_BY_H_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_crosses.cpp b/deps/oblib/src/lib/geo/ob_geo_func_crosses.cpp index f654ad06d..3ebae3dbb 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_crosses.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_crosses.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_crosses. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -801,4 +804,4 @@ int ObGeoFuncCrosses::eval(const ObGeoEvalCtx &gis_context, ObGeoFuncResWithNull return ObGeoFuncCrossesImpl::eval_geo_func(gis_context, result); } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_crosses.h b/deps/oblib/src/lib/geo/ob_geo_func_crosses.h index 2ecf5420d..cefefc236 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_crosses.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_crosses.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_crosses. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_CROSSES_ @@ -30,4 +33,4 @@ class ObGeoFuncCrosses } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_CROSSES_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_CROSSES_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_difference.cpp b/deps/oblib/src/lib/geo/ob_geo_func_difference.cpp index 67ce1086a..25d2ef040 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_difference.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_difference.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_difference. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/geo/ob_geo_func_difference.h b/deps/oblib/src/lib/geo/ob_geo_func_difference.h index c2103fafd..445ba7bd6 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_difference.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_difference.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_difference. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_DIFFERENCE_H_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_disjoint.cpp b/deps/oblib/src/lib/geo/ob_geo_func_disjoint.cpp index 66451e5c6..df41aba27 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_disjoint.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_disjoint.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_disjoint. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -150,4 +153,4 @@ int ObGeoFuncDisjoint::eval(const ObGeoEvalCtx &gis_context, bool &result) } } // sql -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_disjoint.h b/deps/oblib/src/lib/geo/ob_geo_func_disjoint.h index 3ba6e94e7..53ba4c845 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_disjoint.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_disjoint.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_disjoint. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_DISJOINT_ @@ -31,4 +34,4 @@ class ObGeoFuncDisjoint } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_DISJOINT_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_DISJOINT_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_dissolve_polygon.cpp b/deps/oblib/src/lib/geo/ob_geo_func_dissolve_polygon.cpp index a54052667..5cb653b38 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_dissolve_polygon.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_dissolve_polygon.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_dissolve_polygon. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -186,4 +189,4 @@ int ObGeoFuncDissolvePolygon::eval( } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_dissolve_polygon.h b/deps/oblib/src/lib/geo/ob_geo_func_dissolve_polygon.h index 82642263c..f2c466739 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_dissolve_polygon.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_dissolve_polygon.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_dissolve_polygon. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_DISSOLVEPOLYGON_ @@ -30,4 +33,4 @@ class ObGeoFuncDissolvePolygon }; } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_DISSOLVEPOLYGON_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_DISSOLVEPOLYGON_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_distance.cpp b/deps/oblib/src/lib/geo/ob_geo_func_distance.cpp index db5895824..c30eb191e 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_distance.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_distance.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_distance. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -254,4 +257,4 @@ int ObGeoFuncDistance::eval(const ObGeoEvalCtx &gis_context, double &result) } } // sql -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_distance.h b/deps/oblib/src/lib/geo/ob_geo_func_distance.h index aadeeefe0..b194c0faf 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_distance.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_distance.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_distance. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_DISTANCE_ @@ -31,4 +34,4 @@ class ObGeoFuncDistance } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_DISTANCE_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_DISTANCE_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_distance_sphere.cpp b/deps/oblib/src/lib/geo/ob_geo_func_distance_sphere.cpp index e8a609b95..2df769888 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_distance_sphere.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_distance_sphere.cpp @@ -1,14 +1,17 @@ - /** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_intersects. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -25,7 +28,7 @@ namespace common { namespace bg = boost::geometry; -// adapt mysql only support ObWkbGeogPoint、ObWkbGeogMultiPoint +// adapt mysql only support ObWkbGeogPoint, ObWkbGeogMultiPoint template int ObGeoFuncDistanceSphereUtil::eval(const GeoType1 *g1, const GeoType2 *g2, @@ -339,4 +342,4 @@ int ObGeoFuncDistanceSphere::eval(const ObGeoEvalCtx &gis_context, double &resul } } // sql -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_distance_sphere.h b/deps/oblib/src/lib/geo/ob_geo_func_distance_sphere.h index 46cfa3940..5472f2ab4 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_distance_sphere.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_distance_sphere.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_distance_sphere. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_DISTANCE_SPHERE_ @@ -59,4 +62,4 @@ class ObGeoFuncDistanceSphere } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_DISTANCE_SPHERE_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_DISTANCE_SPHERE_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_envelope.cpp b/deps/oblib/src/lib/geo/ob_geo_func_envelope.cpp index 399f49d34..62ba89f13 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_envelope.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_envelope.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_envelope. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -141,4 +144,4 @@ int ObGeoFuncEnvelope::eval(const ObGeoEvalCtx &gis_context, ObCartesianBox &res } } // sql -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_envelope.h b/deps/oblib/src/lib/geo/ob_geo_func_envelope.h index 045f27f87..620be1f6a 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_envelope.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_envelope.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_envelope. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_FUNC_ENVELOPE_ @@ -31,4 +34,4 @@ class ObGeoFuncEnvelope } // sql } // oceanbase -#endif // OCEANBASE_LIB_GEO_OB_GEO_FUNC_ENVELOPE_ \ No newline at end of file +#endif // OCEANBASE_LIB_GEO_OB_GEO_FUNC_ENVELOPE_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_equals.cpp b/deps/oblib/src/lib/geo/ob_geo_func_equals.cpp index ec611d2b0..10d785af9 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_equals.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_equals.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_equals. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -712,4 +715,4 @@ int ObGeoFuncEquals::eval(const ObGeoEvalCtx &gis_context, bool &result) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_equals.h b/deps/oblib/src/lib/geo/ob_geo_func_equals.h index 0de2ef8e5..e2713aa3f 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_equals.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_equals.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_equals. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_EQUALS_ @@ -31,4 +34,4 @@ class ObGeoFuncEquals } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_EQUALS_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_EQUALS_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_intersects.cpp b/deps/oblib/src/lib/geo/ob_geo_func_intersects.cpp index 15848b215..42850e7f6 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_intersects.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_intersects.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_intersects. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -366,4 +369,4 @@ int ObGeoFuncIntersects::eval(const ObGeoEvalCtx &gis_context, bool &result) } } // sql -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_intersects.h b/deps/oblib/src/lib/geo/ob_geo_func_intersects.h index e7b1c7895..bf7bf2f14 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_intersects.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_intersects.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_intersects. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_INTERSECTS_ @@ -31,4 +34,4 @@ class ObGeoFuncIntersects } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_INTERSECTS_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_INTERSECTS_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_isvalid.cpp b/deps/oblib/src/lib/geo/ob_geo_func_isvalid.cpp index f2b5f93d4..2d10d0804 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_isvalid.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_isvalid.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_isvalid. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -195,4 +198,4 @@ int ObGeoFuncIsValid::eval(const ObGeoEvalCtx &gis_context, bool &result) } } // sql -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_isvalid.h b/deps/oblib/src/lib/geo/ob_geo_func_isvalid.h index 3e7d04ceb..6fc4eddec 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_isvalid.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_isvalid.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_isvalid. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_ISVALID_ @@ -31,4 +34,4 @@ class ObGeoFuncIsValid } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_ISVALID_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_ISVALID_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_length.cpp b/deps/oblib/src/lib/geo/ob_geo_func_length.cpp index c8bf20340..f7ed63c65 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_length.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_length.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_length. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -103,4 +106,4 @@ int ObGeoFuncLength::eval(const ObGeoEvalCtx &gis_context, double &result) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_length.h b/deps/oblib/src/lib/geo/ob_geo_func_length.h index 9fe273bea..498e9ebbd 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_length.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_length.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_length. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_LENGTH_ @@ -31,4 +34,4 @@ class ObGeoFuncLength } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_LENGTH_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_LENGTH_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_overlaps.cpp b/deps/oblib/src/lib/geo/ob_geo_func_overlaps.cpp index bf5a5945a..e2a72cb9e 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_overlaps.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_overlaps.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_overlaps. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -702,4 +705,4 @@ int ObGeoFuncOverlaps::eval(const ObGeoEvalCtx &gis_context, ObGeoFuncResWithNul return ObGeoFuncOverlapsImpl::eval_geo_func(gis_context, result); } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_overlaps.h b/deps/oblib/src/lib/geo/ob_geo_func_overlaps.h index 71b511d23..22e36f940 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_overlaps.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_overlaps.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_overlaps. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_OVERLAPS_ @@ -30,4 +33,4 @@ class ObGeoFuncOverlaps } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_OVERLAPS_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_OVERLAPS_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_register.h b/deps/oblib/src/lib/geo/ob_geo_func_register.h index 7f7dac632..48de4089c 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_register.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_register.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_register. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_REGISTER_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_symdifference.h b/deps/oblib/src/lib/geo/ob_geo_func_symdifference.h index 6c9165da2..157b6d47b 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_symdifference.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_symdifference.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_symdifference. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_SYMDIFFERENCE_H_ @@ -33,4 +36,4 @@ class ObGeoFuncSymDifference } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_SYMDIFFERENCE_H_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_SYMDIFFERENCE_H_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_symdifference1.cpp b/deps/oblib/src/lib/geo/ob_geo_func_symdifference1.cpp index d226d50ad..531015e79 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_symdifference1.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_symdifference1.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_symdifference. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/geo/ob_geo_func_symdifference2.cpp b/deps/oblib/src/lib/geo/ob_geo_func_symdifference2.cpp index 377ea15a1..40f0ec9ae 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_symdifference2.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_symdifference2.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_symdifference. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/geo/ob_geo_func_symdifference_helper.ipp b/deps/oblib/src/lib/geo/ob_geo_func_symdifference_helper.ipp index 44abd5822..f0a5fa14b 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_symdifference_helper.ipp +++ b/deps/oblib/src/lib/geo/ob_geo_func_symdifference_helper.ipp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_symdifference. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -629,4 +632,4 @@ private: }; } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_touches.cpp b/deps/oblib/src/lib/geo/ob_geo_func_touches.cpp index 08615144c..924fe453d 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_touches.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_touches.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_touches. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -1148,4 +1151,4 @@ int ObGeoFuncTouches::eval(const ObGeoEvalCtx &gis_context, bool &result) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_touches.h b/deps/oblib/src/lib/geo/ob_geo_func_touches.h index f4cdc8d10..e320a4407 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_touches.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_touches.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_touches. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_TOUCHES_ @@ -30,4 +33,4 @@ class ObGeoFuncTouches } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_TOUCHES_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_TOUCHES_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_transform.cpp b/deps/oblib/src/lib/geo/ob_geo_func_transform.cpp index 0fd4d365a..a84352d00 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_transform.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_transform.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_transform. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/geo/ob_geo_func_transform.h b/deps/oblib/src/lib/geo/ob_geo_func_transform.h index c8f6c52d0..969de5665 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_transform.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_transform.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_transform. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_TRANSFORM @@ -31,4 +34,4 @@ class ObGeoFuncTransform } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_TRANSFORM \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_TRANSFORM diff --git a/deps/oblib/src/lib/geo/ob_geo_func_union.cpp b/deps/oblib/src/lib/geo/ob_geo_func_union.cpp index 7c7aa4b03..468eae07f 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_union.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_union.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_union. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/geo/ob_geo_func_union.h b/deps/oblib/src/lib/geo/ob_geo_func_union.h index 80b59bbc5..3373acfde 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_union.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_union.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_union. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_UNION_H_ @@ -33,4 +36,4 @@ class ObGeoFuncUnion } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_UNION_H_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_UNION_H_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_utils.cpp b/deps/oblib/src/lib/geo/ob_geo_func_utils.cpp index 948fa4cdf..be2282cf8 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_utils.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_utils.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_utils. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/geo/ob_geo_func_utils.h b/deps/oblib/src/lib/geo/ob_geo_func_utils.h index d133ce4d1..1b8540c76 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_utils.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_utils.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_utils. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_UTILS_H_ @@ -323,4 +326,4 @@ int ObGeoFuncUtils::ob_geo_gc_split_inner(const GcTreeType &gc, } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_UTILS_H_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_UTILS_H_ diff --git a/deps/oblib/src/lib/geo/ob_geo_func_within.cpp b/deps/oblib/src/lib/geo/ob_geo_func_within.cpp index e22c70e1d..a85e33a19 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_within.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_func_within.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_within. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -1697,4 +1700,4 @@ int ObGeoFuncWithin::eval(const ObGeoEvalCtx &gis_context, bool &result) } } // sql -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_func_within.h b/deps/oblib/src/lib/geo/ob_geo_func_within.h index b3ac55434..41d9ac752 100644 --- a/deps/oblib/src/lib/geo/ob_geo_func_within.h +++ b/deps/oblib/src/lib/geo/ob_geo_func_within.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for ob_geo_func_within. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEO_FUNC_WITHIN_ @@ -31,4 +34,4 @@ class ObGeoFuncWithin } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEO_FUNC_WITHIN_ \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEO_FUNC_WITHIN_ diff --git a/deps/oblib/src/lib/geo/ob_geo_grid_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_grid_visitor.cpp index 3b06a9b67..218526469 100644 --- a/deps/oblib/src/lib/geo/ob_geo_grid_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_grid_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -211,4 +215,4 @@ int ObGeoGridVisitor::finish(ObGeometry *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_grid_visitor.h b/deps/oblib/src/lib/geo/ob_geo_grid_visitor.h index 31e4c1a5d..6d9ae5f5e 100644 --- a/deps/oblib/src/lib/geo/ob_geo_grid_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_grid_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_GRID_VISITOR_ @@ -73,4 +77,4 @@ class ObGeoGridVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_ibin.cpp b/deps/oblib/src/lib/geo/ob_geo_ibin.cpp index b81790c1b..165868196 100644 --- a/deps/oblib/src/lib/geo/ob_geo_ibin.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_ibin.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the geo bin interface. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/geo/ob_geo_ibin.h b/deps/oblib/src/lib/geo/ob_geo_ibin.h index 055ac7acb..a18be3fc9 100644 --- a/deps/oblib/src/lib/geo/ob_geo_ibin.h +++ b/deps/oblib/src/lib/geo/ob_geo_ibin.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_IBIN_ diff --git a/deps/oblib/src/lib/geo/ob_geo_interior_point_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_interior_point_visitor.cpp index 64a5f465f..f55363ae3 100644 --- a/deps/oblib/src/lib/geo/ob_geo_interior_point_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_interior_point_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB #include "ob_geo_interior_point_visitor.h" diff --git a/deps/oblib/src/lib/geo/ob_geo_interior_point_visitor.h b/deps/oblib/src/lib/geo/ob_geo_interior_point_visitor.h index 8a94b5405..815d5dd4d 100644 --- a/deps/oblib/src/lib/geo/ob_geo_interior_point_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_interior_point_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_INTERIOR_POINT_VISITOR_ @@ -150,4 +154,4 @@ class ObGeoInteriorPointVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_latlong_check_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_latlong_check_visitor.cpp index a89506021..3e00052de 100644 --- a/deps/oblib/src/lib/geo/ob_geo_latlong_check_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_latlong_check_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL @@ -155,4 +159,4 @@ int ObGeoLatlongCheckVisitor::visit(ObGeographPoint *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_latlong_check_visitor.h b/deps/oblib/src/lib/geo/ob_geo_latlong_check_visitor.h index 979aad786..79480e84c 100644 --- a/deps/oblib/src/lib/geo/ob_geo_latlong_check_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_latlong_check_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_LATLONG_CHECK_VISITOR_ @@ -48,4 +52,4 @@ class ObGeoLatlongCheckVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_longtitude_correct_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_longtitude_correct_visitor.cpp index 9523a14b1..c4a2615a9 100644 --- a/deps/oblib/src/lib/geo/ob_geo_longtitude_correct_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_longtitude_correct_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -41,4 +45,4 @@ int ObGeoLongtitudeCorrectVisitor::visit(ObGeographPoint *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_longtitude_correct_visitor.h b/deps/oblib/src/lib/geo/ob_geo_longtitude_correct_visitor.h index 359120679..644c5b49f 100644 --- a/deps/oblib/src/lib/geo/ob_geo_longtitude_correct_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_longtitude_correct_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_LONGTITUDE_CORRECT_VISITOR_ @@ -43,4 +47,4 @@ class ObGeoLongtitudeCorrectVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_mvt.cpp b/deps/oblib/src/lib/geo/ob_geo_mvt.cpp index 715cc5102..71674e164 100644 --- a/deps/oblib/src/lib/geo/ob_geo_mvt.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_mvt.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/geo/ob_geo_mvt.h b/deps/oblib/src/lib/geo/ob_geo_mvt.h index 1c2db5d5d..95dcb76eb 100644 --- a/deps/oblib/src/lib/geo/ob_geo_mvt.h +++ b/deps/oblib/src/lib/geo/ob_geo_mvt.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_MVT_ @@ -132,4 +136,4 @@ class mvt_agg_result } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_mvt_encode_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_mvt_encode_visitor.cpp index c467833a5..fd3a8ce99 100644 --- a/deps/oblib/src/lib/geo/ob_geo_mvt_encode_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_mvt_encode_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -107,4 +111,4 @@ int ObGeoMvtEncodeVisitor::visit(ObIWkbGeomLinearRing *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_mvt_encode_visitor.h b/deps/oblib/src/lib/geo/ob_geo_mvt_encode_visitor.h index 0a2372e6f..66606ecdb 100644 --- a/deps/oblib/src/lib/geo/ob_geo_mvt_encode_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_mvt_encode_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_MVT_ENCODE_VISITOR_ #define OCEANBASE_LIB_GEO_OB_MVT_ENCODE_VISITOR_ @@ -64,4 +68,4 @@ class ObGeoMvtEncodeVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_GEO_OB_MVT_ENCODE_VISITOR_ \ No newline at end of file +#endif // OCEANBASE_LIB_GEO_OB_MVT_ENCODE_VISITOR_ diff --git a/deps/oblib/src/lib/geo/ob_geo_normalize_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_normalize_visitor.cpp index 255d68df6..adf6200ee 100644 --- a/deps/oblib/src/lib/geo/ob_geo_normalize_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_normalize_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -72,4 +76,4 @@ int ObGeoNormalizeVisitor::visit(ObIWkbGeomPoint *geo) return ret; } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_normalize_visitor.h b/deps/oblib/src/lib/geo/ob_geo_normalize_visitor.h index 5cc0b094f..e5b5a34c4 100644 --- a/deps/oblib/src/lib/geo/ob_geo_normalize_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_normalize_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_NORMALIZE_VISITOR_ #define OCEANBASE_LIB_GEO_OB_GEO_NORMALIZE_VISITOR_ @@ -41,4 +45,4 @@ class ObGeoNormalizeVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_GEO_OB_GEO_NORMALIZE_VISITOR_ \ No newline at end of file +#endif // OCEANBASE_LIB_GEO_OB_GEO_NORMALIZE_VISITOR_ diff --git a/deps/oblib/src/lib/geo/ob_geo_point_location_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_point_location_visitor.cpp index 969f22397..6d5e96cd9 100644 --- a/deps/oblib/src/lib/geo/ob_geo_point_location_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_point_location_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -193,4 +197,4 @@ int ObGeoPointLocationVisitor::visit(ObIWkbGeogMultiLineString *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_point_location_visitor.h b/deps/oblib/src/lib/geo/ob_geo_point_location_visitor.h index c32096240..04bfc3949 100644 --- a/deps/oblib/src/lib/geo/ob_geo_point_location_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_point_location_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_POINT_LOCATION_VISITOR_ @@ -61,4 +65,4 @@ class ObGeoPointLocationVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_reverse_coordinate_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_reverse_coordinate_visitor.cpp index 1a50fdc3c..d5dd31f5e 100644 --- a/deps/oblib/src/lib/geo/ob_geo_reverse_coordinate_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_reverse_coordinate_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -51,4 +55,4 @@ int ObGeoReverseCoordinateVisitor::visit(ObIWkbGeogPoint *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_reverse_coordinate_visitor.h b/deps/oblib/src/lib/geo/ob_geo_reverse_coordinate_visitor.h index cdaf66e7d..2fb05d832 100644 --- a/deps/oblib/src/lib/geo/ob_geo_reverse_coordinate_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_reverse_coordinate_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_REVERSE_COORDINATE_VISITOR_ @@ -46,4 +50,4 @@ class ObGeoReverseCoordinateVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_rstar_tree.h b/deps/oblib/src/lib/geo/ob_geo_rstar_tree.h index 58d4be362..379c8f419 100644 --- a/deps/oblib/src/lib/geo/ob_geo_rstar_tree.h +++ b/deps/oblib/src/lib/geo/ob_geo_rstar_tree.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_RSTAR_TREE_ diff --git a/deps/oblib/src/lib/geo/ob_geo_segment_collect_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_segment_collect_visitor.cpp index c0ab5e128..4013638d0 100644 --- a/deps/oblib/src/lib/geo/ob_geo_segment_collect_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_segment_collect_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -195,4 +199,4 @@ int ObGeoSegmentCollectVisitor::visit(ObIWkbGeogLinearRing *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_segment_collect_visitor.h b/deps/oblib/src/lib/geo/ob_geo_segment_collect_visitor.h index fdcca2c98..fac941b7b 100644 --- a/deps/oblib/src/lib/geo/ob_geo_segment_collect_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_segment_collect_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_SEGMENT_COLLECT_VISITOR_ @@ -58,4 +62,4 @@ class ObGeoSegmentCollectVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_segment_intersect_analyzer.cpp b/deps/oblib/src/lib/geo/ob_geo_segment_intersect_analyzer.cpp index 5268f3fd2..cfe798fbf 100644 --- a/deps/oblib/src/lib/geo/ob_geo_segment_intersect_analyzer.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_segment_intersect_analyzer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -80,4 +84,4 @@ int ObLineIntersectionAnalyzer::segment_intersection_query(ObGeometry *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_segment_intersect_analyzer.h b/deps/oblib/src/lib/geo/ob_geo_segment_intersect_analyzer.h index fc889cd31..4672242ff 100644 --- a/deps/oblib/src/lib/geo/ob_geo_segment_intersect_analyzer.h +++ b/deps/oblib/src/lib/geo/ob_geo_segment_intersect_analyzer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_SEG_INTERSECTS_ANALYZER_ diff --git a/deps/oblib/src/lib/geo/ob_geo_simplify_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_simplify_visitor.cpp index b07eb58ae..bfb920411 100644 --- a/deps/oblib/src/lib/geo/ob_geo_simplify_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_simplify_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -307,4 +311,4 @@ int ObGeoSimplifyVisitor::finish(ObGeometry *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_simplify_visitor.h b/deps/oblib/src/lib/geo/ob_geo_simplify_visitor.h index b6274a63d..1bd755bd4 100644 --- a/deps/oblib/src/lib/geo/ob_geo_simplify_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_simplify_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_SIMPLIFY_VISITOR_ @@ -68,4 +72,4 @@ class ObGeoSimplifyVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_to_s2_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_to_s2_visitor.cpp index 595086051..43b4eb547 100644 --- a/deps/oblib/src/lib/geo/ob_geo_to_s2_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_to_s2_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -706,4 +710,4 @@ int ObWkbToS2Visitor::vector_emplace_back(std::vector> } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_to_s2_visitor.h b/deps/oblib/src/lib/geo/ob_geo_to_s2_visitor.h index 4318cc68c..b5bccc8ea 100644 --- a/deps/oblib/src/lib/geo/ob_geo_to_s2_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_to_s2_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_TO_S2_VISITOR_ @@ -112,7 +116,7 @@ class ObWkbToS2Visitor : public ObEmptyGeoVisitor static int vector_emplace_back(std::vector> &vector, S2Loop *element); template static int vector_emplace_back(std::vector> &vector, ElementType *element); - // S2对象内部使用了std::vector实现,在这里统一使用std::vector管理这些对象 + // S2 object internally uses std::vector implementation, here we uniformly use std::vector to manage these objects std::vector> s2v_; S2LatLngRect mbr_; std::vector S2cells_; @@ -129,4 +133,4 @@ class ObWkbToS2Visitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_to_tree_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_to_tree_visitor.cpp index 56fea6cda..4181612a7 100644 --- a/deps/oblib/src/lib/geo/ob_geo_to_tree_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_to_tree_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -288,4 +292,4 @@ int ObGeoToTreeVisitor::visit(ObIWkbGeomCollection *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_to_tree_visitor.h b/deps/oblib/src/lib/geo/ob_geo_to_tree_visitor.h index 6011f6c17..fc0ecb57a 100644 --- a/deps/oblib/src/lib/geo/ob_geo_to_tree_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_to_tree_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_TO_TREE_VISITOR_ @@ -86,4 +90,4 @@ class ObGeoToTreeVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_to_wkt_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_to_wkt_visitor.cpp index 7d4372737..a74221fa4 100644 --- a/deps/oblib/src/lib/geo/ob_geo_to_wkt_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_to_wkt_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/geo/ob_geo_to_wkt_visitor.h b/deps/oblib/src/lib/geo/ob_geo_to_wkt_visitor.h index 2386c86c5..e2ea5b04e 100644 --- a/deps/oblib/src/lib/geo/ob_geo_to_wkt_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_to_wkt_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_TO_WKT_VISITOR_ @@ -121,4 +125,4 @@ class ObGeoToWktVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_topology_calculate.cpp b/deps/oblib/src/lib/geo/ob_geo_topology_calculate.cpp index a41cc771a..9f7856b73 100644 --- a/deps/oblib/src/lib/geo/ob_geo_topology_calculate.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_topology_calculate.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -218,4 +222,4 @@ int ObGeoTopology::calculate_line_segments_intersect(const ObLineSegment& seg1, } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_topology_calculate.h b/deps/oblib/src/lib/geo/ob_geo_topology_calculate.h index 5f4085c2b..facbda945 100644 --- a/deps/oblib/src/lib/geo/ob_geo_topology_calculate.h +++ b/deps/oblib/src/lib/geo/ob_geo_topology_calculate.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_TOPOLOGY_ diff --git a/deps/oblib/src/lib/geo/ob_geo_tree.cpp b/deps/oblib/src/lib/geo/ob_geo_tree.cpp index de8812e25..0db1e2f21 100644 --- a/deps/oblib/src/lib/geo/ob_geo_tree.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_tree.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the Geometry tree abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/geo/ob_geo_tree.h b/deps/oblib/src/lib/geo/ob_geo_tree.h index 4ebdd733b..d09b21503 100644 --- a/deps/oblib/src/lib/geo/ob_geo_tree.h +++ b/deps/oblib/src/lib/geo/ob_geo_tree.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_TREE_ @@ -523,17 +527,17 @@ class ObPolygon : public ObSurface static int create_polygon(ObGeoCRS crs, uint32_t srid, ObIAllocator &allocator, ObPolygon*& output); virtual bool empty() const = 0; - // 内外边界总数 + // Total number of inner and outer boundaries virtual uint64_t size() const = 0; - // 内边界总数 + // Total number of inner boundaries virtual uint64_t inner_ring_size() const = 0; - // 获取外边界 + // Get the outer boundary virtual ObLinearring& exterior_ring() = 0; virtual const ObLinearring& exterior_ring() const = 0; - // 获取第n个内边界 + // Get the nth inner boundary virtual ObLinearring& inner_ring(uint32_t n) = 0; virtual const ObLinearring& inner_ring(uint32_t n) const = 0; - // 添加Linearring到polygon中 + // Add Linearring to polygon virtual int push_back(const ObLinearring &lr) = 0; // visitor // virtual int do_visit(ObIGeoVisitor &visitor) = 0; @@ -562,12 +566,12 @@ class ObCartesianPolygon : public ObPolygon int push_back(const ObLinearring &ring) override; bool empty() const override { return (exterior_.empty() && inner_rings_.size() == 0); } - uint64_t size() const override { return !exterior_.empty() ? inner_ring_size() + 1 : inner_ring_size(); } // 内外边界总数 - uint64_t inner_ring_size() const override { return inner_rings_.size(); }// 内边界总数 - const ObCartesianLinearring& exterior_ring() const override { return exterior_; } // 获取外边界 - ObCartesianLinearring& exterior_ring() override { return exterior_; } // 获取外边界 - const ObCartesianLinearring& inner_ring(uint32_t n) const override { return inner_rings_[n]; } // 获取第n个内边界 - ObCartesianLinearring& inner_ring(uint32_t n) override { return inner_rings_[n]; } // 获取第n个内边界 + uint64_t size() const override { return !exterior_.empty() ? inner_ring_size() + 1 : inner_ring_size(); } // Total number of inner and outer boundaries + uint64_t inner_ring_size() const override { return inner_rings_.size(); }// total number of inner rings + const ObCartesianLinearring& exterior_ring() const override { return exterior_; } // get exterior boundary + ObCartesianLinearring& exterior_ring() override { return exterior_; } // get exterior boundary + const ObCartesianLinearring& inner_ring(uint32_t n) const override { return inner_rings_[n]; } // Get the nth inner boundary + ObCartesianLinearring& inner_ring(uint32_t n) override { return inner_rings_[n]; } // Get the nth inner boundary // used for Boost ObCartesianLinearring &cartesian_exterior_ring() const { return const_cast(exterior_); } ObGeomVector &interior_rings() { return inner_rings_; } @@ -605,12 +609,12 @@ class ObGeographPolygon : public ObPolygon int push_back(const ObLinearring &ring) override; bool empty() const override { return (exterior_.empty() && inner_rings_.size() == 0); } - uint64_t size() const override { return !exterior_.empty() ? inner_ring_size() + 1 : inner_ring_size(); } // 内外边界总数 - uint64_t inner_ring_size() const override { return inner_rings_.size(); }// 内边界总数 - const ObGeographLinearring& exterior_ring() const override { return exterior_; } // 获取外边界 - ObGeographLinearring& exterior_ring() override { return exterior_; } // 获取外边界 - const ObGeographLinearring& inner_ring(uint32_t n) const override { return inner_rings_[n]; } // 获取第n个内边界 - ObGeographLinearring& inner_ring(uint32_t n) override { return inner_rings_[n]; } // 获取第n个内边界 + uint64_t size() const override { return !exterior_.empty() ? inner_ring_size() + 1 : inner_ring_size(); } // Total number of inner and outer boundaries + uint64_t inner_ring_size() const override { return inner_rings_.size(); }// total number of inner boundaries + const ObGeographLinearring& exterior_ring() const override { return exterior_; } // get exterior boundary + ObGeographLinearring& exterior_ring() override { return exterior_; } // get exterior boundary + const ObGeographLinearring& inner_ring(uint32_t n) const override { return inner_rings_[n]; } // Get the nth inner boundary + ObGeographLinearring& inner_ring(uint32_t n) override { return inner_rings_[n]; } // Get the nth inner boundary // used for Boost ObGeographLinearring &geographic_exterior_ring() const { return const_cast(exterior_); } ObGeomVector &interior_rings() { return inner_rings_; } diff --git a/deps/oblib/src/lib/geo/ob_geo_tree_traits.h b/deps/oblib/src/lib/geo/ob_geo_tree_traits.h index 352a32f56..26d5a2070 100644 --- a/deps/oblib/src/lib/geo/ob_geo_tree_traits.h +++ b/deps/oblib/src/lib/geo/ob_geo_tree_traits.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/deps/oblib/src/lib/geo/ob_geo_utils.cpp b/deps/oblib/src/lib/geo/ob_geo_utils.cpp index d64cf621d..4567d54cf 100644 --- a/deps/oblib/src/lib/geo/ob_geo_utils.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_utils.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the geometry utils abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -43,7 +46,7 @@ namespace oceanbase { namespace common { -// 这里只考虑进行非multi类型的比对,multi类型需额外处理 +// Here only non-multi type comparison is considered, multi type requires additional handling bool ObGeoTypeUtil::is_geo1_dimension_higher_than_geo2(ObGeoType type1, ObGeoType type2) { bool res = false; @@ -1532,11 +1535,10 @@ int ObGeoBoxUtil::get_geom_poly_box(const ObWkbGeomPolygon &poly, bool not_calc_ } return ret; } - -// 1. geometry类型可以存储所有其他空间类型; -// 2. POINT, LINESTRING, 和 POLYGON只能存储各自对应的类型(由表达式校验); -// 3. GEOMETRYCOLLECTION可以存储任何类型的对象的集合, -// MULTIPOINT, MULTILINESTRING, 和 MULTIPOLYGON将集合成员限制为具有特定几何类型的成员 +// 1. geometry type can store all other spatial types; +// 2. POINT, LINESTRING, and POLYGON can only store their corresponding types (validated by the expression); +// 3. GEOMETRYCOLLECTION can store a collection of any type of objects, +// MULTIPOINT, MULTILINESTRING, and MULTIPOLYGON restrict collection members to members with specific geometric types int ObGeoTypeUtil::check_geo_type(const ObGeoType column_type, const ObString &wkb_str) { int ret = OB_SUCCESS; diff --git a/deps/oblib/src/lib/geo/ob_geo_utils.h b/deps/oblib/src/lib/geo/ob_geo_utils.h index e41fa5306..f3c96007d 100644 --- a/deps/oblib/src/lib/geo/ob_geo_utils.h +++ b/deps/oblib/src/lib/geo/ob_geo_utils.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the geometry utils abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_UTILS_ diff --git a/deps/oblib/src/lib/geo/ob_geo_vertex_collect_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_vertex_collect_visitor.cpp index 4cf591d1c..f951d9b35 100644 --- a/deps/oblib/src/lib/geo/ob_geo_vertex_collect_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_vertex_collect_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -49,4 +53,4 @@ int ObGeoVertexCollectVisitor::visit(ObIWkbPoint *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_vertex_collect_visitor.h b/deps/oblib/src/lib/geo/ob_geo_vertex_collect_visitor.h index cc8e67c05..b3bf0b3fe 100644 --- a/deps/oblib/src/lib/geo/ob_geo_vertex_collect_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_vertex_collect_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_VERTEX_COLLECT_VISITOR_ @@ -41,4 +45,4 @@ class ObGeoVertexCollectVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_visitor.cpp index 0fe458779..e9df3e688 100644 --- a/deps/oblib/src/lib/geo/ob_geo_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -25,4 +29,4 @@ int ObEmptyGeoVisitor::visit(ObGeometry *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_visitor.h b/deps/oblib/src/lib/geo/ob_geo_visitor.h index 7a1880391..b79bb37a2 100644 --- a/deps/oblib/src/lib/geo/ob_geo_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_VISITOR_ @@ -534,4 +538,4 @@ int ObIWkbVisitorImplement::collection_do_visitor(T_IBIN *geo, ObIGeoVisitor &vi } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_wkb_check_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_wkb_check_visitor.cpp index 1e627f6c9..017a46b5e 100644 --- a/deps/oblib/src/lib/geo/ob_geo_wkb_check_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_wkb_check_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -283,4 +287,4 @@ int ObGeoWkbCheckVisitor::visit(ObIWkbGeogCollection *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_wkb_check_visitor.h b/deps/oblib/src/lib/geo/ob_geo_wkb_check_visitor.h index f94b67be6..e12d8ddac 100644 --- a/deps/oblib/src/lib/geo/ob_geo_wkb_check_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_wkb_check_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_WKB_CHECK_VISITOR_ #define OCEANBASE_LIB_GEO_OB_GEO_WKB_CHECK_VISITOR_ @@ -92,4 +96,4 @@ class ObGeoWkbCheckVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_GEO_OB_GEO_WKB_CHECK_VISITOR_ \ No newline at end of file +#endif // OCEANBASE_LIB_GEO_OB_GEO_WKB_CHECK_VISITOR_ diff --git a/deps/oblib/src/lib/geo/ob_geo_wkb_size_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_wkb_size_visitor.cpp index ea6d92d0f..5f7789d65 100644 --- a/deps/oblib/src/lib/geo/ob_geo_wkb_size_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_wkb_size_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -69,4 +73,4 @@ int ObGeoWkbSizeVisitor::visit(ObGeometrycollection *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_wkb_size_visitor.h b/deps/oblib/src/lib/geo/ob_geo_wkb_size_visitor.h index c0e6412fb..e7789a162 100644 --- a/deps/oblib/src/lib/geo/ob_geo_wkb_size_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_wkb_size_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_WKB_SIZE_VISITOR_ @@ -49,4 +53,4 @@ class ObGeoWkbSizeVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_wkb_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_wkb_visitor.cpp index 2f689f1b5..17d7bafd6 100644 --- a/deps/oblib/src/lib/geo/ob_geo_wkb_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_wkb_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -195,4 +199,4 @@ int ObGeoWkbVisitor::visit(ObIWkbGeometry *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_wkb_visitor.h b/deps/oblib/src/lib/geo/ob_geo_wkb_visitor.h index 588bb56f9..99356eef9 100644 --- a/deps/oblib/src/lib/geo/ob_geo_wkb_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_wkb_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_WKB_VISITOR_ @@ -81,4 +85,4 @@ class ObGeoWkbVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geo_zoom_in_visitor.cpp b/deps/oblib/src/lib/geo/ob_geo_zoom_in_visitor.cpp index 0a42d62ee..5d4a59403 100644 --- a/deps/oblib/src/lib/geo/ob_geo_zoom_in_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_geo_zoom_in_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -68,4 +72,4 @@ int ObGeoZoomInVisitor::visit(ObIWkbGeomPoint *geo) return zoom_in_point(geo); } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_geo_zoom_in_visitor.h b/deps/oblib/src/lib/geo/ob_geo_zoom_in_visitor.h index 7b5469b42..d5ec610c2 100644 --- a/deps/oblib/src/lib/geo/ob_geo_zoom_in_visitor.h +++ b/deps/oblib/src/lib/geo/ob_geo_zoom_in_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_ZOOM_IN_VISITOR_ @@ -51,4 +55,4 @@ class ObGeoZoomInVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_geometry_cast.cpp b/deps/oblib/src/lib/geo/ob_geometry_cast.cpp index 88d911f87..8c4749659 100644 --- a/deps/oblib/src/lib/geo/ob_geometry_cast.cpp +++ b/deps/oblib/src/lib/geo/ob_geometry_cast.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for geometry cast. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/geo/ob_geometry_cast.h b/deps/oblib/src/lib/geo/ob_geometry_cast.h index 469a6b778..f658e4f2c 100644 --- a/deps/oblib/src/lib/geo/ob_geometry_cast.h +++ b/deps/oblib/src/lib/geo/ob_geometry_cast.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation for geometry cast. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_GEOMETRY_CAST @@ -332,4 +335,4 @@ class ObGeometryTypeCastFactory } // sql } // oceanbase -#endif // OCEANBASE_LIB_OB_GEOMETRY_CAST \ No newline at end of file +#endif // OCEANBASE_LIB_OB_GEOMETRY_CAST diff --git a/deps/oblib/src/lib/geo/ob_point_location_analyzer.cpp b/deps/oblib/src/lib/geo/ob_point_location_analyzer.cpp index d0fa14e5a..0bdea7182 100644 --- a/deps/oblib/src/lib/geo/ob_point_location_analyzer.cpp +++ b/deps/oblib/src/lib/geo/ob_point_location_analyzer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -64,4 +68,4 @@ int ObPointLocationAnalyzer::calculate_point_position(const ObPoint2d &test_poin } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_point_location_analyzer.h b/deps/oblib/src/lib/geo/ob_point_location_analyzer.h index e747b7c6c..d3a1219ec 100644 --- a/deps/oblib/src/lib/geo/ob_point_location_analyzer.h +++ b/deps/oblib/src/lib/geo/ob_point_location_analyzer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_POINT_LOCATION_ANALYZER_ diff --git a/deps/oblib/src/lib/geo/ob_s2adapter.cpp b/deps/oblib/src/lib/geo/ob_s2adapter.cpp index 946df0672..c5647ebac 100644 --- a/deps/oblib/src/lib/geo/ob_s2adapter.cpp +++ b/deps/oblib/src/lib/geo/ob_s2adapter.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the s2 geometry adapter abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -390,4 +393,4 @@ ObS2Adapter::~ObS2Adapter() } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_s2adapter.h b/deps/oblib/src/lib/geo/ob_s2adapter.h index 2a766eb12..b0928ecde 100644 --- a/deps/oblib/src/lib/geo/ob_s2adapter.h +++ b/deps/oblib/src/lib/geo/ob_s2adapter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_S2ADAPTER_ diff --git a/deps/oblib/src/lib/geo/ob_srs_info.cpp b/deps/oblib/src/lib/geo/ob_srs_info.cpp index 664d9cf69..1bd367a4b 100644 --- a/deps/oblib/src/lib/geo/ob_srs_info.cpp +++ b/deps/oblib/src/lib/geo/ob_srs_info.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the srs info. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ @@ -629,4 +632,4 @@ int64_t ObSrsBoundsItem::to_string(char *buf, const int64_t buf_len) const } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_srs_info.h b/deps/oblib/src/lib/geo/ob_srs_info.h index 83f0c1bd6..dd7955cd0 100644 --- a/deps/oblib/src/lib/geo/ob_srs_info.h +++ b/deps/oblib/src/lib/geo/ob_srs_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_SRS_INFO_ diff --git a/deps/oblib/src/lib/geo/ob_srs_wkt_parser.cpp b/deps/oblib/src/lib/geo/ob_srs_wkt_parser.cpp index b7c503b6e..f7c0a5f2b 100644 --- a/deps/oblib/src/lib/geo/ob_srs_wkt_parser.cpp +++ b/deps/oblib/src/lib/geo/ob_srs_wkt_parser.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the SRS wkt parser abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ @@ -403,4 +406,4 @@ int ObSrsWktParser::parse_proj_srs_wkt(common::ObIAllocator& allocator, const co } } // common -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/deps/oblib/src/lib/geo/ob_srs_wkt_parser.h b/deps/oblib/src/lib/geo/ob_srs_wkt_parser.h index 3993cf3bf..acab31ebc 100644 --- a/deps/oblib/src/lib/geo/ob_srs_wkt_parser.h +++ b/deps/oblib/src/lib/geo/ob_srs_wkt_parser.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_SRS_WKT_PARSER_ @@ -56,4 +60,4 @@ class ObSrsWktParser final } // common } // oceanbase -#endif /* OCEANBASE_LIB_GIS_OB_SRS_WKT_PARSER_ */ \ No newline at end of file +#endif /* OCEANBASE_LIB_GIS_OB_SRS_WKT_PARSER_ */ diff --git a/deps/oblib/src/lib/geo/ob_vector_tile.pb-c.c b/deps/oblib/src/lib/geo/ob_vector_tile.pb-c.c index 43574db56..3222918db 100644 --- a/deps/oblib/src/lib/geo/ob_vector_tile.pb-c.c +++ b/deps/oblib/src/lib/geo/ob_vector_tile.pb-c.c @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ /* Generated by the protocol buffer compiler. DO NOT EDIT! */ /* Generated from: ob_vector_tile.proto */ diff --git a/deps/oblib/src/lib/geo/ob_vector_tile.pb-c.h b/deps/oblib/src/lib/geo/ob_vector_tile.pb-c.h index ccd37d5ed..85739b3d2 100644 --- a/deps/oblib/src/lib/geo/ob_vector_tile.pb-c.h +++ b/deps/oblib/src/lib/geo/ob_vector_tile.pb-c.h @@ -1,14 +1,18 @@ /* Generated by the protocol buffer compiler. DO NOT EDIT! */ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ /* Generated from: ob_vector_tile.proto */ diff --git a/deps/oblib/src/lib/geo/ob_wkb_byte_order_visitor.cpp b/deps/oblib/src/lib/geo/ob_wkb_byte_order_visitor.cpp index b1f7797ae..f259f4634 100644 --- a/deps/oblib/src/lib/geo/ob_wkb_byte_order_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_wkb_byte_order_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -322,4 +326,4 @@ int ObWkbByteOrderVisitor::visit(ObIWkbGeomCollection *geo) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_wkb_byte_order_visitor.h b/deps/oblib/src/lib/geo/ob_wkb_byte_order_visitor.h index 29a8d6878..5dce5548c 100644 --- a/deps/oblib/src/lib/geo/ob_wkb_byte_order_visitor.h +++ b/deps/oblib/src/lib/geo/ob_wkb_byte_order_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_WKB_BYTE_ORDER_VISITOR_ @@ -119,4 +123,4 @@ class ObWkbByteOrderVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_wkb_to_json_bin_visitor.cpp b/deps/oblib/src/lib/geo/ob_wkb_to_json_bin_visitor.cpp index 7675977c7..81f1aef42 100644 --- a/deps/oblib/src/lib/geo/ob_wkb_to_json_bin_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_wkb_to_json_bin_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/ob_errno.h" diff --git a/deps/oblib/src/lib/geo/ob_wkb_to_json_bin_visitor.h b/deps/oblib/src/lib/geo/ob_wkb_to_json_bin_visitor.h index 29f215527..d5517d2af 100644 --- a/deps/oblib/src/lib/geo/ob_wkb_to_json_bin_visitor.h +++ b/deps/oblib/src/lib/geo/ob_wkb_to_json_bin_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_TO_JSON_BIN_VISITOR_ @@ -144,4 +148,4 @@ class ObWkbToJsonBinVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_wkb_to_json_visitor.cpp b/deps/oblib/src/lib/geo/ob_wkb_to_json_visitor.cpp index 4fa8308d1..3b3a1f9e9 100644 --- a/deps/oblib/src/lib/geo/ob_wkb_to_json_visitor.cpp +++ b/deps/oblib/src/lib/geo/ob_wkb_to_json_visitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/geo/ob_wkb_to_json_visitor.h b/deps/oblib/src/lib/geo/ob_wkb_to_json_visitor.h index e2ac21c7d..5ae85440a 100644 --- a/deps/oblib/src/lib/geo/ob_wkb_to_json_visitor.h +++ b/deps/oblib/src/lib/geo/ob_wkb_to_json_visitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_GEO_TO_JSON_VISITOR_ @@ -122,4 +126,4 @@ class ObWkbToJsonVisitor : public ObEmptyGeoVisitor } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/geo/ob_wkt_parser.cpp b/deps/oblib/src/lib/geo/ob_wkt_parser.cpp index 5152a797d..caa0c2459 100644 --- a/deps/oblib/src/lib/geo/ob_wkt_parser.cpp +++ b/deps/oblib/src/lib/geo/ob_wkt_parser.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the WKT Parser abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -464,7 +467,7 @@ int ObWktParser::try_parse_zdim_token(ObWktTokenVal &z_val) LOG_WARN("fail to set dimension type", K(ret)); } - if (OB_SUCC(ret)) { // if dim is 3,move the ptr to next token + if (OB_SUCC(ret)) { // if dim is 3, move the ptr to next token if (dim_type_ == ObGeoDimType::IS_3D && OB_FAIL(check_next_token(ObWktTokenType::W_NUMBER))) { LOG_WARN("fail to move to the next token", K(ret)); } @@ -744,4 +747,4 @@ int ObWktParser::set_dimension(ObGeoDimType dim) } } // end namespace common -} // end namespace oceanbase \ No newline at end of file +} // end namespace oceanbase diff --git a/deps/oblib/src/lib/geo/ob_wkt_parser.h b/deps/oblib/src/lib/geo/ob_wkt_parser.h index 927fb56e0..e8200a22b 100644 --- a/deps/oblib/src/lib/geo/ob_wkt_parser.h +++ b/deps/oblib/src/lib/geo/ob_wkt_parser.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the WKT Parser abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GEO_OB_WKT_PARSER_ @@ -103,4 +106,4 @@ class ObWktParser } // end namespace common } // end namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/guard/ob_light_shared_gaurd.h b/deps/oblib/src/lib/guard/ob_light_shared_gaurd.h index 1e931e83d..2ee97a7c3 100644 --- a/deps/oblib/src/lib/guard/ob_light_shared_gaurd.h +++ b/deps/oblib/src/lib/guard/ob_light_shared_gaurd.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GUARD_OB_LIGHT_SHARED_GUARD_H @@ -169,4 +173,4 @@ struct ObLightSharedPtr// RAII used } } -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/guard/ob_scope_guard.h b/deps/oblib/src/lib/guard/ob_scope_guard.h index e0a7385bb..7a0a7af5c 100644 --- a/deps/oblib/src/lib/guard/ob_scope_guard.h +++ b/deps/oblib/src/lib/guard/ob_scope_guard.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_GUARD_OB_SCOPE_GUARD_H @@ -19,23 +23,23 @@ namespace oceanbase { namespace common { -// ScopeGuard是一个模版类,其中包含了被保护的资源类型,以及析构该资源的可调用函数类型 +// ScopeGuard is a template class that includes the type of the protected resource, as well as the type of the callable function to destruct the resource template class ScopeGuard { public: template - ScopeGuard(Resource &p, T &&deleter) : p_(&p), deleter_(std::forward(deleter)) {}// ScopeGuard会在栈上开辟一个指针,指向被保护的资源 - ScopeGuard(const ScopeGuard &g) = delete;// ScopeGuard是禁止拷贝的 - ScopeGuard(ScopeGuard &&g) : p_(g.p_), deleter_(std::move(g.deleter_)) { g.p_ = nullptr; }// 但是允许移动 - ~ScopeGuard() { if (p_) { deleter_(*p_); p_ = nullptr; } }// 当ScopeGuard析构时,若其指向的资源仍然是有效的,则会调用析构操作 - Resource &resource() { return *p_; }// 通过resource()方法访问被保护的资源 - Resource &fetch_resource() {// 通过fetch_resource()取出被保护的资源 + ScopeGuard(Resource &p, T &&deleter) : p_(&p), deleter_(std::forward(deleter)) {}// ScopeGuard will allocate a pointer on the stack, pointing to the protected resource + ScopeGuard(const ScopeGuard &g) = delete;// ScopeGuard is prohibited from being copied + ScopeGuard(ScopeGuard &&g) : p_(g.p_), deleter_(std::move(g.deleter_)) { g.p_ = nullptr; }// but allows move + ~ScopeGuard() { if (p_) { deleter_(*p_); p_ = nullptr; } }// When ScopeGuard is destructed, if the resource it points to is still valid, the destructor operation will be called + Resource &resource() { return *p_; }// Access the protected resource through the resource() method + Resource &fetch_resource() { // Retrieve the protected resource through fetch_resource() Resource *p = p_; p_ = nullptr; return *p; } - // 以下两个函数使用了SFINAE技法,只有当保护的资源是指针类型时编译器才会生成下面的两个函数 + // The following two functions use the SFINAE technique, and the compiler will generate the following two functions only when the protected resource is a pointer type template ::value, bool>::type = true> typename std::add_lvalue_reference::type>::type operator*() { return **p_; } template ::value, bool>::type = true> @@ -44,7 +48,7 @@ class ScopeGuard Resource *p_; Deleter deleter_; }; -// MAKE_SCOPE宏用于去掉使用ScopeGuard时的语法噪音 +// MAKE_SCOPE macro is used to remove syntax noise when using ScopeGuard #define MAKE_SCOPE(resource, lambda) \ ({\ auto deleter = lambda;\ @@ -55,4 +59,4 @@ std::move(my_guard);\ }// namespace common }// namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/guard/ob_shared_guard.h b/deps/oblib/src/lib/guard/ob_shared_guard.h index fe7922e80..47508395b 100644 --- a/deps/oblib/src/lib/guard/ob_shared_guard.h +++ b/deps/oblib/src/lib/guard/ob_shared_guard.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ // ┌─────────────┐Upgrade ┌─────────────┐ diff --git a/deps/oblib/src/lib/guard/ob_unique_guard.h b/deps/oblib/src/lib/guard/ob_unique_guard.h index 8a862e4f1..921cc7839 100644 --- a/deps/oblib/src/lib/guard/ob_unique_guard.h +++ b/deps/oblib/src/lib/guard/ob_unique_guard.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ // ┌─────────────┐Upgrade ┌─────────────┐ diff --git a/deps/oblib/src/lib/guard/ob_weak_guard.h b/deps/oblib/src/lib/guard/ob_weak_guard.h index 9ad6e0305..33ece0d5a 100644 --- a/deps/oblib/src/lib/guard/ob_weak_guard.h +++ b/deps/oblib/src/lib/guard/ob_weak_guard.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ // ┌─────────────┐Upgrade ┌─────────────┐ diff --git a/deps/oblib/src/lib/hash/fnv_hash.h b/deps/oblib/src/lib/hash/fnv_hash.h index ee1935b6e..541ba14b8 100644 --- a/deps/oblib/src/lib/hash/fnv_hash.h +++ b/deps/oblib/src/lib/hash/fnv_hash.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef FNV_HASH_H_ diff --git a/deps/oblib/src/lib/hash/mprotect.h b/deps/oblib/src/lib/hash/mprotect.h index 2969e2680..f5f5066ca 100644 --- a/deps/oblib/src/lib/hash/mprotect.h +++ b/deps/oblib/src/lib/hash/mprotect.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/src/lib/hash/ob_array_hash_map.h b/deps/oblib/src/lib/hash/ob_array_hash_map.h index dda09d5f8..b733b49b3 100644 --- a/deps/oblib/src/lib/hash/ob_array_hash_map.h +++ b/deps/oblib/src/lib/hash/ob_array_hash_map.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_HASH_OB_ARRAY_HASH_MAP_ diff --git a/deps/oblib/src/lib/hash/ob_array_index_hash_set.h b/deps/oblib/src/lib/hash/ob_array_index_hash_set.h index 77256a39f..6ed728527 100644 --- a/deps/oblib/src/lib/hash/ob_array_index_hash_set.h +++ b/deps/oblib/src/lib/hash/ob_array_index_hash_set.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_HASH_OB_ARRAY_INDEX_HASH_SET_ diff --git a/deps/oblib/src/lib/hash/ob_build_in_hashmap.h b/deps/oblib/src/lib/hash/ob_build_in_hashmap.h index 1a852b9e1..4df255f98 100644 --- a/deps/oblib/src/lib/hash/ob_build_in_hashmap.h +++ b/deps/oblib/src/lib/hash/ob_build_in_hashmap.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_HASH_OB_BUILD_IN_HASHMAP_ diff --git a/deps/oblib/src/lib/hash/ob_cuckoo_hashmap.h b/deps/oblib/src/lib/hash/ob_cuckoo_hashmap.h index d0eff8c31..202c0f683 100644 --- a/deps/oblib/src/lib/hash/ob_cuckoo_hashmap.h +++ b/deps/oblib/src/lib/hash/ob_cuckoo_hashmap.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_CUCKOO_HASHMAP_H_ diff --git a/deps/oblib/src/lib/hash/ob_darray.h b/deps/oblib/src/lib/hash/ob_darray.h index 93777914d..38cfbec87 100644 --- a/deps/oblib/src/lib/hash/ob_darray.h +++ b/deps/oblib/src/lib/hash/ob_darray.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_HASH_OB_DARRAY_H_ diff --git a/deps/oblib/src/lib/hash/ob_dchash.cpp b/deps/oblib/src/lib/hash/ob_dchash.cpp index b6bee5a28..9464236e7 100644 --- a/deps/oblib/src/lib/hash/ob_dchash.cpp +++ b/deps/oblib/src/lib/hash/ob_dchash.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/src/lib/hash/ob_dchash.h b/deps/oblib/src/lib/hash/ob_dchash.h index 56b0773c8..50c3fd0cb 100644 --- a/deps/oblib/src/lib/hash/ob_dchash.h +++ b/deps/oblib/src/lib/hash/ob_dchash.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_HASH_OB_DCHASH_H_ diff --git a/deps/oblib/src/lib/hash/ob_fixed_hash2.h b/deps/oblib/src/lib/hash/ob_fixed_hash2.h index 251684303..63efc3f7c 100644 --- a/deps/oblib/src/lib/hash/ob_fixed_hash2.h +++ b/deps/oblib/src/lib/hash/ob_fixed_hash2.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_HASH_OB_FIXED_HASH2_H_ diff --git a/deps/oblib/src/lib/hash/ob_hash.h b/deps/oblib/src/lib/hash/ob_hash.h index 384a6e384..fae797dd3 100644 --- a/deps/oblib/src/lib/hash/ob_hash.h +++ b/deps/oblib/src/lib/hash/ob_hash.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_HASH_OB_HASH_ diff --git a/deps/oblib/src/lib/hash/ob_hashmap.h b/deps/oblib/src/lib/hash/ob_hashmap.h index 3f261da2e..96e3792f2 100644 --- a/deps/oblib/src/lib/hash/ob_hashmap.h +++ b/deps/oblib/src/lib/hash/ob_hashmap.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_HASH_HASHMAP_ @@ -303,12 +307,12 @@ class ObHashMap } return ret; }; - // 该原子操作在bucket上添加的写锁, - // 如果节点存在,调用 callback 进行修改,如果节点不存在,插入该节点 + // This atomic operation adds a write lock on the bucket, + // If the node exists, call callback to modify it, if the node does not exist, insert the node // - // 返回值: - // OB_SUCCESS 表示成功 - // 其它 表示出错 + // Return value: + // OB_SUCCESS indicates success + // other indicates an error template int set_or_update(const _key_type &key, const _value_type &value, _callback &callback) diff --git a/deps/oblib/src/lib/hash/ob_hashset.h b/deps/oblib/src/lib/hash/ob_hashset.h index 392e6b56f..633a7e67e 100644 --- a/deps/oblib/src/lib/hash/ob_hashset.h +++ b/deps/oblib/src/lib/hash/ob_hashset.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_HASH_HASHSET_ diff --git a/deps/oblib/src/lib/hash/ob_hashtable.h b/deps/oblib/src/lib/hash/ob_hashtable.h index a2bcf3850..83916a445 100644 --- a/deps/oblib/src/lib/hash/ob_hashtable.h +++ b/deps/oblib/src/lib/hash/ob_hashtable.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_HASH_HASHTABLE_ @@ -1332,13 +1336,12 @@ class ObHashTable { return read_atomic(key, callback, preproc_); } - - // 该原子操作在bucket上添加的写锁, - // 如果节点存在,调用 callback 进行修改,如果节点不存在,插入该节点 + // This atomic operation adds a write lock on the bucket, + // If the node exists, call callback to modify it, if the node does not exist, insert the node // - // 返回值: - // OB_SUCCESS 表示成功 - // 其它 表示出错 + // Return value: + // OB_SUCCESS indicates success + // other indicates an error template int set_or_update(const _key_type &key, const _value_type &value, _callback &callback) @@ -1631,9 +1634,8 @@ class ObHashTable } return ret; } - - // 不存在就插入,存在就调用 callback 修改 - // 该原子操作在bucket上添加的写锁 + // Not exist then insert, exist then call callback to modify + // This atomic operation adds a write lock on the bucket template int set_or_update(const _key_type &key, const _value_type &value, _callback &callback, _preproc &preproc) diff --git a/deps/oblib/src/lib/hash/ob_hashutils.cpp b/deps/oblib/src/lib/hash/ob_hashutils.cpp index 0a76127ad..4d81a92bd 100644 --- a/deps/oblib/src/lib/hash/ob_hashutils.cpp +++ b/deps/oblib/src/lib/hash/ob_hashutils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/hash/ob_hashutils.h" diff --git a/deps/oblib/src/lib/hash/ob_hashutils.h b/deps/oblib/src/lib/hash/ob_hashutils.h index 03e295903..ec6d15e8e 100644 --- a/deps/oblib/src/lib/hash/ob_hashutils.h +++ b/deps/oblib/src/lib/hash/ob_hashutils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_HASH_OB_HASHUTILS_ diff --git a/deps/oblib/src/lib/hash/ob_hazard_pointer.h b/deps/oblib/src/lib/hash/ob_hazard_pointer.h index fc749754e..c7874e998 100644 --- a/deps/oblib/src/lib/hash/ob_hazard_pointer.h +++ b/deps/oblib/src/lib/hash/ob_hazard_pointer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_HASH_OB_HAZARD_POINTER_ diff --git a/deps/oblib/src/lib/hash/ob_iteratable_hashmap.h b/deps/oblib/src/lib/hash/ob_iteratable_hashmap.h index ab90125d9..06244995a 100644 --- a/deps/oblib/src/lib/hash/ob_iteratable_hashmap.h +++ b/deps/oblib/src/lib/hash/ob_iteratable_hashmap.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_HASH_OB_ITERATABLE_HASHMAP_ diff --git a/deps/oblib/src/lib/hash/ob_iteratable_hashset.h b/deps/oblib/src/lib/hash/ob_iteratable_hashset.h index 0dd05ea7c..601f13082 100644 --- a/deps/oblib/src/lib/hash/ob_iteratable_hashset.h +++ b/deps/oblib/src/lib/hash/ob_iteratable_hashset.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_HASH_OB_ITERATABLE_HASHSET_ diff --git a/deps/oblib/src/lib/hash/ob_linear_hash_map.cpp b/deps/oblib/src/lib/hash/ob_linear_hash_map.cpp index d9bc7a7d4..19c43cf22 100644 --- a/deps/oblib/src/lib/hash/ob_linear_hash_map.cpp +++ b/deps/oblib/src/lib/hash/ob_linear_hash_map.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/src/lib/hash/ob_linear_hash_map.h b/deps/oblib/src/lib/hash/ob_linear_hash_map.h index a27b78dd7..c78fc8b46 100644 --- a/deps/oblib/src/lib/hash/ob_linear_hash_map.h +++ b/deps/oblib/src/lib/hash/ob_linear_hash_map.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ /** diff --git a/deps/oblib/src/lib/hash/ob_link_hashmap.cpp b/deps/oblib/src/lib/hash/ob_link_hashmap.cpp index f309dac84..46b653efd 100644 --- a/deps/oblib/src/lib/hash/ob_link_hashmap.cpp +++ b/deps/oblib/src/lib/hash/ob_link_hashmap.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/src/lib/hash/ob_link_hashmap.h b/deps/oblib/src/lib/hash/ob_link_hashmap.h index 1adca53c6..6e0cd8443 100644 --- a/deps/oblib/src/lib/hash/ob_link_hashmap.h +++ b/deps/oblib/src/lib/hash/ob_link_hashmap.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_HASH_OB_LINK_HASHMAP_H_ diff --git a/deps/oblib/src/lib/hash/ob_link_hashmap_deps.h b/deps/oblib/src/lib/hash/ob_link_hashmap_deps.h index 08b5a9ffc..60244e033 100644 --- a/deps/oblib/src/lib/hash/ob_link_hashmap_deps.h +++ b/deps/oblib/src/lib/hash/ob_link_hashmap_deps.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_HASH_OB_LINK_HASHMAP_DEPS_H_ diff --git a/deps/oblib/src/lib/hash/ob_multi_mod_ref_mgr.h b/deps/oblib/src/lib/hash/ob_multi_mod_ref_mgr.h index 1509aa151..7c98da887 100644 --- a/deps/oblib/src/lib/hash/ob_multi_mod_ref_mgr.h +++ b/deps/oblib/src/lib/hash/ob_multi_mod_ref_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_REF_MGR_ @@ -65,8 +69,8 @@ class ObMultiModRefMgr { ObRef ref_info_[static_cast(T::TOTAL_MAX_MOD)]; }; - // inc 需要在应用层保证安全,虽然这里检查了is_delete但是和inc操作并不原子 - // 依然会有is_delete之后,增加引用计数的可能,需要应用保证inc一定是在引用计数不为0下执行 + // inc needs to be guaranteed safe at the application layer, although here we check is_delete it is not atomic with the inc operation + // There will still be a possibility of increasing the reference count after is_delete, the application needs to ensure that inc is executed only when the reference count is not 0 int inc(const T t) { int ret = OB_SUCCESS; const int mod = static_cast(t); diff --git a/deps/oblib/src/lib/hash/ob_placement_hashmap.h b/deps/oblib/src/lib/hash/ob_placement_hashmap.h index cdd58ba8f..45d1c3116 100644 --- a/deps/oblib/src/lib/hash/ob_placement_hashmap.h +++ b/deps/oblib/src/lib/hash/ob_placement_hashmap.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_HASH_PLACEMENT_HASHMAP_ diff --git a/deps/oblib/src/lib/hash/ob_placement_hashset.h b/deps/oblib/src/lib/hash/ob_placement_hashset.h index faf84d4b2..0c15eb6be 100644 --- a/deps/oblib/src/lib/hash/ob_placement_hashset.h +++ b/deps/oblib/src/lib/hash/ob_placement_hashset.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_HASH_OB_PLACEMENT_HASH_SET_ diff --git a/deps/oblib/src/lib/hash/ob_placement_hashutils.h b/deps/oblib/src/lib/hash/ob_placement_hashutils.h index cd3a23a9c..c07c4ff5d 100644 --- a/deps/oblib/src/lib/hash/ob_placement_hashutils.h +++ b/deps/oblib/src/lib/hash/ob_placement_hashutils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_PLACEMENT_HASHUTILS_ diff --git a/deps/oblib/src/lib/hash/ob_pointer_hashmap.h b/deps/oblib/src/lib/hash/ob_pointer_hashmap.h index f1eba0d77..eb2dac838 100644 --- a/deps/oblib/src/lib/hash/ob_pointer_hashmap.h +++ b/deps/oblib/src/lib/hash/ob_pointer_hashmap.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_HASH_POINTER_HASHMAP_ diff --git a/deps/oblib/src/lib/hash/ob_ptr_array_map.h b/deps/oblib/src/lib/hash/ob_ptr_array_map.h index 4a5e0eb05..417a72086 100644 --- a/deps/oblib/src/lib/hash/ob_ptr_array_map.h +++ b/deps/oblib/src/lib/hash/ob_ptr_array_map.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_HASH_OB_SMALL_INT_MAP_H_ diff --git a/deps/oblib/src/lib/hash/ob_refered_map.h b/deps/oblib/src/lib/hash/ob_refered_map.h index c34224f93..b1e4e55ff 100644 --- a/deps/oblib/src/lib/hash/ob_refered_map.h +++ b/deps/oblib/src/lib/hash/ob_refered_map.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_HASH_OB_REFERED_MAP_H_ diff --git a/deps/oblib/src/lib/hash/ob_serialization.h b/deps/oblib/src/lib/hash/ob_serialization.h index 3e03d5660..b486764e5 100644 --- a/deps/oblib/src/lib/hash/ob_serialization.h +++ b/deps/oblib/src/lib/hash/ob_serialization.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_HASH_SERIALIZATION_ diff --git a/deps/oblib/src/lib/hash_func/ob_hash_func.h b/deps/oblib/src/lib/hash_func/ob_hash_func.h index 202a6a275..56a3481d7 100644 --- a/deps/oblib/src/lib/hash_func/ob_hash_func.h +++ b/deps/oblib/src/lib/hash_func/ob_hash_func.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_HASH_FUNC_OB_HASH_FUNC_ diff --git a/deps/oblib/src/lib/hash_func/wyhash.h b/deps/oblib/src/lib/hash_func/wyhash.h index 264f1b8ad..7c71c1314 100644 --- a/deps/oblib/src/lib/hash_func/wyhash.h +++ b/deps/oblib/src/lib/hash_func/wyhash.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef wyhash_version_2 diff --git a/deps/oblib/src/lib/json/ob_json.cpp b/deps/oblib/src/lib/json/ob_json.cpp index 17b9028e8..8a3882721 100644 --- a/deps/oblib/src/lib/json/ob_json.cpp +++ b/deps/oblib/src/lib/json/ob_json.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/json/ob_json.h b/deps/oblib/src/lib/json/ob_json.h index e311c0664..35c3d2359 100644 --- a/deps/oblib/src/lib/json/ob_json.h +++ b/deps/oblib/src/lib/json/ob_json.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LIB_JSON_OB_JSON_ diff --git a/deps/oblib/src/lib/json/ob_json_print_utils.cpp b/deps/oblib/src/lib/json/ob_json_print_utils.cpp index 2e8505c27..cb271fbc8 100644 --- a/deps/oblib/src/lib/json/ob_json_print_utils.cpp +++ b/deps/oblib/src/lib/json/ob_json_print_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/json/ob_json_print_utils.h b/deps/oblib/src/lib/json/ob_json_print_utils.h index 93d86820b..07db1d281 100644 --- a/deps/oblib/src/lib/json/ob_json_print_utils.h +++ b/deps/oblib/src/lib/json/ob_json_print_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LIB_JSON_OB_JSON_PRINT_UTILS_ diff --git a/deps/oblib/src/lib/json/ob_yson.cpp b/deps/oblib/src/lib/json/ob_yson.cpp index 4fa3be7bf..a9b8a0a1e 100644 --- a/deps/oblib/src/lib/json/ob_yson.cpp +++ b/deps/oblib/src/lib/json/ob_yson.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/json/ob_yson.h b/deps/oblib/src/lib/json/ob_yson.h index 8cfcbee4f..ccec73767 100644 --- a/deps/oblib/src/lib/json/ob_yson.h +++ b/deps/oblib/src/lib/json/ob_yson.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_YSON_H diff --git a/deps/oblib/src/lib/json/ob_yson_encode.h b/deps/oblib/src/lib/json/ob_yson_encode.h index e5b27dff3..271a6acb1 100644 --- a/deps/oblib/src/lib/json/ob_yson_encode.h +++ b/deps/oblib/src/lib/json/ob_yson_encode.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_YSON_ENCODE_H diff --git a/deps/oblib/src/lib/json_type/ob_json_base.cpp b/deps/oblib/src/lib/json_type/ob_json_base.cpp index 36e42ed49..9104f0eae 100644 --- a/deps/oblib/src/lib/json_type/ob_json_base.cpp +++ b/deps/oblib/src/lib/json_type/ob_json_base.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the json base abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL @@ -166,7 +169,7 @@ int ObIJsonBase::add_if_missing(ObJsonSortedResult &dup, ObJsonSeekResult &res, ObIJsonBase* cur_json = const_cast(this); ObJsonBin* json_bin = NULL; - // Reduce array allocation size : 2 + // Reduce array allocation size : 2 // binary need clone new node if (is_bin()) { if (res.size() == 0) { @@ -292,8 +295,8 @@ int ObIJsonBase::seek(ObIAllocator* allocator, const ObJsonPath &path, bool is_lax, ObJsonSeekResult &res, PassingMap* sql_var) const { INIT_SUCC(ret); - // 对于$后的path节点而言,其parent_info.parent_path为begin() - // 对于@后的path节点而言,其parent_info为上一层节点(可能为$后 或 上一个@后的末尾节点) + // For the path node after $, its parent_info.parent_path is begin() + // For the path node after @, its parent_info is the upper-level node (which could be after $ or the end node of the previous @) if (lib::is_oracle_mode() || is_lax) { ObSeekParentInfo parent_info; parent_info.parent_jb_ = const_cast (this); @@ -332,7 +335,7 @@ int ObIJsonBase::find_member(ObIAllocator* allocator, ObSeekParentInfo &parent_i ObString key_name(path_node->get_object().len_, path_node->get_object().object_name_); ret = get_object_value(key_name, jb_ptr); if (OB_SUCC(ret)) { - // 寻找成功,向下递归 + // Find success, recursive downward if (is_lax && !is_auto_wrap) is_auto_wrap = true; if (OB_FAIL(jb_ptr->find_child(allocator, parent_info, cur_node + 1, last_node, is_auto_wrap, only_need_one, is_lax, dup, res, sql_var))) { @@ -344,7 +347,7 @@ int ObIJsonBase::find_member(ObIAllocator* allocator, ObSeekParentInfo &parent_i } else { LOG_WARN("fail to get object value", K(ret), K(key_name)); } - // 宽松模式,对数组里面的每一个节点查找 + // Loose mode, find each node in the array } else if (is_lax && is_auto_wrap && json_type() == ObJsonNodeType::J_ARRAY) { bool is_done = false; for (uint32_t i = 0; OB_SUCC(ret) && i < element_count() && !is_done; ++i) { @@ -361,7 +364,7 @@ int ObIJsonBase::find_member(ObIAllocator* allocator, ObSeekParentInfo &parent_i is_done = is_seek_done(res, only_need_one); } } - } // 既不是宽松模式下的数组,又不是ObJsonNodeType::J_OBJECT,没有找到任何数据,是正常的 + } // It is neither an array in lax mode nor ObJsonNodeType::J_OBJECT, no data was found, which is normal return ret; } @@ -396,7 +399,7 @@ int ObIJsonBase::find_member_wildcard(ObIAllocator* allocator, ObSeekParentInfo is_done = is_seek_done(res, only_need_one); } } - // 宽松模式,对数组里面的每一个节点查找 + // Loose mode, find each node in the array } else if (is_lax && is_auto_wrap && json_type() == ObJsonNodeType::J_ARRAY) { is_done = false; for (uint32_t i = 0; OB_SUCC(ret) && i < element_count() && !is_done; ++i) { @@ -413,7 +416,7 @@ int ObIJsonBase::find_member_wildcard(ObIAllocator* allocator, ObSeekParentInfo is_done = is_seek_done(res, only_need_one); } } - } // 既不是宽松模式下的数组,又不是ObJsonNodeType::J_OBJECT,没有找到任何数据,是正常的 + } // It is neither an array in lax mode nor ObJsonNodeType::J_OBJECT, no data was found, which is normal return ret; } @@ -1218,9 +1221,9 @@ int ObIJsonBase::find_boolean_method(ObIAllocator* allocator, ObSeekParentInfo & case ObJsonNodeType::J_OTIMESTAMPTZ: // timestamptz string case ObJsonNodeType::J_ODAYSECOND: // daySecondInterval string case ObJsonNodeType::J_OYEARMONTH: { - // 对于boolean(), 如果是bool值则返回bool值。 - // 如果是string, 若其内容为"true"(忽略大小写,则转为相应bool,否则就返回本身 - // 对于booleanOnly(), 当且仅当为bool值时返回结果(即本身) + // For boolean(), if it is a bool value then return the bool value. + // if is string, if its content is "true" (case insensitive, then convert to corresponding bool, otherwise return itself + // For booleanOnly(), return the result if and only if it is a bool value (i.e., itself) if (path_node->get_node_type() == JPN_BOOLEAN) { ObString str(get_data_length(), get_data()); bool is_true = false; @@ -1264,7 +1267,7 @@ int ObIJsonBase::find_boolean_method(ObIAllocator* allocator, ObSeekParentInfo & } break; } - // boolean()对于NULL会返回本身 + // boolean() will return itself for NULL case ObJsonNodeType::J_NULL:{ if (path_node->get_node_type() == JPN_BOOLEAN) { if ((OB_FAIL(find_child(allocator, parent_info, cur_node + 1, @@ -1276,7 +1279,7 @@ int ObIJsonBase::find_boolean_method(ObIAllocator* allocator, ObSeekParentInfo & break; } default :{ - // 对于数字和非标量返回null + // For numbers and non-scalar return null if (path_node->get_node_type() == JPN_BOOLEAN && is_json_number(json_type()) && !parent_info.is_subpath_) { if ((OB_FAIL(find_child(allocator, parent_info, cur_node + 1, @@ -1801,9 +1804,9 @@ int ObIJsonBase::find_func_child(ObIAllocator* allocator, ObSeekParentInfo &pare ret = ret = OB_INVALID_ARGUMENT; LOG_WARN("function item must be the last path_node", K(ret)); } else { - // 虽然文档说明每个函数只处理特定类型(如abs,floor只处理数字) - // 但实际上如果不是特定类型也并不会报错 - // 只是返回空(使用ObJsonNull代表该情况,其中is_null_ = false,与Null节点区分) + // Although the documentation states that each function handles only specific types (such as abs, floor only handle numbers) + // but actually it won't throw an error if it's not a specific type + // Just return empty (use ObJsonNull to represent this case, where is_null_ = false, and it is distinguished from the Null node) switch (path_node->get_node_type()) { case JPN_ABS: case JPN_CEILING: @@ -1955,22 +1958,21 @@ int ObIJsonBase::cmp_based_on_node_type(ObJsonPathNodeType node_type, int res, b } return ret; } - -// 字符串转number类型,两种情况下用到: -// 1. sub_path的类型为number时,oracle会将字符串自动转换成number处理(有双引号) -// 2. path中的标量首先存成字符串,然后根据比较的内容转换成相应的数字(无双引号) -// PS: 对于情况1,首先需要去除双引号。 -// 同时,如果查找到的json_base_node的内容为123时,当且仅当字符串为"123"时可以比较," 123" 和 "123 "均不行 -// 因此,若内容不是合法的数字,并不能成功转换为数字类型 +// String to number type, two cases are used: +// 1. When the type of sub_path is number, oracle will automatically convert the string to a number for processing (with double quotes) +// 2. scalars in path are first stored as strings, then converted to the corresponding numbers (without quotes) +// PS: For case 1, you first need to remove the double quotes. +// At the same time, if the content of the found json_base_node is 123, comparison can only be made when the string is "123", " 123" and "123 " are not allowed +// Therefore, if the content is not a valid number, it cannot be successfully converted to a numeric type /* 1. SELECT 1 from dual WHERE json_exists( '["a", 2, 3, 4, 5, {"resolution" : {"x": 1920, "y": 1080}}]', - '$[5]?(exists(@.resolution?(@.x < " 1921")))'); // 返回null + '$[5]?(exists(@.resolution?(@.x < " 1921")))'); // return null 2. SELECT 1 from dual WHERE json_exists( '["a", 2, 3, 4, 5, {"resolution" : {"x": 1920, "y": 1080}}]', - '$[5]?(exists(@.resolution?(@.x < "1921")))'); // 返回1 + '$[5]?(exists(@.resolution?(@.x < "1921")))'); // return 1 */ int ObIJsonBase::trans_to_json_number(ObIAllocator* allocator, ObString str, ObIJsonBase* &origin) const { @@ -1983,8 +1985,7 @@ int ObIJsonBase::trans_to_json_number(ObIAllocator* allocator, ObString str, ObI } else { num_str = ObString(str.length(), str.ptr()); } - - // 处理好之后直接解析当前字符串,得到number + // Process well and then parse the current string to get number if (OB_FAIL(ObJsonBaseFactory::get_json_base(allocator, num_str, ObJsonInType::JSON_TREE, ObJsonInType::JSON_TREE, jb_ptr)) || OB_ISNULL(jb_ptr) @@ -1997,9 +1998,8 @@ int ObIJsonBase::trans_to_json_number(ObIAllocator* allocator, ObString str, ObI } return ret; } - -// 日期类型和字符串类型本身没有差别 -// 直接将该字符串解析成json_tree会存储为字符串,需要自定义目标类型 +// Date type and string type itself have no difference +// Directly parsing this string into json_tree will store it as a string, need to define target type int ObIJsonBase::trans_to_date_timestamp(ObIAllocator* allocator, ObString str, ObIJsonBase* &origin, @@ -2062,9 +2062,8 @@ int ObIJsonBase::trans_to_date_timestamp(ObIAllocator* allocator, } return ret; } - -// 日期类型和字符串类型本身没有差别 -// 直接将该字符串解析成json_tree会存储为字符串,需要自定义目标类型 +// Date type and string type itself have no difference +// Directly parsing this string into json_tree will store it as a string, need to define target type int ObIJsonBase::trans_to_mdate(ObIAllocator* allocator, ObString str, ObIJsonBase* &origin) const @@ -2240,8 +2239,8 @@ int ObIJsonBase::trans_json_node(ObIAllocator* allocator, ObIJsonBase* &scalar, } // for compare ——> (subpath, scalar/sql_var) -// 左边调用compare,左边遇到数组自动解包 -// 只要有一个结果为true则返回true,找不到或结果为false均返回false +// Left side calls compare, left side automatically unpacks array when encountered +// As long as one result is true, return true, return false if none found or all results are false int ObIJsonBase::cmp_to_right_recursively(ObIAllocator* allocator, ObJsonSeekResult& hit, const ObJsonPathNodeType node_type, ObIJsonBase* right_arg, bool& filter_result) const @@ -2270,7 +2269,7 @@ int ObIJsonBase::cmp_to_right_recursively(ObIAllocator* allocator, ObJsonSeekRes jb_ptr = &st_json; // reset jb_ptr to stack var ret = hit[i]->get_array_element(array_i, jb_ptr); int cmp_res = -3; - // 类型相同可以直接用compare函数比较 + // Types are the same, you can directly use the compare function to compare if(OB_FAIL(ret) || OB_ISNULL(jb_ptr)) { ret = OB_ERR_NULL_VALUE; LOG_WARN("compare value is null.", K(ret)); @@ -2279,11 +2278,11 @@ int ObIJsonBase::cmp_to_right_recursively(ObIAllocator* allocator, ObJsonSeekRes cmp_based_on_node_type(node_type, cmp_res, cmp_result); } } else { - // 不相同的类型,oracle会将string类型转换为对应类型再进行比较 - // 转换或比较失败也正常,并不报错 - // 例如: [*].a == 123 - // 里面可能有多个元素无法转换成数字或无法和数字比较甚至找不到.a - // 但只要有一个找到,且为123或"123"则为true + // Different types, oracle will convert the string type to the corresponding type before comparison + // Conversion or comparison failure is also normal, and no error is reported + // For example: [*].a == 123 + // There may be multiple elements that cannot be converted to a number or cannot be compared with a number or even cannot be found.a + // but as long as one is found, and it is 123 or "123" then it is true ObIJsonBase* left = jb_ptr; ObIJsonBase* right = right_arg; if (OB_FAIL(trans_json_node(allocator, right, left))) { @@ -2306,7 +2305,7 @@ int ObIJsonBase::cmp_to_right_recursively(ObIAllocator* allocator, ObJsonSeekRes cmp_based_on_node_type(node_type, cmp_res, cmp_result); } } else { - // 不相同的类型,同上 + // Different types, same as above ObIJsonBase* left = hit[i]; ObIJsonBase* right = right_arg; if (OB_FAIL(trans_json_node(allocator, right, left))) { @@ -2330,7 +2329,7 @@ int ObIJsonBase::cmp_to_right_recursively(ObIAllocator* allocator, ObJsonSeekRes } // for compare ——> ( scalar/sql_var, subpath) -// 只要有一个结果为true则返回true,找不到或结果为false均返回false +// As long as one result is true then return true, if not found or result is false then return false int ObIJsonBase::cmp_to_left_recursively(ObIAllocator* allocator, ObJsonSeekResult& hit, const ObJsonPathNodeType node_type, ObIJsonBase* left_arg, bool& filter_result) const @@ -2359,7 +2358,7 @@ int ObIJsonBase::cmp_to_left_recursively(ObIAllocator* allocator, ObJsonSeekResu jb_ptr = &st_json; // reset jb_ptr to stack var ret = hit[i]->get_array_element(array_i, jb_ptr); int cmp_res = -3; - // 类型相同可以直接用compare函数比较 + // Types are the same, you can directly use the compare function to compare if(OB_FAIL(ret) || OB_ISNULL(jb_ptr)) { ret = OB_ERR_NULL_VALUE; LOG_WARN("compare value is null.", K(ret)); @@ -2368,11 +2367,11 @@ int ObIJsonBase::cmp_to_left_recursively(ObIAllocator* allocator, ObJsonSeekResu cmp_based_on_node_type(node_type, cmp_res, cmp_result); } } else { - // 不相同的类型,oracle会将string类型转换为对应类型再进行比较 - // 转换或比较失败也正常,并不报错 - // 例如: [*].a == 123 - // 里面可能有多个元素无法转换成数字或无法和数字比较甚至找不到.a - // 但只要有一个找到,且为123或"123"则为true + // Different types, oracle will convert the string type to the corresponding type before comparison + // Conversion or comparison failure is also normal, and no error is reported + // For example: [*].a == 123 + // There may be multiple elements that cannot be converted to a number or cannot be compared with a number or even cannot be found.a + // but as long as one is found, and it is 123 or "123" then it is true ObIJsonBase* left = left_arg; ObIJsonBase* right = jb_ptr; if (OB_FAIL(trans_json_node(allocator, left, right))) { @@ -2395,7 +2394,7 @@ int ObIJsonBase::cmp_to_left_recursively(ObIAllocator* allocator, ObJsonSeekResu cmp_based_on_node_type(node_type, cmp_res, cmp_result); } } else { - // 不相同的类型,同上 + // Different types, same as above ObIJsonBase* left = left_arg; ObIJsonBase* right = hit[i]; if (OB_FAIL(trans_json_node(allocator, left, right))) { @@ -2421,18 +2420,18 @@ int ObIJsonBase::cmp_to_left_recursively(ObIAllocator* allocator, ObJsonSeekResu } // for compare ——> (subpath, scalar/sql_var) -// 用于subpath的最后一个节点是item_function时 -// 此时如果两边的比较类型不匹配(无论另一边是scalar还是sql_var)会报错 -// 如果最后一个path_node不是item_function时,不匹配(如:"abc" == 1)不会报错,只是无结果 -// 如果最后一个path_node是item_function,但hit有多个结果时,类型不匹配也只是无结果,且只要有一个结果true就返回true -// 不能直接比较json_type()是否相等: -// 1. 因为item_function的返回类型不唯一,但能够比较的类型限制更严格 -// 如:length()可能返回 J_NULL 或 json_number -// 但与其比较的类型只能是json_number, 否则oracle会报错 -// 2. 左边调用item_fucntion的结果可以不合法: -// 如:'$?(@[0].date() == "2020-02-02") -// @[0]的内容可以为数字,数组,对象或无法转换为日期的字符串,不会报错 -// 但如果等号右边与之相比的并非为日期/时间戳格式的字符串时,会报错提示无法比较 +// Used when the last node of subpath is item_function +// At this time, if the comparison types on both sides do not match (regardless of whether the other side is scalar or sql_var), an error will be reported +// If the last path_node is not item_function, mismatch (e.g., "abc" == 1) will not cause an error, just no result +// If the last path_node is item_function, but hit has multiple results, type mismatch is just no result, and as long as one result is true, return true +// Cannot directly compare json_type() whether they are equal: +// 1. Because the return type of item_function is not unique, but the types that can be compared are more strictly limited +// e.g.: length() may return J_NULL or json_number +// but the type it is compared to can only be json_number, otherwise oracle will report an error +// 2. The result of the left call to item_function can be invalid: +// e.g.: '$?(@[0].date() == "2020-02-02")' +// @[0] content can be numbers, arrays, objects or strings that cannot be converted to dates, no error will be reported +// but if the string on the right side of the equal sign is not in date/timestamp format, an error will be prompted indicating that comparison is not possible int ObIJsonBase::cmp_to_right_strictly(ObIAllocator* allocator, ObIJsonBase* hit, const ObJsonPathNodeType node_type, const ObJsonPathNodeType last_sub_path_node_type, @@ -2462,7 +2461,7 @@ int ObIJsonBase::cmp_to_right_strictly(ObIAllocator* allocator, ObIJsonBase* hit case JPN_NUM_ONLY: case JPN_SIZE: case JPN_DOUBLE: { - // 比较出错不报错,只要求类型是number,否则报错 + // Compare error without throwing an error, just require the type to be number, otherwise throw an error if (is_json_number(right_type)) { int cmp_res = -3; if (OB_SUCC(hit->compare((*right_arg), cmp_res, true))) { @@ -2476,7 +2475,7 @@ int ObIJsonBase::cmp_to_right_strictly(ObIAllocator* allocator, ObIJsonBase* hit } case JPN_BOOLEAN: case JPN_BOOL_ONLY: { - // 对于path.boolean(), 当且仅当右边为布尔值,或是内容为true/false(不区分大小写)的字符串时合法 + // For path.boolean(), it is valid only when the right side is a boolean value, or a string with content true/false (case insensitive) if (right_type == ObJsonNodeType::J_BOOLEAN) {// compare int cmp_res = -3; if (OB_SUCC(hit->compare((*right_arg), cmp_res, true))) { @@ -2552,11 +2551,10 @@ int ObIJsonBase::cmp_to_right_strictly(ObIAllocator* allocator, ObIJsonBase* hit } return ret; } - -// 这次右边是sub_path找到的结果,左边是标量/变量 -// 复用left会影响比较的左右 -// 这次需要左边的参数转换类型,并调用compare, 而后根据node_type(>, >=...)确定比较结果 -// 而之前的是右边的参数转换类型,左边的参数调用compare +// This time the right side is the result found by sub_path, the left side is scalar/variable +// Reusing left will affect the comparison of left and right +// This time the parameters on the left need to be converted in type, and then call compare, and determine the comparison result based on node_type(>, >=...) +// And the previous one was the right parameter conversion type, left parameter calling compare int ObIJsonBase::cmp_to_left_strictly(ObIAllocator* allocator, ObIJsonBase* hit, const ObJsonPathNodeType node_type, const ObJsonPathNodeType last_sub_path_node_type, @@ -2586,7 +2584,7 @@ int ObIJsonBase::cmp_to_left_strictly(ObIAllocator* allocator, ObIJsonBase* hit, case JPN_NUM_ONLY: case JPN_SIZE: case JPN_DOUBLE: { - // 比较出错不报错,只要求类型是number,否则报错 + // Compare error without throwing an error, just require the type to be number, otherwise throw an error if (is_json_number(left_type)) { int cmp_res = -3; if (OB_SUCC(left_arg->compare((*hit), cmp_res, true))) { @@ -2600,7 +2598,7 @@ int ObIJsonBase::cmp_to_left_strictly(ObIAllocator* allocator, ObIJsonBase* hit, } case JPN_BOOLEAN: case JPN_BOOL_ONLY: { - // 对于path.boolean(), 当且仅当右边为布尔值,或是内容为true/false(不区分大小写)的字符串时合法 + // For path.boolean(), it is valid only when the right side is a boolean value, or a string containing true/false (case insensitive) if (left_type == ObJsonNodeType::J_BOOLEAN) {// compare int cmp_res = -3; if (OB_SUCC(left_arg->compare((*hit), cmp_res, true))) { @@ -2694,18 +2692,18 @@ int ObIJsonBase::get_sign_result_left_subpath(ObIAllocator* allocator, ObSeekPar // get left arg if (OB_FAIL(SMART_CALL(parent_info.parent_jb_->seek(allocator, (*sub_path), sub_path->path_node_cnt(), true, false, true, hit, sql_var)))) { - // 查找失败则直接将结果视为false + // If the search fails, directly consider the result as false filter_result = false; } else { // cmp to right arg - // 没有找到结果 或 结果为object则返回false - // 因为sub_path 和 sub_path 比较不合法,所以不存在可以和object比较的类型 + // No result found or result is an object then return false + // Because sub_path and sub_path comparison is illegal, so there is no type that can be compared with object if (hit.size() == 0 || (hit.size() == 1 && hit[0]->json_type() == ObJsonNodeType::J_OBJECT)) { filter_result = false; } else { ObJsonPathNodeType last_path_node_type = sub_path->get_last_node_type(); if (last_path_node_type > JPN_BEGIN_FUNC_FLAG && last_path_node_type < JPN_END_FUNC_FLAG) { - // subpath最后一个节点是item_function, 对比较类型的检查会有更严格的要求 + // the last node of subpath is item_function, the check for comparison types will have stricter requirements for (uint32_t i = 0; i < hit.size() && (!OB_ISNULL(hit[i])) && !filter_result && OB_SUCC(ret); ++i) { if (OB_FAIL(cmp_to_right_strictly(allocator, hit[i], path_node->get_node_type(), @@ -2743,19 +2741,19 @@ int ObIJsonBase::get_sign_result_right_subpath(ObIAllocator* allocator, ObSeekPa // get right arg if (OB_FAIL(SMART_CALL(parent_info.parent_jb_->seek(allocator, (*sub_path), sub_path->path_node_cnt(), true, false, true, hit, sql_var)))) { - // 查找失败则直接将结果视为false + // If the search fails, directly consider the result as false filter_result = false; } else { // cmp to left arg - // 没有找到结果 或 结果为object则返回false - // 因为sub_path 和 sub_path 比较不合法,所以不存在可以和object比较的类型 + // No result found or result is an object then return false + // Because sub_path and sub_path comparison is illegal, so there is no type that can be compared with object if (hit.size() == 0 || (hit.size() == 1 && hit[0]->json_type() == ObJsonNodeType::J_OBJECT)) { filter_result = false; } else { ObJsonPathNodeType last_path_node_type = sub_path->get_last_node_type(); if (last_path_node_type > JPN_BEGIN_FUNC_FLAG && last_path_node_type < JPN_END_FUNC_FLAG) { - // subpath最后一个节点是item_function, 对比较类型的检查会有更严格的要求 + // the last node of subpath is item_function, the check for comparison types will have stricter requirements for (uint32_t i = 0; i < hit.size() && (!OB_ISNULL(hit[i])) && !filter_result && OB_SUCC(ret); ++i) { if (OB_FAIL(cmp_to_left_strictly(allocator, hit[i], path_node->get_node_type(), last_path_node_type, left_arg, filter_result))) { @@ -2832,10 +2830,9 @@ int ObIJsonBase::get_scalar(ObIAllocator* allocator, const ObJsonPathNodeType ty } return ret; } - -// scalar对比不会自动转换类型,如: 123 == "123"会报错(type incompatibility for comparison) -// 但 1.sub_path查找到的内容和scalar/sql对比时会自动转换类型 -// 2.对于bool类型,如果是字符串会自动转换类型对比,其他均不会 +// scalar comparison will not automatically convert types, e.g.: 123 == "123" will error (type incompatibility for comparison) +// but 1.sub_path finds the content and compares it with scalar/sql, it will automatically convert the type +// 2.For bool type, if it is a string it will be automatically converted for comparison, others will not // @return Less than returns -1, greater than 1, equal returns 0. int ObIJsonBase::compare_scalar(ObIAllocator* allocator, const ObJsonPathFilterNode *path_node, bool& filter_result) const @@ -2943,7 +2940,7 @@ int ObIJsonBase::get_sign_comp_result(ObIAllocator* allocator, ObSeekParentInfo // left is subpath, right could be scalar/sql_var if (comp_content.left_type_ == ObJsonPathNodeType::JPN_SUB_PATH) { - // 如果右边是scalar则直接将其转变为ObIJsonBase + // If the right side is scalar then directly transform it into ObIJsonBase if (ObJsonPathUtil::is_scalar(comp_content.right_type_)) { ObIJsonBase* scalar = NULL; if (OB_FAIL(get_scalar(allocator, comp_content.right_type_, @@ -2958,7 +2955,7 @@ int ObIJsonBase::get_sign_comp_result(ObIAllocator* allocator, ObSeekParentInfo } } } else if (comp_content.right_type_ == ObJsonPathNodeType::JPN_SQL_VAR) { - // 右边是sql_var,根据var_name得到sql + // Right side is sql_var, get sql according to var_name if (OB_ISNULL(sql_var) ) { ret = OB_INVALID_ARGUMENT; LOG_WARN("sql_var is nullptr.", K(ret)); @@ -2979,9 +2976,9 @@ int ObIJsonBase::get_sign_comp_result(ObIAllocator* allocator, ObSeekParentInfo ret = OB_ERR_UNEXPECTED; LOG_WARN("wrong node type.", K(ret)); } - // (scalar, subpath) 或 (sql_var, subpath) + // (scalar, subpath) or (sql_var, subpath) } else if (comp_content.right_type_ == ObJsonPathNodeType::JPN_SUB_PATH) { - // 左边是scalar + // Left side is scalar if (ObJsonPathUtil::is_scalar(comp_content.left_type_)) { ObIJsonBase* scalar = NULL; if (OB_FAIL(get_scalar(allocator, comp_content.left_type_, @@ -2996,7 +2993,7 @@ int ObIJsonBase::get_sign_comp_result(ObIAllocator* allocator, ObSeekParentInfo } } } else if (comp_content.left_type_ == ObJsonPathNodeType::JPN_SQL_VAR) { - // 左边是sql_var, 根据变量名得到对应ObIJsonBase + // The left side is sql_var, get the corresponding ObIJsonBase according to the variable name if (OB_ISNULL(sql_var) ) { ret = OB_INVALID_ARGUMENT; LOG_WARN("sql_var is nullptr.", K(ret)); @@ -3019,9 +3016,9 @@ int ObIJsonBase::get_sign_comp_result(ObIAllocator* allocator, ObSeekParentInfo } } else if (ObJsonPathUtil::is_scalar(comp_content.left_type_) && ObJsonPathUtil::is_scalar(comp_content.right_type_)) { - // null 只能和 null 比 - // bool 可以和字符串 bool 比 - // string 和 string 比 + // null can only be compared with null + // bool can be compared with string bool + // string and string compare if (OB_FAIL(compare_scalar(allocator, path_node, filter_result))) { LOG_WARN("fail to compare scalar.", K(ret)); } @@ -3058,7 +3055,7 @@ int ObIJsonBase::str_comp_predicate(const ObString& left, const ObString& right, { INIT_SUCC(ret); ObJsonPathNodeType pnode_type = path_node->get_node_type(); - // 处理空字符串 + // Handle empty string if (left.length() == 0 && right.length() == 0) { filter_result = true; } else if (left.length() == 0) { @@ -3116,7 +3113,7 @@ int ObIJsonBase::str_cmp_autowrap(ObIAllocator* allocator, const ObString& right if (OB_ISNULL(jb_ptr)) { ret = OB_ERR_NULL_VALUE; LOG_WARN("fail to get array child dom", K(ret), K(i)); - // 数组只对第一层展开查询 + // Array only queries the first level of expansion } else if (OB_FAIL(jb_ptr->str_cmp_autowrap(allocator, right_str, path_node, false, filter_result))) { LOG_WARN("fail to cmp recursively", K(ret), K(i), K(filter_result)); @@ -3151,12 +3148,12 @@ int ObIJsonBase::get_str_comp_result(ObIAllocator* allocator, ObSeekParentInfo & INIT_SUCC(ret); ObPathComparison comp_content = path_node->node_content_.comp_; bool end_comp = false; - // could be:(sub_path,string), (sub_path, var) ,(string, string) + // could be:(sub_path, string), (sub_path, var), (string, string) // get right_str, right arg could be scalar/var ObString right_str; if (comp_content.right_type_ == ObJsonPathNodeType::JPN_SCALAR) { ObString tmp(comp_content.comp_right_.path_scalar_.s_length_, comp_content.comp_right_.path_scalar_.scalar_); - // 确定是字符串类型 + // Determine if it is a string type if (tmp.length() < 2 || tmp[0] != '\"' || tmp[tmp.length()-1] != '\"') { ret = OB_INVALID_ARGUMENT; LOG_WARN("right scalar must be string.", K(ret)); @@ -3164,7 +3161,7 @@ int ObIJsonBase::get_str_comp_result(ObIAllocator* allocator, ObSeekParentInfo & right_str = ObString(tmp.length() - 2, tmp.ptr() + 1); } } else if (comp_content.right_type_ == ObJsonPathNodeType::JPN_SQL_VAR) { - // 左边是sql_var, 根据变量名得到对应ObIJsonBase + // The left side is sql_var, get the corresponding ObIJsonBase according to the variable name if (OB_ISNULL(sql_var) ) { ret = OB_INVALID_ARGUMENT; LOG_WARN("sql_var is nullptr.", K(ret)); @@ -3196,7 +3193,7 @@ int ObIJsonBase::get_str_comp_result(ObIAllocator* allocator, ObSeekParentInfo & SMART_VAR (ObJsonSeekResult, hit) { ObJsonPath* sub_path = comp_content.comp_left_.filter_path_; if (sub_path->path_not_str()) { - // 如果最后一个节点的类型是item function,且返回值一定不为string,如number/abs/length...会报错 + // If the type of the last node is item function, and the return value is definitely not a string, such as number/abs/length..., it will throw an error ret = OB_OP_NOT_ALLOW; LOG_WARN("wrong argument data type for function call.", K(ret), K(sub_path->get_last_node_type())); @@ -3216,7 +3213,7 @@ int ObIJsonBase::get_str_comp_result(ObIAllocator* allocator, ObSeekParentInfo & } // samrt var } else if (comp_content.left_type_ == ObJsonPathNodeType::JPN_SCALAR) { ObString tmp(comp_content.comp_left_.path_scalar_.s_length_, comp_content.comp_left_.path_scalar_.scalar_); - // 确定是字符串类型 + // Determine if it is a string type if (tmp.length() < 2 || tmp[0] != '\"' || tmp[tmp.length()-1] != '\"') { ret = OB_INVALID_ARGUMENT; LOG_WARN("right scalar must be string.", K(ret)); @@ -3265,40 +3262,40 @@ int ObIJsonBase::find_comp_result(ObIAllocator* allocator, ObSeekParentInfo &par SMART_VAR (ObJsonSeekResult, hit) { if (OB_FAIL(SMART_CALL(parent_info.parent_jb_->seek(allocator, (*sub_path), sub_path->path_node_cnt(), true, true, true, hit, sql_var)))) { - // 查找失败则直接将结果视为false + // If the search fails, directly consider the result as false filter_result = false; } else { - // exist 要求参数一定是含有过滤表达式的sub_path, 过滤表达式后面再有其他path_node没问题 - // 并且从过滤表达式所找到的jb_tree后往下继续按照path查找 - // 但特殊的是,如果过滤表达式的结果为false或没有找到,过滤表达式后面的path_node都不再继续执行 + // exist requires the parameter to be a sub_path containing a filter expression, other path_nodes after the filter expression are fine + // and continue to search downwards from the jb_tree found by the filter expression according to the path + // But specially, if the result of the filter expression is false or not found, the path_node after the filter expression will no longer continue to execute /* 1. SELECT json_value( '["abc", 2, 3, 4, 5, {"z" : "2020-02-02"},7,8,"9"]', - '$[5]?(1 == 0).z.date()' RETURNING DATE ) FROM dual; // 输出null + '$[5]?(1 == 0).z.date()' RETURNING DATE ) FROM dual; // output null 2. SELECT json_value( '["abc", 2, 3, 4, 5, {"z" : "2020-02-02"},7,8,"9"]', - '$[5]?(1 == 1).z.date()' RETURNING DATE ) FROM dual; // 输出正确日期 + '$[5]?(1 == 1).z.date()' RETURNING DATE ) FROM dual; // output correct date 3. SELECT json_value( '["abc", 2, 3, 4, 5, {"z" : "2020-02-02"},7,8,"9"]', - '$[5]?(@.z.a == "2020-02-02").z.date()' RETURNING DATE ) FROM dual; // 输出null + '$[5]?(@.z.a == "2020-02-02").z.date()' RETURNING DATE ) FROM dual; // output null 4. SELECT json_value( '["abc", 2, 3, 4, 5, {"z" : "2020-02-02"},7,8,"9"]', - '$[5]?(@.z == "2020-02-02").z.date()' RETURNING DATE ) FROM dual; // 输出正确日期 + '$[5]?(@.z == "2020-02-02").z.date()' RETURNING DATE ) FROM dual; // output correct date 5. SELECT 1 from dual WHERE json_exists( '["a", 2, 3, 4, 5, {"resolution" : {"x": 1920, "y": 1080}}, 7, 8, 9]', - '$[5]?(1 == 1).resolution.z'); // 输出空 + '$[5]?(1 == 1).resolution.z'); // output empty 6. SELECT 1 from dual WHERE json_exists( '["a", 2, 3, 4, 5, {"resolution" : {"x": 1920, "y": 1080}}, 7, 8, 9]', - '$[5]?(1 == 1).resolution.x'); // 输出1 + '$[5]?(1 == 1).resolution.x'); // output 1 */ - // 所以猜测oracle在seek()过程中,会根据过滤表达式的结果(找不到或不匹配均为false)确定是否继续向下执行。 - // 且根据用例5 & 6猜测,Oracle查找完过滤表达式节点后并不会将结果(true/false)插入res,否则5的结果不会为空 - // 而是 根据过滤表达式的结果决定是否往下继续查询 + // So I guess oracle will determine whether to continue executing based on the result of the filter expression during the seek() process (false if not found or does not match). + // And according to case 5 & 6, Oracle does not insert the result (true/false) into res after searching the filter expression node, otherwise the result of 5 would not be empty + // but decide whether to continue querying based on the result of the filter expression filter_result = (hit.size() > 0); } } // smart var hit @@ -3397,9 +3394,8 @@ int ObIJsonBase::find_filter_child(ObIAllocator* allocator, ObSeekParentInfo &pa bool filter_result = false; ObJsonPathNodeType pnode_type = path_node->get_node_type(); if (is_lax && !is_auto_wrap) is_auto_wrap = true; - - // 对于过滤表达式,需要重新设置parent_info - // 当前json节点为新的parent节点,过滤表达式内的sub_path都以该节点为根节点查找 + // For the filter expression, need to reset parent_info + // The current json node is the new parent node, filter expressions within sub_path are all searched with this node as the root node parent_info.parent_jb_ = const_cast (this); parent_info.parent_path_ = cur_node; parent_info.is_subpath_ = true; @@ -3426,13 +3422,13 @@ int ObIJsonBase::find_filter_child(ObIAllocator* allocator, ObSeekParentInfo &pa if (OB_SUCC(ret)) { if (filter_result == true) { - // 结果为true但还没有结束,则从当前节点继续往下执行 + // The result is true but it has not ended yet, then continue executing from the current node if (OB_FAIL(SMART_CALL(find_child(allocator, parent_info, cur_node + 1, last_node, is_auto_wrap, only_need_one, is_lax, dup, res, sql_var)))) { LOG_WARN("fail to seek recursively", K(ret)); } } else { - // 结果为false,不再继续往下查找,直接返回空的hit数组 + // The result is false, no longer continue to search downwards, directly return an empty hit array // do nothing } } @@ -7149,6 +7145,16 @@ bool JsonObjectIterator::end() const return curr_element_ >= element_count_; } +int JsonObjectIterator::get_elem(ObJsonObjPair &elem) +{ + INIT_SUCC(ret); + if (OB_FAIL(json_object_->get_key(curr_element_, elem.first))) { + LOG_WARN("failed to get key", K(ret), K(curr_element_)); + } else if (OB_FAIL(json_object_->get_object_value(curr_element_, elem.second))) { + LOG_WARN("fail to get this json obj element", K(ret), K(curr_element_)); + } + return ret; +} int JsonObjectIterator::get_key(ObString &key) { diff --git a/deps/oblib/src/lib/json_type/ob_json_base.h b/deps/oblib/src/lib/json_type/ob_json_base.h index 9f2ad01fc..d4650be1b 100644 --- a/deps/oblib/src/lib/json_type/ob_json_base.h +++ b/deps/oblib/src/lib/json_type/ob_json_base.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface support for the json base abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_JSON_BASE @@ -75,7 +78,7 @@ enum class ObJsonNodeType OB_INLINE ObObjType json_type_to_obj_type(const ObJsonNodeType json_type) { const static ObObjType JSON_TYPE_TO_OBJ_TYPE[static_cast(ObJsonNodeType::J_MAX_TYPE) + 1] = { - ObNullType, // ObJsonNodeType::J_NULL 空类型 + ObNullType, // ObJsonNodeType::J_NULL null type ObNumberType, // ObJsonNodeType::J_DECIMAL aka decimal/numeric ObIntType, // ObJsonNodeType::J_INT int64 ObUInt64Type, // ObJsonNodeType::J_UINT uint64 @@ -196,6 +199,7 @@ class JsonObjectIterator ~JsonObjectIterator() {} bool end() const; + int get_elem(ObJsonObjPair &elem); int get_key(ObString &key); int get_value(ObIJsonBase *&value); int get_value(ObString &key, ObIJsonBase *&value); @@ -1386,4 +1390,4 @@ inline bool is_mysql_unsupported_json_column_conversion(ObObjType type) } // namespace common } // namespace oceanbase -#endif // OCEANBASE_SQL_OB_JSON_BASE \ No newline at end of file +#endif // OCEANBASE_SQL_OB_JSON_BASE diff --git a/deps/oblib/src/lib/json_type/ob_json_bin.cpp b/deps/oblib/src/lib/json_type/ob_json_bin.cpp index fea02e819..696e75b36 100644 --- a/deps/oblib/src/lib/json_type/ob_json_bin.cpp +++ b/deps/oblib/src/lib/json_type/ob_json_bin.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB #include "ob_json_bin.h" diff --git a/deps/oblib/src/lib/json_type/ob_json_bin.h b/deps/oblib/src/lib/json_type/ob_json_bin.h index f4746d2e2..a46cd3c35 100644 --- a/deps/oblib/src/lib/json_type/ob_json_bin.h +++ b/deps/oblib/src/lib/json_type/ob_json_bin.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_JSON_BIN diff --git a/deps/oblib/src/lib/json_type/ob_json_common.h b/deps/oblib/src/lib/json_type/ob_json_common.h index d59f0d108..56b3f6f2d 100644 --- a/deps/oblib/src/lib/json_type/ob_json_common.h +++ b/deps/oblib/src/lib/json_type/ob_json_common.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_JSON_TYPE_OB_JSON_COMMON_ @@ -22,4 +26,4 @@ typedef ObStringBuffer ObJsonBuffer; } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_JSON_TYPE_OB_JSON_COMMON \ No newline at end of file +#endif // OCEANBASE_LIB_JSON_TYPE_OB_JSON_COMMON diff --git a/deps/oblib/src/lib/json_type/ob_json_diff.cpp b/deps/oblib/src/lib/json_type/ob_json_diff.cpp index 196937108..09663166a 100644 --- a/deps/oblib/src/lib/json_type/ob_json_diff.cpp +++ b/deps/oblib/src/lib/json_type/ob_json_diff.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB #include "ob_json_diff.h" diff --git a/deps/oblib/src/lib/json_type/ob_json_diff.h b/deps/oblib/src/lib/json_type/ob_json_diff.h index 2bc0dcdf5..c4cd2eef3 100644 --- a/deps/oblib/src/lib/json_type/ob_json_diff.h +++ b/deps/oblib/src/lib/json_type/ob_json_diff.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_JSON_DIFF @@ -146,4 +150,4 @@ struct ObJsonDiffHeader { } // namespace common } // namespace oceanbase -#endif // OCEANBASE_SQL_OB_JSON_BIN \ No newline at end of file +#endif // OCEANBASE_SQL_OB_JSON_BIN diff --git a/deps/oblib/src/lib/json_type/ob_json_parse.cpp b/deps/oblib/src/lib/json_type/ob_json_parse.cpp index 2af12dcb2..7a0a596c0 100644 --- a/deps/oblib/src/lib/json_type/ob_json_parse.cpp +++ b/deps/oblib/src/lib/json_type/ob_json_parse.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the json parse abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL diff --git a/deps/oblib/src/lib/json_type/ob_json_parse.h b/deps/oblib/src/lib/json_type/ob_json_parse.h index 70504d3d0..34f4c0dc4 100644 --- a/deps/oblib/src/lib/json_type/ob_json_parse.h +++ b/deps/oblib/src/lib/json_type/ob_json_parse.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface support for the json parse abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_JSON_PARSE @@ -248,4 +251,4 @@ class ObJsonSyntaxCheckHandler final : public rapidjson::BaseReaderHandler<> } // namespace common } // namespace oceanbase -#endif // OCEANBASE_SQL_OB_JSON_PARSE \ No newline at end of file +#endif // OCEANBASE_SQL_OB_JSON_PARSE diff --git a/deps/oblib/src/lib/json_type/ob_json_path.cpp b/deps/oblib/src/lib/json_type/ob_json_path.cpp index 96d13f65b..241c8c2f5 100644 --- a/deps/oblib/src/lib/json_type/ob_json_path.cpp +++ b/deps/oblib/src/lib/json_type/ob_json_path.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the JSON path abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_RESV @@ -1060,7 +1063,7 @@ int ObJsonPathUtil::append_array_index(uint64_t index, bool from_end, ObJsonBuff LOG_WARN("fail to append the 'last' ", K(ret)); } else { // if index > 0, it should have '-' after 'last' - // such as:$[last-3 to last-1] + // such as: $[last-3 to last-1] if (index > 0) { if (OB_FAIL(str.append("-"))) { LOG_WARN("fail to append the '-' ", K(ret)); @@ -1826,7 +1829,7 @@ int ObJsonPath::parse_wildcard_ellipsis_node() return ret; } -// get array index, range: +// get array index, range: // start from expression[index_] until non-digit char // parse str to int32_t, return index int ObJsonPathUtil::get_index_num(const ObString& expression, uint64_t& idx, uint64_t& array_idx) @@ -1903,7 +1906,7 @@ int ObJsonPath::parse_single_array_index(uint64_t& array_index, bool& from_end) } } - // Here will be three situation: + // Here will be three situation: // 'last' : get the last // 'last-num', such as 'last-3' : get the last number // 'num' : get the first number @@ -1936,7 +1939,7 @@ int ObJsonPath::parse_single_array_index(uint64_t& array_index, bool& from_end) // parse **(JPN_ARRAY_CELL & RANGE) // @return the error code. -// three situation: +// three situation: // '[*]' : just build ObJsonPathNode with type JPN_ARRAY_CELL_WILDCARD, and append to JsonPath // otherwise call parse_single_array_index() to do parse // if type is CELL, process one arg @@ -2817,7 +2820,7 @@ int ObJsonPath::parse_oracle_path_node() } break; } - // may be ? + // may be ? case ObJsonPathItem::FILTER_FLAG: { ++index_; if (OB_FAIL(parse_filter_node())) { @@ -4401,7 +4404,7 @@ int ObJsonPath::parse_condition(ObFilterArrayPointers& filter_stack, ObCharArray if (OB_FAIL(filter_cond_node->init_cond_right(right_comp))) { LOG_WARN("fail to init the right side of condition!", K(top)); } else { - // cond_node的参数正确初始化,加入filter_stack + // cond_node parameters are correctly initialized, added to filter_stack if (OB_FAIL(filter_stack.push_back(filter_cond_node))) { LOG_WARN("fail to append new filter_cond_node!", K(top)); } else { diff --git a/deps/oblib/src/lib/json_type/ob_json_path.h b/deps/oblib/src/lib/json_type/ob_json_path.h index df3067976..4b837389e 100644 --- a/deps/oblib/src/lib/json_type/ob_json_path.h +++ b/deps/oblib/src/lib/json_type/ob_json_path.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface support for the JSON path abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_JSON_PATH @@ -485,4 +488,4 @@ class ObJsonPathUtil } // namespace common } // namespace oceanbase -#endif // OCEANBASE_SQL_OB_JSON_PATH \ No newline at end of file +#endif // OCEANBASE_SQL_OB_JSON_PATH diff --git a/deps/oblib/src/lib/json_type/ob_json_schema.cpp b/deps/oblib/src/lib/json_type/ob_json_schema.cpp index ba2e92dcf..856da9766 100644 --- a/deps/oblib/src/lib/json_type/ob_json_schema.cpp +++ b/deps/oblib/src/lib/json_type/ob_json_schema.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the json base abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL @@ -4671,4 +4674,4 @@ int ObJsonSchemaUtils::need_check_recursive(ObIArray &schema_vec, } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/json_type/ob_json_schema.h b/deps/oblib/src/lib/json_type/ob_json_schema.h index ffd403f9f..6aad66f91 100644 --- a/deps/oblib/src/lib/json_type/ob_json_schema.h +++ b/deps/oblib/src/lib/json_type/ob_json_schema.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface support for the json tree abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_JSON_SCHEMA @@ -173,7 +176,7 @@ class ObJsonSchemaTree void set_root_doc(ObJsonObject *root_doc) {root_doc_ = root_doc;} OB_INLINE ObJsonArray* get_schema_map() {return schema_map_;} private: - int inner_build_schema_tree(ObJsonObject* origin_schema, // origin json schema,must be object + int inner_build_schema_tree(ObJsonObject* origin_schema, // origin json schema, must be object bool is_composition, // true: add schema in composition // false: add schema in schema ObJsonArray* comp_array = nullptr); // array of composition @@ -445,4 +448,4 @@ class ObJsonSchemaUtils } // namespace common } // namespace oceanbase -#endif // OCEANBASE_SQL_OB_JSON_SCHEMA \ No newline at end of file +#endif // OCEANBASE_SQL_OB_JSON_SCHEMA diff --git a/deps/oblib/src/lib/json_type/ob_json_tree.cpp b/deps/oblib/src/lib/json_type/ob_json_tree.cpp index 51dcd9626..237a4d904 100644 --- a/deps/oblib/src/lib/json_type/ob_json_tree.cpp +++ b/deps/oblib/src/lib/json_type/ob_json_tree.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the json tree abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL @@ -769,6 +772,33 @@ int ObJsonObject::add(const common::ObString &key, ObJsonNode *value, bool with_ return ret; } +int ObJsonObject::rename_key(const common::ObString &old_key, const common::ObString &new_key){ + INIT_SUCC(ret); + + if (new_key.empty() || old_key.empty()) { + ret = OB_ERR_JSON_DOCUMENT_NULL_KEY; + LOG_WARN("key is NULL", K(ret), K(new_key), K(old_key)); + } else { + ObJsonObjectPair pair(old_key, NULL); + ObJsonKeyCompare cmp(use_lexicographical_order_); + ObJsonObjectArray::iterator low_iter = std::lower_bound(object_array_.begin(), + object_array_.end(), pair, cmp); + if (low_iter != object_array_.end() && low_iter->get_key() == old_key) { // Found and covered + if (OB_ISNULL(get_value(new_key))) { + low_iter->set_key(new_key); + sort(); + } else { + ret = OB_ERR_DUPLICATE_KEY; + LOG_WARN("duplicated key in object array.", K(ret), K(old_key), K(new_key)); + } + } else { + ret = OB_ERR_JSON_KEY_NOT_FOUND; + LOG_WARN("JSON key name not found.", K(ret), K(old_key)); + } + } + + return ret; +} void ObJsonObject::sort() { diff --git a/deps/oblib/src/lib/json_type/ob_json_tree.h b/deps/oblib/src/lib/json_type/ob_json_tree.h index 4e06f9a40..0683d1a74 100644 --- a/deps/oblib/src/lib/json_type/ob_json_tree.h +++ b/deps/oblib/src/lib/json_type/ob_json_tree.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface support for the json tree abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_JSON_TREE @@ -281,6 +284,7 @@ class ObJsonObject : public ObJsonContainer // @param [in] old_key The old key name. // @param [in] new_key The new key name. // @return Returns OB_SUCCESS on success, error code otherwise. + int rename_key(const common::ObString &old_key, const common::ObString &new_key); // Merges all elements on the other to the end of the current object // diff --git a/deps/oblib/src/lib/lds/ob_lds_assist.h b/deps/oblib/src/lib/lds/ob_lds_assist.h index f72ed2442..ead41346d 100644 --- a/deps/oblib/src/lib/lds/ob_lds_assist.h +++ b/deps/oblib/src/lib/lds/ob_lds_assist.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OBLIB_LDS_ASSIST_H @@ -16,13 +20,13 @@ #include "lib/utility/ob_macro_utils.h" /* - 辅助linker script的相关接口 - 基本思路是利用linker script的section排序功能(by name), - 定义两个section name特殊的begin和end节点, - 按字典序排序后这两个节点之间的对象即为目标节点 + Interfaces related to the auxiliary linker script + The basic idea is to utilize the section sorting functionality of the linker script (by name), + Define two special begin and end section nodes, + After dictionary order sorting, the objects between these two nodes are the target nodes - 假设section为mydata, 链接后地址布局如下: - var_name section_name(link前) section_name(link后) + Assuming the section is mydata, the address layout after linking is as follows: + var_name section_name(before link) section_name(after link) ------------------------------------------------------------ mydata_begin mydata mydata a mydata1 mydata @@ -30,16 +34,16 @@ c mydata3 mydata mydata_end mydataz mydata - 另外值得注意的是,这里begin/end没有采用只在link时定义的常用做法, - 而是直接编译期定义, 这是为了解决动态链接问题, 还是以上面的a, b, c为例, - 动态链接下,多个extern同名全局变量以主程序中的为准,link时主程序看不到so中的a,b,c, 从而造成begin与end地址相同 + It is also worth noting that here begin/end do not use the common practice of defining only at link time, + But are directly defined at compile time, this is to solve the dynamic linking problem, still taking the above a, b, c as an example, + In dynamic linking, multiple extern variables with the same name in different shared objects are resolved to the one in the main program, the linker cannot see a, b, c in the so when linking the main program, thus causing the begin and end addresses to be the same */ #define LDS_ATTRIBUTE_(section_name) __attribute__((section(#section_name))) #define LDS_ATTRIBUTE(section_name) LDS_ATTRIBUTE_(section_name) /* - 在section内声明、定义一个全局变量 + Declare and define a global variable within section eg. static LDS_VAR(mydata, int, i); extern LDS_VAR(mydata, int, i); @@ -71,9 +75,9 @@ inline void do_ld_iter(T *s, T *e, Func &func) } /* - 遍历section内所有全局变量, 在定义LDS_VAR_BEGIN_END的namespace下调用 + Traverse all global variables within the section, and call under the namespace defined by LDS_VAR_BEGIN_END */ #define LDS_ITER(section_name, type, func) \ do_ld_iter((type*)§ion_name##_begin + 1, (type*)§ion_name##_end, func) -#endif /* OBLIB_LDS_ASSIST_H */ \ No newline at end of file +#endif /* OBLIB_LDS_ASSIST_H */ diff --git a/deps/oblib/src/lib/lds/ob_lds_constructor.hpp b/deps/oblib/src/lib/lds/ob_lds_constructor.hpp index 7e4e2b12e..afd1d2c59 100644 --- a/deps/oblib/src/lib/lds/ob_lds_constructor.hpp +++ b/deps/oblib/src/lib/lds/ob_lds_constructor.hpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/src/lib/lds/ob_lds_define.cpp b/deps/oblib/src/lib/lds/ob_lds_define.cpp index 12b37706f..f90f38630 100644 --- a/deps/oblib/src/lib/lds/ob_lds_define.cpp +++ b/deps/oblib/src/lib/lds/ob_lds_define.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ namespace oceanbase diff --git a/deps/oblib/src/lib/lds/ob_lds_define.h b/deps/oblib/src/lib/lds/ob_lds_define.h index cd31cbb0d..315f3750e 100644 --- a/deps/oblib/src/lib/lds/ob_lds_define.h +++ b/deps/oblib/src/lib/lds/ob_lds_define.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LDS_DEFINE_H_ diff --git a/deps/oblib/src/lib/list/dlink.h b/deps/oblib/src/lib/list/dlink.h index ceacbe6de..5ba865b3f 100644 --- a/deps/oblib/src/lib/list/dlink.h +++ b/deps/oblib/src/lib/list/dlink.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIST_DLINK_H_ diff --git a/deps/oblib/src/lib/list/ob_atomic_list.h b/deps/oblib/src/lib/list/ob_atomic_list.h index ca08b84cc..0bbeaabae 100644 --- a/deps/oblib/src/lib/list/ob_atomic_list.h +++ b/deps/oblib/src/lib/list/ob_atomic_list.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_LIB_ATOMIC_LIST_H_ diff --git a/deps/oblib/src/lib/list/ob_dlink_node.h b/deps/oblib/src/lib/list/ob_dlink_node.h index c75cf4841..e9385b0ad 100644 --- a/deps/oblib/src/lib/list/ob_dlink_node.h +++ b/deps/oblib/src/lib/list/ob_dlink_node.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_LIST_OB_DLINK_NODE_H_ diff --git a/deps/oblib/src/lib/list/ob_dlist.h b/deps/oblib/src/lib/list/ob_dlist.h index d0bd40476..929401d15 100644 --- a/deps/oblib/src/lib/list/ob_dlist.h +++ b/deps/oblib/src/lib/list/ob_dlist.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_LIST_OB_DLIST_H_ diff --git a/deps/oblib/src/lib/list/ob_free_list.h b/deps/oblib/src/lib/list/ob_free_list.h index 2d807ea31..e12f68e83 100644 --- a/deps/oblib/src/lib/list/ob_free_list.h +++ b/deps/oblib/src/lib/list/ob_free_list.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __OB_COMMON_OB_FREE_LIST_H__ diff --git a/deps/oblib/src/lib/list/ob_intrusive_list.h b/deps/oblib/src/lib/list/ob_intrusive_list.h index 2ae79ba01..f6a261347 100644 --- a/deps/oblib/src/lib/list/ob_intrusive_list.h +++ b/deps/oblib/src/lib/list/ob_intrusive_list.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_LIB_INTRUSIVE_LIST_H_ diff --git a/deps/oblib/src/lib/list/ob_link.h b/deps/oblib/src/lib/list/ob_link.h index e3fbf9816..bad7872aa 100644 --- a/deps/oblib/src/lib/list/ob_link.h +++ b/deps/oblib/src/lib/list/ob_link.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_LINK_H_ diff --git a/deps/oblib/src/lib/list/ob_list.h b/deps/oblib/src/lib/list/ob_list.h index f68cc0399..8db2e568d 100644 --- a/deps/oblib/src/lib/list/ob_list.h +++ b/deps/oblib/src/lib/list/ob_list.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_LIST_H_ diff --git a/deps/oblib/src/lib/list/ob_obj_store.h b/deps/oblib/src/lib/list/ob_obj_store.h index 6ff7ebd50..729fbd74f 100644 --- a/deps/oblib/src/lib/list/ob_obj_store.h +++ b/deps/oblib/src/lib/list/ob_obj_store.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SRC_LIB_LIST_OB_OBJ_STORE_H_ diff --git a/deps/oblib/src/lib/literals/ob_literals.h b/deps/oblib/src/lib/literals/ob_literals.h index 53180d00a..fcd680f1a 100644 --- a/deps/oblib/src/lib/literals/ob_literals.h +++ b/deps/oblib/src/lib/literals/ob_literals.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef DEPS_OBLIB_SRC_LIB_LITERALS_OB_LITERALS_H #define DEPS_OBLIB_SRC_LIB_LITERALS_OB_LITERALS_H diff --git a/deps/oblib/src/lib/lob/ob_lob_base.cpp b/deps/oblib/src/lib/lob/ob_lob_base.cpp index 25f253c04..cdad35cb5 100644 --- a/deps/oblib/src/lib/lob/ob_lob_base.cpp +++ b/deps/oblib/src/lib/lob/ob_lob_base.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB #include "ob_lob_base.h" diff --git a/deps/oblib/src/lib/lob/ob_lob_base.h b/deps/oblib/src/lib/lob/ob_lob_base.h index 80877f54e..8fef06dad 100644 --- a/deps/oblib/src/lib/lob/ob_lob_base.h +++ b/deps/oblib/src/lib/lob/ob_lob_base.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface support for the json base abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_LOB_BASE @@ -141,4 +144,4 @@ class ObLobInRowUpdateCursor : public ObILobCursor } // common } // oceanbase -#endif // OCEANBASE_SQL_OB_LOB_BASE \ No newline at end of file +#endif // OCEANBASE_SQL_OB_LOB_BASE diff --git a/deps/oblib/src/lib/locale/ob_locale.cpp b/deps/oblib/src/lib/locale/ob_locale.cpp index 266ed6c26..2d6819d13 100644 --- a/deps/oblib/src/lib/locale/ob_locale.cpp +++ b/deps/oblib/src/lib/locale/ob_locale.cpp @@ -1,14 +1,18 @@ -/** -* Copyright (c) 2021 OceanBase -* OceanBase CE is licensed under Mulan PubL v2. -* You can use this software according to the terms and conditions of the Mulan PubL v2. -* You may obtain a copy of Mulan PubL v2 at: -* http://license.coscl.org.cn/MulanPubL-2.0 -* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -* See the Mulan PubL v2 for more details. -*/ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #include "lib/locale/ob_locale_type.h" namespace oceanbase { @@ -79,4 +83,4 @@ bool is_valid_ob_locale(const ObString &in_locale_name, ObString &valid_locale_n } } // common -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/deps/oblib/src/lib/locale/ob_locale_type.cc b/deps/oblib/src/lib/locale/ob_locale_type.cc index 6abfbe321..df4178741 100644 --- a/deps/oblib/src/lib/locale/ob_locale_type.cc +++ b/deps/oblib/src/lib/locale/ob_locale_type.cc @@ -1,14 +1,18 @@ -/** -* Copyright (c) 2021 OceanBase -* OceanBase CE is licensed under Mulan PubL v2. -* You can use this software according to the terms and conditions of the Mulan PubL v2. -* You may obtain a copy of Mulan PubL v2 at: -* http://license.coscl.org.cn/MulanPubL-2.0 -* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -* See the Mulan PubL v2 for more details. -*/ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #include "ob_locale_type.h" namespace oceanbase { diff --git a/deps/oblib/src/lib/locale/ob_locale_type.h b/deps/oblib/src/lib/locale/ob_locale_type.h index b88cb7e6e..165e8fc77 100644 --- a/deps/oblib/src/lib/locale/ob_locale_type.h +++ b/deps/oblib/src/lib/locale/ob_locale_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOCALE_TYPE_H_ diff --git a/deps/oblib/src/lib/lock/cond.cpp b/deps/oblib/src/lib/lock/cond.cpp index a10eaf3dc..afbf45f0c 100644 --- a/deps/oblib/src/lib/lock/cond.cpp +++ b/deps/oblib/src/lib/lock/cond.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/lock/cond.h" diff --git a/deps/oblib/src/lib/lock/cond.h b/deps/oblib/src/lib/lock/cond.h index 2302c7b28..06ac63d44 100644 --- a/deps/oblib/src/lib/lock/cond.h +++ b/deps/oblib/src/lib/lock/cond.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021, 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef COND_H diff --git a/deps/oblib/src/lib/lock/mutex.h b/deps/oblib/src/lib/lock/mutex.h index 414c66483..7e527d50c 100644 --- a/deps/oblib/src/lib/lock/mutex.h +++ b/deps/oblib/src/lib/lock/mutex.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021, 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef MUTEX_H diff --git a/deps/oblib/src/lib/lock/ob_bucket_lock.cpp b/deps/oblib/src/lib/lock/ob_bucket_lock.cpp index e012ed4ac..94a377b21 100644 --- a/deps/oblib/src/lib/lock/ob_bucket_lock.cpp +++ b/deps/oblib/src/lib/lock/ob_bucket_lock.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/lock/ob_bucket_lock.h" diff --git a/deps/oblib/src/lib/lock/ob_bucket_lock.h b/deps/oblib/src/lib/lock/ob_bucket_lock.h index 8c9af0725..89379348e 100644 --- a/deps/oblib/src/lib/lock/ob_bucket_lock.h +++ b/deps/oblib/src/lib/lock/ob_bucket_lock.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_BUCKET_LOCK_H_ diff --git a/deps/oblib/src/lib/lock/ob_bucket_qsync_lock.cpp b/deps/oblib/src/lib/lock/ob_bucket_qsync_lock.cpp index c8ad4b3d7..1627220c4 100644 --- a/deps/oblib/src/lib/lock/ob_bucket_qsync_lock.cpp +++ b/deps/oblib/src/lib/lock/ob_bucket_qsync_lock.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/lock/ob_bucket_qsync_lock.h" diff --git a/deps/oblib/src/lib/lock/ob_bucket_qsync_lock.h b/deps/oblib/src/lib/lock/ob_bucket_qsync_lock.h index 87562552f..e8ae17e7c 100644 --- a/deps/oblib/src/lib/lock/ob_bucket_qsync_lock.h +++ b/deps/oblib/src/lib/lock/ob_bucket_qsync_lock.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SHARE_LOCK_OB_BUCKET_QSYNC_LOCK_H_ #define OCEANBASE_SHARE_LOCK_OB_BUCKET_QSYNC_LOCK_H_ diff --git a/deps/oblib/src/lib/lock/ob_drw_lock.h b/deps/oblib/src/lib/lock/ob_drw_lock.h index 552674f6e..04b066cfe 100644 --- a/deps/oblib/src/lib/lock/ob_drw_lock.h +++ b/deps/oblib/src/lib/lock/ob_drw_lock.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_DRW_LOCK_H_ diff --git a/deps/oblib/src/lib/lock/ob_futex.cpp b/deps/oblib/src/lib/lock/ob_futex.cpp index f73f15ac7..6f496091f 100644 --- a/deps/oblib/src/lib/lock/ob_futex.cpp +++ b/deps/oblib/src/lib/lock/ob_futex.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_futex.h" diff --git a/deps/oblib/src/lib/lock/ob_futex.h b/deps/oblib/src/lib/lock/ob_futex.h index 555fb52a5..d2255b1c4 100644 --- a/deps/oblib/src/lib/lock/ob_futex.h +++ b/deps/oblib/src/lib/lock/ob_futex.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_FUTEX_H diff --git a/deps/oblib/src/lib/lock/ob_latch.cpp b/deps/oblib/src/lib/lock/ob_latch.cpp index fdfa79dcc..f1e86d9ce 100644 --- a/deps/oblib/src/lib/lock/ob_latch.cpp +++ b/deps/oblib/src/lib/lock/ob_latch.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/lock/ob_latch.h" diff --git a/deps/oblib/src/lib/lock/ob_latch.h b/deps/oblib/src/lib/lock/ob_latch.h index 498eeb5d5..c0d8e432a 100644 --- a/deps/oblib/src/lib/lock/ob_latch.h +++ b/deps/oblib/src/lib/lock/ob_latch.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOCK_LATCH_H_ diff --git a/deps/oblib/src/lib/lock/ob_lock.h b/deps/oblib/src/lib/lock/ob_lock.h index 5bca4017e..c296563bb 100644 --- a/deps/oblib/src/lib/lock/ob_lock.h +++ b/deps/oblib/src/lib/lock/ob_lock.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_LOCK_H diff --git a/deps/oblib/src/lib/lock/ob_lock_guard.h b/deps/oblib/src/lib/lock/ob_lock_guard.h index 5c1d54a53..72946e4cf 100644 --- a/deps/oblib/src/lib/lock/ob_lock_guard.h +++ b/deps/oblib/src/lib/lock/ob_lock_guard.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_LOCK_GUARD_H_ diff --git a/deps/oblib/src/lib/lock/ob_monitor.h b/deps/oblib/src/lib/lock/ob_monitor.h index 3368d4e8c..d4752ea05 100644 --- a/deps/oblib/src/lib/lock/ob_monitor.h +++ b/deps/oblib/src/lib/lock/ob_monitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021, 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_MONITOR_H diff --git a/deps/oblib/src/lib/lock/ob_mutex.h b/deps/oblib/src/lib/lock/ob_mutex.h index caa04e6e5..095d645a0 100644 --- a/deps/oblib/src/lib/lock/ob_mutex.h +++ b/deps/oblib/src/lib/lock/ob_mutex.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_MUTEX_H_ diff --git a/deps/oblib/src/lib/lock/ob_qsync_lock.cpp b/deps/oblib/src/lib/lock/ob_qsync_lock.cpp index c4dfbc989..1d1edb5ff 100644 --- a/deps/oblib/src/lib/lock/ob_qsync_lock.cpp +++ b/deps/oblib/src/lib/lock/ob_qsync_lock.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021, 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_qsync_lock.h" diff --git a/deps/oblib/src/lib/lock/ob_qsync_lock.h b/deps/oblib/src/lib/lock/ob_qsync_lock.h index c12f1e393..b2ad4eeb7 100644 --- a/deps/oblib/src/lib/lock/ob_qsync_lock.h +++ b/deps/oblib/src/lib/lock/ob_qsync_lock.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021, 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SHARE_LOCK_QSYNC_LOCK_H diff --git a/deps/oblib/src/lib/lock/ob_recursive_mutex.h b/deps/oblib/src/lib/lock/ob_recursive_mutex.h index bdce99dfe..f19cdf14b 100644 --- a/deps/oblib/src/lib/lock/ob_recursive_mutex.h +++ b/deps/oblib/src/lib/lock/ob_recursive_mutex.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_RECURSIVE_MUTEX_H_ diff --git a/deps/oblib/src/lib/lock/ob_rwlock.cpp b/deps/oblib/src/lib/lock/ob_rwlock.cpp index fe5730c66..11f605fe7 100644 --- a/deps/oblib/src/lib/lock/ob_rwlock.cpp +++ b/deps/oblib/src/lib/lock/ob_rwlock.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_rwlock.h" diff --git a/deps/oblib/src/lib/lock/ob_rwlock.h b/deps/oblib/src/lib/lock/ob_rwlock.h index 38bbdca47..f4c410b09 100644 --- a/deps/oblib/src/lib/lock/ob_rwlock.h +++ b/deps/oblib/src/lib/lock/ob_rwlock.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_RW_LOCK_H diff --git a/deps/oblib/src/lib/lock/ob_scond.h b/deps/oblib/src/lib/lock/ob_scond.h index 55ac9e210..50a7f04fb 100644 --- a/deps/oblib/src/lib/lock/ob_scond.h +++ b/deps/oblib/src/lib/lock/ob_scond.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOCK_OB_SCOND_H_ diff --git a/deps/oblib/src/lib/lock/ob_small_spin_lock.h b/deps/oblib/src/lib/lock/ob_small_spin_lock.h index be78ee1d1..291fe3a60 100644 --- a/deps/oblib/src/lib/lock/ob_small_spin_lock.h +++ b/deps/oblib/src/lib/lock/ob_small_spin_lock.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_LOCK_OB_SMALL_LOCK_ diff --git a/deps/oblib/src/lib/lock/ob_spin_lock.h b/deps/oblib/src/lib/lock/ob_spin_lock.h index 9a507b1d5..020d05f07 100644 --- a/deps/oblib/src/lib/lock/ob_spin_lock.h +++ b/deps/oblib/src/lib/lock/ob_spin_lock.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_SPIN_LOCK_H diff --git a/deps/oblib/src/lib/lock/ob_spin_rwlock.h b/deps/oblib/src/lib/lock/ob_spin_rwlock.h index 22847cb53..61903f5eb 100644 --- a/deps/oblib/src/lib/lock/ob_spin_rwlock.h +++ b/deps/oblib/src/lib/lock/ob_spin_rwlock.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_SPIN_RWLOCK_H_ diff --git a/deps/oblib/src/lib/lock/ob_tc_ref.h b/deps/oblib/src/lib/lock/ob_tc_ref.h index effbc463a..cbc6466b7 100644 --- a/deps/oblib/src/lib/lock/ob_tc_ref.h +++ b/deps/oblib/src/lib/lock/ob_tc_ref.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOCK_TC_REF_H_ @@ -63,7 +67,7 @@ class TCRef } return xref_(p, cnt); } - // 不传出slot_id的只会关注自己的槽 + // Not passing slot_id will only focus on its own slot int32_t inc_ref(int32_t* p) { int32_t ref_cnt = REF_LIMIT; int64_t start = ref_count_per_thread_ * (get_itid() % MAX_CPU_NUM); @@ -94,7 +98,7 @@ class TCRef } return ref_cnt; } - // 传出slot_id的会尝试所有的SLOT + // The slot_id passed out will attempt all the SLOT int32_t inc_ref(int32_t* p, int64_t &slot_id) { int32_t ref_cnt = REF_LIMIT; int64_t start = ref_count_per_thread_ * (get_itid() % MAX_CPU_NUM); diff --git a/deps/oblib/src/lib/lock/ob_tc_rwlock.h b/deps/oblib/src/lib/lock/ob_tc_rwlock.h index a1ab7194c..ec67e9d8f 100644 --- a/deps/oblib/src/lib/lock/ob_tc_rwlock.h +++ b/deps/oblib/src/lib/lock/ob_tc_rwlock.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOCK_TC_RWLOCK_H_ diff --git a/deps/oblib/src/lib/lock/ob_thread_cond.cpp b/deps/oblib/src/lib/lock/ob_thread_cond.cpp index f44fc30b6..2973f4380 100644 --- a/deps/oblib/src/lib/lock/ob_thread_cond.cpp +++ b/deps/oblib/src/lib/lock/ob_thread_cond.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/src/lib/lock/ob_thread_cond.h b/deps/oblib/src/lib/lock/ob_thread_cond.h index 85160ee35..b95741650 100644 --- a/deps/oblib/src/lib/lock/ob_thread_cond.h +++ b/deps/oblib/src/lib/lock/ob_thread_cond.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_THREAD_COND_H_ diff --git a/deps/oblib/src/lib/metrics/ob_accumulator.h b/deps/oblib/src/lib/metrics/ob_accumulator.h index 25e0788f8..21ff207f7 100644 --- a/deps/oblib/src/lib/metrics/ob_accumulator.h +++ b/deps/oblib/src/lib/metrics/ob_accumulator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_ACCUMULATOR_H diff --git a/deps/oblib/src/lib/metrics/ob_counter.h b/deps/oblib/src/lib/metrics/ob_counter.h index 0606ab631..ac538d050 100644 --- a/deps/oblib/src/lib/metrics/ob_counter.h +++ b/deps/oblib/src/lib/metrics/ob_counter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_COUNTER_H diff --git a/deps/oblib/src/lib/metrics/ob_ema.h b/deps/oblib/src/lib/metrics/ob_ema.h index 111f3cd91..bc751de18 100644 --- a/deps/oblib/src/lib/metrics/ob_ema.h +++ b/deps/oblib/src/lib/metrics/ob_ema.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_EMA_H diff --git a/deps/oblib/src/lib/metrics/ob_ema_v2.h b/deps/oblib/src/lib/metrics/ob_ema_v2.h index 03e2883c5..6c2de27ca 100644 --- a/deps/oblib/src/lib/metrics/ob_ema_v2.h +++ b/deps/oblib/src/lib/metrics/ob_ema_v2.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_EMA_V2_H diff --git a/deps/oblib/src/lib/metrics/ob_meter.cpp b/deps/oblib/src/lib/metrics/ob_meter.cpp index 5425f1644..06a5b105e 100644 --- a/deps/oblib/src/lib/metrics/ob_meter.cpp +++ b/deps/oblib/src/lib/metrics/ob_meter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/metrics/ob_meter.h" diff --git a/deps/oblib/src/lib/metrics/ob_meter.h b/deps/oblib/src/lib/metrics/ob_meter.h index 484fecfef..4e499026c 100644 --- a/deps/oblib/src/lib/metrics/ob_meter.h +++ b/deps/oblib/src/lib/metrics/ob_meter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_METER_H diff --git a/deps/oblib/src/lib/mysqlclient/mysql_result_wrapper.h b/deps/oblib/src/lib/mysqlclient/mysql_result_wrapper.h index e97dd8567..bd2077c6c 100644 --- a/deps/oblib/src/lib/mysqlclient/mysql_result_wrapper.h +++ b/deps/oblib/src/lib/mysqlclient/mysql_result_wrapper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_MYSQL_RESULT_WRAPPER_H_ diff --git a/deps/oblib/src/lib/mysqlclient/ob_connection_allocator.h b/deps/oblib/src/lib/mysqlclient/ob_connection_allocator.h index 983e82606..6b0c02e4c 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_connection_allocator.h +++ b/deps/oblib/src/lib/mysqlclient/ob_connection_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __OB_CONNECTION_ALLOCATOR_H__ diff --git a/deps/oblib/src/lib/mysqlclient/ob_dblink_error_trans.cpp b/deps/oblib/src/lib/mysqlclient/ob_dblink_error_trans.cpp index e72fcdfdb..dad03e0eb 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_dblink_error_trans.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_dblink_error_trans.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_MYSQLC diff --git a/deps/oblib/src/lib/mysqlclient/ob_dblink_error_trans.h b/deps/oblib/src/lib/mysqlclient/ob_dblink_error_trans.h index 7564b037d..ad1db538e 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_dblink_error_trans.h +++ b/deps/oblib/src/lib/mysqlclient/ob_dblink_error_trans.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OBDBLINKERROR_H @@ -59,4 +63,4 @@ class ObDblinkErrorTrans { } // namespace sqlclient } // namespace common } // namespace oceanbase -#endif //OBDBLINKERROR_H \ No newline at end of file +#endif //OBDBLINKERROR_H diff --git a/deps/oblib/src/lib/mysqlclient/ob_isql_client.cpp b/deps/oblib/src/lib/mysqlclient/ob_isql_client.cpp index 69e5f9953..4bdccdc99 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_isql_client.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_isql_client.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/mysqlclient/ob_isql_client.h" diff --git a/deps/oblib/src/lib/mysqlclient/ob_isql_client.h b/deps/oblib/src/lib/mysqlclient/ob_isql_client.h index b416edf96..7e17461d2 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_isql_client.h +++ b/deps/oblib/src/lib/mysqlclient/ob_isql_client.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_MYSQL_PROXY_OB_ISQL_CLIENT_H_ diff --git a/deps/oblib/src/lib/mysqlclient/ob_isql_connection.h b/deps/oblib/src/lib/mysqlclient/ob_isql_connection.h index 09a0c6408..0671970cf 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_isql_connection.h +++ b/deps/oblib/src/lib/mysqlclient/ob_isql_connection.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_MYSQLCLIENT_OB_ISQL_CONNECTION_H_ diff --git a/deps/oblib/src/lib/mysqlclient/ob_isql_connection_pool.h b/deps/oblib/src/lib/mysqlclient/ob_isql_connection_pool.h index e05d1a254..98c3bd399 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_isql_connection_pool.h +++ b/deps/oblib/src/lib/mysqlclient/ob_isql_connection_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_MYSQLCLIENT_OB_ISQL_CONNECTION_POOL_H_ diff --git a/deps/oblib/src/lib/mysqlclient/ob_isql_result_handler.h b/deps/oblib/src/lib/mysqlclient/ob_isql_result_handler.h index 546775bf3..9d1e3a1cd 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_isql_result_handler.h +++ b/deps/oblib/src/lib/mysqlclient/ob_isql_result_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_MYSQLCLIENT_OB_ISQL_RESULT_HANDLER_H_ diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.cpp b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.cpp index ea43ce98c..18529ff91 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_MYSQLC diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.h index 10b3438d5..2ac03ee29 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __COMMON_OB_MYSQL_CONNECTION__ diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.cpp b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.cpp index fad824459..950cf0d3e 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_MYSQLC diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.h index 428ba9c07..b0110f899 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __COMMON_OB_MYSQL_CONNECTION_POOL__ diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_param.cpp b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_param.cpp index 0b4900061..8ae40ea10 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_param.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_param.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_MYSQLC diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_param.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_param.h index c834351a8..11584d033 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_param.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_param.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __OB_COMMON_SQLCLIENT_MYSQL_PREPARED_PARAM__ diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_result.cpp b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_result.cpp index 3063107cc..c2deb6bcf 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_result.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_result.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_MYSQLC diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_result.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_result.h index 7dfb462a8..e30deac4f 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_result.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_result.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __OB_COMMON_SQLCLIENT_OB_MYSQL_PREPARED_RESULT__ diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_statement.cpp b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_statement.cpp index 937af357b..8de519506 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_statement.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_statement.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_MYSQLC diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_statement.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_statement.h index f8629acad..7afe27dce 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_statement.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_prepared_statement.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __OB_COMMON_SQLCLIENT_OB_MYSQL_PREPARED_STATEMENT__ diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy.cpp b/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy.cpp index bedec0311..b80ffb391 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON_MYSQLP diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy.h index a42e9c5ac..52fd4124d 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_MYSQL_PROXY_H_ diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy_util.cpp b/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy_util.cpp index e73c89831..7929094e7 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy_util.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy_util.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON_MYSQLP diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy_util.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy_util.h index 8d86af581..be23ddc53 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy_util.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_proxy_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ROOT_MYSQL_PROXY_UTIL_H_ diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_read_context.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_read_context.h index eec31f26b..7ccf83ac6 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_read_context.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_read_context.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_MYSQLCLIENT_OB_MYSQL_READ_CONTEXT_H_ diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_result.cpp b/deps/oblib/src/lib/mysqlclient/ob_mysql_result.cpp index edd8d379f..dbd44e638 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_result.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_result.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_MYSQLC diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_result.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_result.h index d9ce5e045..3429585d8 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_result.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_result.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_MYSQL_RESULT_H_ @@ -1022,9 +1026,11 @@ } \ } -/** EXTRACT_NEW_DEFAULT_VALUE_FIELD_MYSQL用于获取__all_column中的默认值,后面做了修改,默认值可能 - 从cur_default_value或者new_default_value获取,这里做了兼容处理,用default_value_v2_version做这两种情况的区分 -*/ +/** + * EXTRACT_NEW_DEFAULT_VALUE_FIELD_MYSQL is used to obtain the default value from __all_column, later modifications were made, + * and the default value may be obtained from either cur_default_value or new_default_value. Here, compatibility handling is done, + * using default_value_v2_version to distinguish between these two scenarios + */ #define EXTRACT_DEFAULT_VALUE_FIELD_MYSQL(result, column_name, data_type, class_obj,is_cur_default_value, default_value_v2_version, tenant_id) \ [&]() { /*+ The original macro use too much stack space, wrap to lambda to avoid it. */ \ if (OB_SUCC(ret)) \ diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_result_impl.cpp b/deps/oblib/src/lib/mysqlclient/ob_mysql_result_impl.cpp index 3f8397738..8d30fbe56 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_result_impl.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_result_impl.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_MYSQLC diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_result_impl.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_result_impl.h index a951a3943..238890cc7 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_result_impl.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_result_impl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __OB_COMMON_SQLCLIENT_OB_MYSQL_RESULT__ diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_server_provider.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_server_provider.h index 143f4022f..ad2c8fc6f 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_server_provider.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_server_provider.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __OB_COMMON_SQLCLIENT_MYSQL_SERVER_PROVIDER__ diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_statement.cpp b/deps/oblib/src/lib/mysqlclient/ob_mysql_statement.cpp index 26eed1dac..0b8233904 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_statement.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_statement.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_MYSQLC diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_statement.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_statement.h index 3ec0ac5cc..72f56dc22 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_statement.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_statement.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __OB_COMMON_SQLCLIENT_OB_MYSQL_STATEMENT__ diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_transaction.cpp b/deps/oblib/src/lib/mysqlclient/ob_mysql_transaction.cpp index a0cb2b534..13546ca36 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_transaction.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_transaction.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON_MYSQLP diff --git a/deps/oblib/src/lib/mysqlclient/ob_mysql_transaction.h b/deps/oblib/src/lib/mysqlclient/ob_mysql_transaction.h index a6fa6c839..91546ca0e 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_mysql_transaction.h +++ b/deps/oblib/src/lib/mysqlclient/ob_mysql_transaction.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_MYSQL_TRANSACTION_H_ @@ -92,7 +96,7 @@ class ObMySQLTransaction : public ObSingleConnectionProxy protected: int64_t start_time_; bool in_trans_; - // inner sql now not support multi query,enable_query_stash now just enable for batch insert values + // inner sql now not support multi query, enable_query_stash now just enable for batch insert values bool enable_query_stash_; hash::ObHashMap query_stash_desc_; }; diff --git a/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.cpp b/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.cpp index 2a9c5e8af..151fc9a15 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_MYSQLC diff --git a/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.h b/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.h index 6d52f923d..0923d20c1 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.h +++ b/deps/oblib/src/lib/mysqlclient/ob_server_connection_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __COMMON_OB_SERVER_CONNECTION_POOL__ diff --git a/deps/oblib/src/lib/mysqlclient/ob_single_connection_proxy.cpp b/deps/oblib/src/lib/mysqlclient/ob_single_connection_proxy.cpp index 7be178099..c5701d5c6 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_single_connection_proxy.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_single_connection_proxy.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON_MYSQLP diff --git a/deps/oblib/src/lib/mysqlclient/ob_single_connection_proxy.h b/deps/oblib/src/lib/mysqlclient/ob_single_connection_proxy.h index 35c8677d0..6185b4fad 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_single_connection_proxy.h +++ b/deps/oblib/src/lib/mysqlclient/ob_single_connection_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_SINGLE_CONNECTION_PROXY_H diff --git a/deps/oblib/src/lib/mysqlclient/ob_single_mysql_connection_pool.cpp b/deps/oblib/src/lib/mysqlclient/ob_single_mysql_connection_pool.cpp index b1b6a71a9..9b362860f 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_single_mysql_connection_pool.cpp +++ b/deps/oblib/src/lib/mysqlclient/ob_single_mysql_connection_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_MYSQLC diff --git a/deps/oblib/src/lib/mysqlclient/ob_single_mysql_connection_pool.h b/deps/oblib/src/lib/mysqlclient/ob_single_mysql_connection_pool.h index e3b12b86e..f4073df4e 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_single_mysql_connection_pool.h +++ b/deps/oblib/src/lib/mysqlclient/ob_single_mysql_connection_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SINGLE_MYSQL_CONNECTION_POOL_H_ diff --git a/deps/oblib/src/lib/mysqlclient/ob_tenant_oci_envs.h b/deps/oblib/src/lib/mysqlclient/ob_tenant_oci_envs.h index 25cc72b88..e69b43008 100644 --- a/deps/oblib/src/lib/mysqlclient/ob_tenant_oci_envs.h +++ b/deps/oblib/src/lib/mysqlclient/ob_tenant_oci_envs.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OBTENANOCIENVS_H @@ -22,4 +26,4 @@ namespace sqlclient } //sqlclient } // namespace common } // namespace oceanbase -#endif //OBTENANOCIENVS_H \ No newline at end of file +#endif //OBTENANOCIENVS_H diff --git a/deps/oblib/src/lib/net/ob_addr.cpp b/deps/oblib/src/lib/net/ob_addr.cpp index 0f207f61e..f67a3225c 100644 --- a/deps/oblib/src/lib/net/ob_addr.cpp +++ b/deps/oblib/src/lib/net/ob_addr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/net/ob_addr.h b/deps/oblib/src/lib/net/ob_addr.h index f5cf88064..4242a2f6c 100644 --- a/deps/oblib/src/lib/net/ob_addr.h +++ b/deps/oblib/src/lib/net/ob_addr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_LIB_NET_OB_ADDR_H_ diff --git a/deps/oblib/src/lib/net/ob_net_util.cpp b/deps/oblib/src/lib/net/ob_net_util.cpp index 01347a00e..3e8f7d359 100644 --- a/deps/oblib/src/lib/net/ob_net_util.cpp +++ b/deps/oblib/src/lib/net/ob_net_util.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/net/ob_net_util.h b/deps/oblib/src/lib/net/ob_net_util.h index 27b104afe..ba0636233 100644 --- a/deps/oblib/src/lib/net/ob_net_util.h +++ b/deps/oblib/src/lib/net/ob_net_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_NET_UTIL_H_ diff --git a/deps/oblib/src/lib/number/ob_number_v2.cpp b/deps/oblib/src/lib/number/ob_number_v2.cpp index 01b4861ed..479532e7b 100644 --- a/deps/oblib/src/lib/number/ob_number_v2.cpp +++ b/deps/oblib/src/lib/number/ob_number_v2.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -55,8 +59,7 @@ const ObNumber &ObNumber::get_pi() } const ObString NUMBER_ERRMSG("ERROR NUM");//9 byte - -// ObNumber 序列化反序列化实现,完全参考了 ObObj 中的代码 +// ObNumber serialization deserialization implementation, completely referenced the code in ObObj DEFINE_SERIALIZE(ObNumber) { return serialization::encode_number_type(buf, buf_len, pos, d_, digits_); @@ -171,10 +174,13 @@ int ObNumber::compare(const number::ObNumber::Desc &this_desc, } /* - 对于整型数值,可以做如下的优化: - 计算每一个进制位上的对应的数值(整型最多有两位),并根据整型参数填充Number的DESC(符号位、exp等)。 - 比如对于1000000001,进制位10^9,不断除以10^9,可以计算出两个进制位上的数值为(1,1),即digit数组为 - [1, 1],并且可以知道指数值为1,符号位的值为1,digit的有效长度为2 + For integer values, the following optimizations can be made: + Calculate the corresponding value for each digit position (an integer has at most two digits), + and fill the DESC of Number based on the integer parameter (sign bit, exp, etc.). + For example, for 1000000001, with a digit position of 10^9, continuously dividing by 10^9 + can calculate the values of the two digit positions as (1, 1), i.e., the digit array is + [1, 1], and it can be known that the exponent value is 1, the sign bit value is 1, + and the effective length of digit is 2 */ template int ObNumber::from_integer_(const IntegerT value, IAllocator &allocator) { @@ -188,7 +194,7 @@ int ObNumber::from_integer_(const IntegerT value, IAllocator &allocator) { Desc desc; uint64_t abs_val = 0; - if (std::is_signed::value) { // 如果是符号整数,调用abs + if (std::is_signed::value) { // If it is a signed integer, call abs #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wabsolute-value" @@ -198,7 +204,7 @@ int ObNumber::from_integer_(const IntegerT value, IAllocator &allocator) { #pragma clang diagnostic pop #endif - } else { // 否则直接赋值 + } else { // otherwise directly assign abs_val = value; } uint64_t exp = 0; @@ -760,7 +766,7 @@ int ObNumber::from_v3_(const char *str, const int64_t length, IAllocator &alloca { int ret = OB_SUCCESS; UNUSED(fmt); - uint32_t digits[OB_CALC_BUFFER_SIZE] ={}; // 只保存最多 72 位有效数字,占位 9 个uint32,多余的数字四舍五入 + uint32_t digits[OB_CALC_BUFFER_SIZE] ={}; // Only save up to 72 significant digits, occupying 9 uint32s, with extra digits rounded bool negative = false; int64_t start_idx = -1; int64_t floating_point = -1; @@ -1211,8 +1217,7 @@ bool ObNumber::is_valid_int64(int64_t &int64) const return bret; } - -// 小数点儿后全部截断 +// Truncate everything after the decimal point int ObNumber::extract_valid_int64_with_trunc(int64_t &value) const { int ret = common::OB_SUCCESS; @@ -1310,13 +1315,13 @@ int ObNumber::check_range(bool *is_valid_uint64, bool *is_valid_int64, uint64_t &int_parts, uint64_t &decimal_parts) const { /* - * 为了注释能短点,这回就用中文写了。不是我英文水平不行啊。^_^ - * 对于一个负数,它绝对不可能是一个合法的uint64 - * -value < -x 等价于 value > x 因此,取绝对值来判断 - * 对于一个正数,uint64的范围比int64范围大。 - * 这几种情况,上限都不同,放到了THRESHOLD数组里。 - * 正数、负数;uint64、int64;四种组合情况 - * 其中负数与uint64这种情况直接枪毙,因此THRESHOLD只有三个upperbound。 + * In order to make the comment shorter, I wrote it in Chinese this time. It's not that my English is bad. ^_^ + * For a negative number, it can never be a valid uint64. + * -value < -x is equivalent to value > x, therefore, take the absolute value to judge. + * For a positive number, the range of uint64 is larger than that of int64. + * These cases have different upper limits, which are placed in the THRESHOLD array. + * Positive, negative; uint64, int64; four combinations of situations. + * Among them, the case of negative with uint64 is directly eliminated, so THRESHOLD only has three upper bounds. * * */ @@ -1769,12 +1774,14 @@ int ObNumber::round_scale_v3_(const int64_t scale, const bool using_floating_sca const int64_t decimal_prefix_zero_count = ((0 == integer_length) ? (0 - expr_value - 1 + DIGIT_LEN - digit_0_len) : 0); int64_t valid_precision = 0; if (for_oracle_to_char) { - // Todo: 当number小数部分包含前缀0时(e.g:0.00012345),oracle to_char 转换有效数字需包含前缀0, + // Todo: When the decimal part of number contains a prefix 0 (e.g:0.00012345), oracle to_char conversion of significant digits needs to include the prefix 0, // e.g: // select cast(0.00012345678901234567890123456789012345678901111 as varchar(100)) from dual; // Oracle result: .000123456789012345678901234567890123457 - // oracle在to_char计算时,长度大于40的number会进行科学计数法转换,前缀0会去除。OB暂时没有兼容Oracle行为(科学计数法与精度联动), - // 因此在number to char转换出现前缀0时(decimal_prefix_zero_count > 0),保持与修改前一致 + // oracle in to_char calculation, numbers with length greater than 40 will be converted + // to scientific notation, prefix 0 will be removed. OB temporarily does not support + // Oracle behavior (scientific notation and precision linkage) + // Therefore, when prefix 0 appears in number to char conversion (decimal_prefix_zero_count > 0), keep consistent with before modification valid_precision = OB_MAX_NUMBER_PRECISION_INNER - is_negative() - (has_decimal() ? (decimal_prefix_zero_count > 0 ? 2 : 1) : 0); if (decimal_prefix_zero_count >=2 && decimal_prefix_zero_count <= 4) { @@ -2813,7 +2820,7 @@ int ObNumber::format_v1(char *buf, const int64_t buf_len, int64_t &pos, int16_t if (nmb->is_negative()) { ret = databuff_printf(buf, buf_len, pos, "-"); } - // oracle模式下小数的整数部分不补0,0.2345用.2345表示,-0.2345用-.2345表示 + // In oracle mode, the integer part of a decimal is not padded with 0, 0.2345 is represented as .2345, -0.2345 is represented as -.2345 if (OB_SUCCESS == ret && nmb->is_decimal() && !is_oracle_mode()) { ret = databuff_printf(buf, buf_len, pos, "0"); } @@ -3016,7 +3023,7 @@ int ObNumber::format_v2( if (is_negative()) { buf[pos++] = '-'; } - // oracle模式下小数的整数部分不补0,0.2345用.2345表示,-0.2345用-.2345表示 + // In oracle mode, the integer part of a decimal is not padded with 0, 0.2345 is represented as .2345, -0.2345 is represented as -.2345 if (nmb->is_decimal() && !is_oracle_mode()) { buf[pos++] = '0'; } @@ -3362,9 +3369,8 @@ int ObNumber::get_npi_(int64_t n, ObNumber& out, ObIAllocator &alloc, const bool } return ret; } - -// 根据前一项的阶乘计算本项阶乘,每次只用乘两个数即可,不需要从头计算 -// 见sin/cos的泰勒展开式 +// Calculate the factorial of this item based on the factorial of the previous item, only need to multiply two numbers each time, no need to start from scratch +// See the Taylor series expansion of sin/cos int ObNumber::simple_factorial_for_sincos_(int64_t start, ObIAllocator &allocator, ObNumber &result) const { int ret = OB_SUCCESS; @@ -3439,7 +3445,7 @@ int ObNumber::taylor_series_sin_(const ObNumber &transformed_x, ObNumber &out, O } else if (OB_FAIL(iter_result.div_v3(divisor, iter_result, local_alloc_for_loop_1, ObNumber::OB_MAX_DECIMAL_DIGIT, false))) { LOG_WARN("iter_result.div_v3(divisor) failed", K(ret), K(iter_result)); } else { - if (idx & 1) { // 奇数次 + if (idx & 1) { // odd time if (OB_FAIL(tmp_out.sub_v3(iter_result, tmp_out, local_alloc_for_loop_1, true, false))) { LOG_WARN("tmp_out.sub_v3(iter_result) failed", K(ret), K(tmp_out)); } @@ -3465,10 +3471,9 @@ int ObNumber::taylor_series_sin_(const ObNumber &transformed_x, ObNumber &out, O } return ret; } - -// 1. 将输入转换到[0, 2π] -// 2. 将输入转换到[0, π] -// 3. 通过泰勒展开计算sin结果 +// 1. Convert input to [0, 2π] +// 2. Convert input to [0, π] +// 3. Calculate sin result through Taylor expansion int ObNumber::sin(ObNumber &out, ObIAllocator &allocator, const bool do_rounding) const { int ret = OB_SUCCESS; @@ -3605,7 +3610,7 @@ int ObNumber::taylor_series_cos_(const ObNumber &transformed_x, ObNumber &out, O } else if (OB_FAIL(iter_result.div_v3(divisor, iter_result, local_alloc_for_loop_1, ObNumber::OB_MAX_DECIMAL_DIGIT, false))) { LOG_WARN("iter_result.div_v3(divisor) failed", K(ret), K(iter_result), K(divisor)); } else { - if (idx & 1) { // 奇数次循环 + if (idx & 1) { // odd number loop if (OB_FAIL(tmp_out.sub_v3(iter_result, tmp_out, local_alloc_for_loop_1, true, false))) { LOG_WARN("tmp_out.sub_v3(iter_result) failed", K(ret), K(tmp_out), K(iter_result)); } @@ -3631,12 +3636,11 @@ int ObNumber::taylor_series_cos_(const ObNumber &transformed_x, ObNumber &out, O } return ret; } - -// 1. 将输入转换到[-π/2, 3π/2] -// 2. 将输入转换到[-π/2, π/2] -// 3. 通过泰勒展开计算cos结果 -// 也可以通过cos(x) = sin(x+π/2),或者cos(x) = sqrt(1 - sin(x)^2)来计算cos, -// 这样速度更快,但是精度不如用泰勒展开 +// 1. Convert input to [-π/2, 3π/2] +// 2. Convert input to [-π/2, π/2] +// 3. Calculate cos result through Taylor expansion +// You can also calculate cos using cos(x) = sin(x+π/2), or cos(x) = sqrt(1 - sin(x)^2), +// This way is faster, but the accuracy is not as good as using Taylor expansion int ObNumber::cos(ObNumber &out, ObIAllocator &allocator, const bool do_rounding) const { int ret = OB_SUCCESS; @@ -3663,7 +3667,7 @@ int ObNumber::cos(ObNumber &out, ObIAllocator &allocator, const bool do_rounding ObNumber transformed_x; if (x.is_negative()) { - // cos(x)是偶函数,不需要设置neg + // cos(x) is an even function, no need to set neg if (OB_FAIL(x.negate(x, local_alloc))) { LOG_WARN("x.negate failed", K(ret), K(x)); } @@ -3738,8 +3742,7 @@ int ObNumber::cos(ObNumber &out, ObIAllocator &allocator, const bool do_rounding } return ret; } - -// 直接使用sin/cos来计算tan +// Directly use sin/cos to calculate tan int ObNumber::tan(ObNumber &out, ObIAllocator &allocator, const bool do_rounding) const { int ret = OB_SUCCESS; @@ -5002,7 +5005,7 @@ int ObNumber::mul_v3(const ObNumber &other, ObNumber &value, ObIAllocator &alloc int64_t multiplicand_len = multiplicand_desc.len_; int64_t multiplier_len = multiplier_desc.len_; - /* 保证 for 循环先循环长度较小的 */ + /* ensure the for loop iterates over the shorter length first */ if (d_.len_ > other.d_.len_) { multiplicand_digits = other.digits_; multiplier_digits = digits_; diff --git a/deps/oblib/src/lib/number/ob_number_v2.h b/deps/oblib/src/lib/number/ob_number_v2.h index 4f55dbca4..9da4cf733 100644 --- a/deps/oblib/src/lib/number/ob_number_v2.h +++ b/deps/oblib/src/lib/number/ob_number_v2.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_NUMBER_OB_NUMBER_V2_H_ @@ -104,7 +108,7 @@ struct ObNumberFmtModel { bool has_x_ = false; bool has_d_ = false; //has D/d/. format element:decimal point - bool has_sign_ = false; //has S/s format element:sign + bool has_sign_ = false; //has S/s format element: sign bool has_currency_ = false; //has currency element: only support dollar for now bool has_b_ = false; //has B/b format element:Returns blanks for the integer part //of a fixed-point number when the integer part is zero @@ -167,7 +171,7 @@ class ObNumber final // 5 valid digits, another: 1 for round, 1 for negative end flag static const int64_t MAX_STORE_LEN = 9; static const int64_t MAX_APPEND_LEN = 3;// '+'/'-', '.', '\0' - // number存储需要消耗的空间,6个int32_t的digit空间,1个int32_t的Desc空间 + // number stores the required space, 6 int32_t digit spaces, 1 int32_t Desc space static const int64_t MAX_BYTE_LEN = sizeof(uint32_t) * MAX_STORE_LEN + sizeof(Desc::desc_); static const ObScale FLOATING_SCALE = 72; // 8 valid digits static const int64_t MAX_INTEGER_EXP = 14; // {9.999...999,count=38}e134 14*9-1=134 @@ -1331,27 +1335,27 @@ class ObDivArray final // small-eidian storage /* - * knuth algorithm 除法步骤: - * 给定非负整数(b进制) u[m+n-1 .. 0] 和 v[n-1 .. 0],其中 v[n-1]!=0 且 n>1 - * 计算b进制的 商|_u/v_| = q[m..0] 和 余数u mod v = r[n-1 .. 0] + * knuth algorithm division steps: + * given non-negative integer (b-based) u[m+n-1 .. 0] and v[n-1 .. 0], where v[n-1]!=0 and n>1 + * calculate b-based quotient |_u/v_| = q[m..0] and remainder u mod v = r[n-1 .. 0] * - * D1. [规格化] - * 对 u 和 v 同时乘以 d 满足 v[n-1]*d >= b/2,这里取 d = |_b / (v[n-1] + 1)_| - * 这样计算出来的 q 是不变的,余数 r 需要除以 d 才能得到 - * D2. [初始化 j] - * 置 j = m - * D3. [计算 qq] - * 置 qq = |_(u[j+n] * b +u[j+n-1]) / v[n-1]_|, rr = (u[j+n] * b +u[j+n-1]) % v[n-1] - * 测试是否 qq == b 或者 qq*v[n-2] > b*rr+u[j+n-2],如果是 则qq -= 1, r += v[n-1] - * D4 & D6. [乘和减 + 往回加] + * D1. [normalization] + * multiply u and v by d such that v[n-1]*d >= b/2, here take d = |_b / (v[n-1] + 1)_| + * the calculated q remains unchanged, the remainder r needs to be divided by d to obtain + * D2. [initialize j] + * set j = m + * D3. [calculate qq] + * set qq = |_(u[j+n] * b +u[j+n-1]) / v[n-1]_|, rr = (u[j+n] * b +u[j+n-1]) % v[n-1] + * test whether qq == b or qq*v[n-2] > b*rr+u[j+n-2], if so then qq -= 1, r += v[n-1] + * D4 & D6. [multiply and subtract + add back] * u[j+n .. j] = u[j+n .. j] - qq * v[n-1 .. 0] - * 如果 u 为负数,将当前位置加上 v 且置 qq -= 1 - * D5. [测试余数] + * if u is negative, add v at the current position and set qq -= 1 + * D5. [test remainder] * q[j] = q - * D7. [对 j 进行循环] - * j -= 1, 如果 j >= 0 返回到 D3 - * D8. [不规格化] - * q[m .. 0] 就是所求商,所求余数为 u[n-1..0] / d + * D7. [loop on j] + * j -= 1, if j >= 0 return to D3 + * D8. [denormalization] + * q[m .. 0] is the desired quotient, the desired remainder is u[n-1..0] / d */ void knuth_div_v2(ObDivArray &a, ObDivArray &b, ObDivArray &q, ObDivArray &r) { int n = b.len_; @@ -1403,7 +1407,7 @@ class ObDivArray final // small-eidian storage // printf("\nround %d-%lld %lld %lld %lld %lld\n",j, qq, rr, tmp_value, *aptr, *(aptr - 1)); // q.print(); // Optimization. - // 如果当前余数为 0 并且后面被除数都是 0, 说明当前已经整除,剩余商都是 0 + // If the current remainder is 0 and all subsequent divisors are 0, it indicates that the current division is exact, and the remaining quotient is all 0 // if (rr == 0 && j > 0 && (j + n - 2) <= zerotag) { // --j; // while (j >= 0) { @@ -1903,7 +1907,7 @@ int ObNumber::abs_compare_sys(const uint64_t &other, int64_t exp) const } default : cmp = -1; } */ - // 首先判断值是否number值是否超过uint值域,不超过,则将uint转换为number,直接进行比较操作 + // First determine if the number value exceeds the uint range, if not, convert uint to number and perform direct comparison operation int64_t exp_u = (other >= BASE2) ? 2 : (other >= BASE) ? 1 : 0; if (exp != exp_u) { cmp = exp > exp_u ? 1 : -1; @@ -1953,7 +1957,7 @@ int ObNumber::is_in_uint(int64_t exp, bool &is_uint, uint64_t &num) const if (len > 0) { num = num * BASE + digits_[i]; } else { - num = num * BASE ; //超过digits的长度,最后应该补零 + num = num * BASE ; //exceeds the length of digits, it should be padded with zeros at the end } } } @@ -1975,7 +1979,7 @@ int ObNumber::compare(const int64_t &other) const cmp = (other < 0) ? 1 : ((0 == other) ? 0 : -1); } else { if (is_negative()) { - //这里处理int64_t最小值问题 + // Here processing int64_t minimum value issue cmp = (other >= 0) ? -1 : - abs_compare_sys(static_cast((other + 1)* (-1)) + static_cast(1), EXP_ZERO - d_.exp_); } else { @@ -3222,7 +3226,7 @@ OB_INLINE int64_t ObNumber::get_number_length(const ObNumber::Desc &desc) OB_INLINE void ObNumber::assign(const uint32_t desc, uint32_t *digits) { - //不用检查digits是否为null, 0就是null + //Do not check if digits is null, 0 represents null d_.desc_ = desc; digits_ = digits; } @@ -3559,14 +3563,14 @@ OB_INLINE bool ObNumber::try_fast_minus(ObNumber &l_num, ObNumber &r_num, class ObNumberCalc { -/* 用法说明:计算 res = (v0 + v1 - v2) * v3 +/* Usage instructions: calculate res = (v0 + v1 - v2) * v3 ObNumber res; ObNumberCalc calc(v0, allocator); if (OB_FAIL(ctx.add(v1).sub(v2).mul(v3).get_result(res))) { LOG_WARN("fail calc value", K(ret)); } - 内存说明: 无论是否参与过运算,res 使用 allocator 分配的内存 + Memory instructions: Regardless of whether it has participated in the calculation, res uses memory allocated by allocator */ public: ObNumberCalc(const ObNumber &init_v, common::ObIAllocator &allocator) @@ -3630,16 +3634,16 @@ class ObNumberCalc int get_result(ObNumber &res) { if (common::OB_SUCCESS == last_ret_) { - res.shadow_copy(res_); // 浅拷贝,引用 allocator 中内存 + res.shadow_copy(res_); // shallow copy, reference memory in allocator } return last_ret_; } private: int last_ret_; ObNumber res_; - // TODO: 这里内存还可以继续优化,最多只需要使用 2 个定长 buffer 就可以 - // 完成所有串联运算,而不需要每次运算都从 allocator 新分配一个 buffer - // 考虑到一般场景下运算的操作数个数较少,暂不做这个优化 + // TODO: Here memory can still be optimized, only 2 fixed-length buffers are needed at most + // Complete all concatenation operations without allocating a new buffer from the allocator each time + // Considering that the number of operands in general scenarios is relatively small, this optimization is not done for now common::ObIAllocator &allocator_; }; diff --git a/deps/oblib/src/lib/ob_abort.cpp b/deps/oblib/src/lib/ob_abort.cpp index 27b691a07..351948f0f 100644 --- a/deps/oblib/src/lib/ob_abort.cpp +++ b/deps/oblib/src/lib/ob_abort.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_abort.h" diff --git a/deps/oblib/src/lib/ob_abort.h b/deps/oblib/src/lib/ob_abort.h index b7905a639..e68b6509b 100644 --- a/deps/oblib/src/lib/ob_abort.h +++ b/deps/oblib/src/lib/ob_abort.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_ABORT_H_ diff --git a/deps/oblib/src/lib/ob_date_unit_type.cpp b/deps/oblib/src/lib/ob_date_unit_type.cpp index 3b65a9df2..850fe3638 100644 --- a/deps/oblib/src/lib/ob_date_unit_type.cpp +++ b/deps/oblib/src/lib/ob_date_unit_type.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/src/lib/ob_date_unit_type.h b/deps/oblib/src/lib/ob_date_unit_type.h index 52912144b..d3cd83525 100644 --- a/deps/oblib/src/lib/ob_date_unit_type.h +++ b/deps/oblib/src/lib/ob_date_unit_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEANBASE_COMMON_DATE_UNIT_TYPE_H_ diff --git a/deps/oblib/src/lib/ob_define.cpp b/deps/oblib/src/lib/ob_define.cpp index f067782aa..f329ce7f3 100644 --- a/deps/oblib/src/lib/ob_define.cpp +++ b/deps/oblib/src/lib/ob_define.cpp @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/ob_define.h" -__thread uint64_t tl_thread_tenant_id = oceanbase::common::OB_SERVER_TENANT_ID; \ No newline at end of file +__thread uint64_t tl_thread_tenant_id = oceanbase::common::OB_SERVER_TENANT_ID; diff --git a/deps/oblib/src/lib/ob_define.h b/deps/oblib/src/lib/ob_define.h index bef93f663..ba2085770 100644 --- a/deps/oblib/src/lib/ob_define.h +++ b/deps/oblib/src/lib/ob_define.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_DEFINE_H_ @@ -720,6 +724,8 @@ const char *const OB_VEC_KEY_COLUMN_NAME_PREFIX = "__key"; const char *const OB_VEC_DATA_COLUMN_NAME_PREFIX = "__data"; const char *const OB_VEC_SPIV_DIM_COLUMN_NAME_PREFIX = "__spiv_dim"; const char *const OB_VEC_SPIV_VALUE_COLUMN_NAME_PREFIX = "__spiv_value"; +const char *const OB_HYBRID_VEC_CHUNK_VALUE_COLUMN_NAME_PREFIX = "__chunk"; +const char *const OB_HYBRID_VEC_EMBEDDED_VECTOR_COLUMN_NAME_PREFIX = "__embedded_vector"; const char *const OB_VEC_IVF_CENTER_ID_COLUMN_NAME_PREFIX = "__ivf_center_id"; const char *const OB_VEC_IVF_CENTER_VECTOR_COLUMN_NAME_PREFIX = "__ivf_center_vector"; @@ -1172,7 +1178,7 @@ OB_INLINE bool is_sys_index_table(const uint64_t tid) return (tid > OB_MIN_SYS_TABLE_INDEX_ID) && (tid < OB_MAX_SYS_TABLE_INDEX_ID); } -// This function includes core table and its index、lob table +// This function includes core table and its index, lob table OB_INLINE bool is_core_table(const uint64_t tid) { return (tid > OB_INVALID_OBJECT_ID && tid < OB_MAX_CORE_TABLE_ID) @@ -1180,7 +1186,7 @@ OB_INLINE bool is_core_table(const uint64_t tid) || is_core_lob_table(tid); } -// This function includes system table and its index、lob table +// This function includes system table and its index, lob table OB_INLINE bool is_sys_table(const uint64_t tid) { return is_system_table(tid) @@ -2048,7 +2054,7 @@ const int64_t OB_ORACLE_SCALE_FOR_NUMBER = -127; const int64_t HARD_CODE_SCHEMA_VERSION_BEGIN = 1 << 17; #define NUMBER_SCALE_UNKNOWN_YET (lib::is_oracle_mode() ? ORA_NUMBER_SCALE_UNKNOWN_YET: SCALE_UNKNOWN_YET) -//TDE相关参数 +//TDE related parameters const int64_t MAX_ENCRYPTION_SECRET_LENGTH = 256; const int64_t MAX_DECRYPTION_SECRET_LENGTH = 256; const int64_t MAX_ENCRYPTION_ALGORITHM_LENGTH = 256; diff --git a/deps/oblib/src/lib/ob_errno.h b/deps/oblib/src/lib/ob_errno.h index 322ac204a..754ddbe75 100644 --- a/deps/oblib/src/lib/ob_errno.h +++ b/deps/oblib/src/lib/ob_errno.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ // DO NOT EDIT. This file is automatically generated from ob_errno.def. diff --git a/deps/oblib/src/lib/ob_lib_config.cpp b/deps/oblib/src/lib/ob_lib_config.cpp index 4ff195059..0f2caae6c 100644 --- a/deps/oblib/src/lib/ob_lib_config.cpp +++ b/deps/oblib/src/lib/ob_lib_config.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_lib_config.h" diff --git a/deps/oblib/src/lib/ob_lib_config.h b/deps/oblib/src/lib/ob_lib_config.h index 5d720845d..9f5f4115e 100644 --- a/deps/oblib/src/lib/ob_lib_config.h +++ b/deps/oblib/src/lib/ob_lib_config.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_LIB_CONFIG_H_ diff --git a/deps/oblib/src/lib/ob_name_def.h b/deps/oblib/src/lib/ob_name_def.h index 473a7354f..cc9f8acfa 100644 --- a/deps/oblib/src/lib/ob_name_def.h +++ b/deps/oblib/src/lib/ob_name_def.h @@ -1,20 +1,24 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_NAME_DEF_H_ #define OCEANBASE_LIB_OB_NAME_DEF_H_ // define common names to be used in logs (e.g. to_string, databuff_xxx and ObPhyOperator::to_string) -// 名字不区分单复数,都用单数名词 +// Name does not distinguish between singular and plural, use singular noun #define N_NULL "null" #define N_TRUE "true" #define N_FALSE "false" @@ -399,9 +403,15 @@ #define N_VECTOR_INNER_PRODUCT "inner_product" #define N_VECTOR_NEGATIVE_INNER_PRODUCT "negative_inner_product" #define N_VECTOR_COS_DISTANCE "cosine_distance" +#define N_SEMANTIC_DISTANCE "semantic_distance" +#define N_SEMANTIC_VECTOR_DISTANCE "semantic_vector_distance" #define N_VECTOR_DIMS "vector_dims" #define N_VECTOR_NORM "vector_norm" #define N_VECTOR_DISTANCE "vector_distance" +#define N_VECTOR_L2_SIMILARITY "l2_similarity" +#define N_VECTOR_COS_SIMILARITY "cosine_similarity" +#define N_VECTOR_INNER_PRODUCT_SIMILARITY "inner_product_similarity" +#define N_VECTOR_SIMILARITY "vector_similarity" #define N_XOR "^" #define N_ROWEQ "row_eq" #define N_ROWLE "row_le" @@ -810,6 +820,8 @@ #define N_VEC_SCN "vec_scn" #define N_VEC_KEY "vec_key" #define N_VEC_DATA "vec_data" +#define N_VEC_CHUNK "vec_chunk" +#define N_EMBEDDED_VEC "embedded_vec" #define N_SPIV_DIM "spiv_dim" #define N_SPIV_VALUE "spiv_value" @@ -1248,4 +1260,8 @@ #define N_INNER_INFO_COLS_DATA_TYPE_PRINTER "inner_info_cols_data_type_printer" #define N_INNER_INFO_COLS_COLUMN_TYPE_PRINTER "inner_info_cols_column_type_printer" #define N_INNER_INFO_COLS_COLUMN_KEY_PRINTER "inner_info_cols_column_key_printer" +#define N_AI_COMPLETE "ai_complete" +#define N_AI_EMBED "ai_embed" +#define N_AI_RERANK "ai_rerank" +#define N_AI_PROMPT "ai_prompt" #endif //OCEANBASE_LIB_OB_NAME_DEF_H_ diff --git a/deps/oblib/src/lib/ob_name_id_def.cpp b/deps/oblib/src/lib/ob_name_id_def.cpp index 40108ff30..c83a70a7f 100644 --- a/deps/oblib/src/lib/ob_name_id_def.cpp +++ b/deps/oblib/src/lib/ob_name_id_def.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/ob_name_id_def.h" diff --git a/deps/oblib/src/lib/ob_name_id_def.h b/deps/oblib/src/lib/ob_name_id_def.h index 6bb2678f2..e6ea0851e 100644 --- a/deps/oblib/src/lib/ob_name_id_def.h +++ b/deps/oblib/src/lib/ob_name_id_def.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef DEF_NAME diff --git a/deps/oblib/src/lib/ob_replica_define.cpp b/deps/oblib/src/lib/ob_replica_define.cpp index 575443fff..3abaa47ae 100644 --- a/deps/oblib/src/lib/ob_replica_define.cpp +++ b/deps/oblib/src/lib/ob_replica_define.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_replica_define.h" diff --git a/deps/oblib/src/lib/ob_replica_define.h b/deps/oblib/src/lib/ob_replica_define.h index 2642d73a6..c7247c6c5 100644 --- a/deps/oblib/src/lib/ob_replica_define.h +++ b/deps/oblib/src/lib/ob_replica_define.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_LIB_REPLICA_DEFINE_H_ diff --git a/deps/oblib/src/lib/ob_running_mode.cpp b/deps/oblib/src/lib/ob_running_mode.cpp index c06bff8de..617b52b14 100644 --- a/deps/oblib/src/lib/ob_running_mode.cpp +++ b/deps/oblib/src/lib/ob_running_mode.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/ob_running_mode.h b/deps/oblib/src/lib/ob_running_mode.h index 66de518d9..74e7e3fae 100644 --- a/deps/oblib/src/lib/ob_running_mode.h +++ b/deps/oblib/src/lib/ob_running_mode.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_RUNNING_MODE_H_ diff --git a/deps/oblib/src/lib/objectpool/ob_concurrency_objpool.h b/deps/oblib/src/lib/objectpool/ob_concurrency_objpool.h index 83f240186..799fd4dcb 100644 --- a/deps/oblib/src/lib/objectpool/ob_concurrency_objpool.h +++ b/deps/oblib/src/lib/objectpool/ob_concurrency_objpool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_LIB_CONCURRENCY_OBJPOOL_H_ diff --git a/deps/oblib/src/lib/objectpool/ob_global_factory.h b/deps/oblib/src/lib/objectpool/ob_global_factory.h index 2e820504c..be5712c7b 100644 --- a/deps/oblib/src/lib/objectpool/ob_global_factory.h +++ b/deps/oblib/src/lib/objectpool/ob_global_factory.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LIB_OBJECTPOOL_OB_GLOBAL_FACTORY_ diff --git a/deps/oblib/src/lib/objectpool/ob_pool.h b/deps/oblib/src/lib/objectpool/ob_pool.h index c9b5e6179..f2b1b5336 100644 --- a/deps/oblib/src/lib/objectpool/ob_pool.h +++ b/deps/oblib/src/lib/objectpool/ob_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LIB_OBJECTPOOL_OB_POOL_ diff --git a/deps/oblib/src/lib/objectpool/ob_pool.ipp b/deps/oblib/src/lib/objectpool/ob_pool.ipp index f152628e2..bcc912ef8 100644 --- a/deps/oblib/src/lib/objectpool/ob_pool.ipp +++ b/deps/oblib/src/lib/objectpool/ob_pool.ipp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/atomic/ob_atomic.h" diff --git a/deps/oblib/src/lib/objectpool/ob_resource_pool.h b/deps/oblib/src/lib/objectpool/ob_resource_pool.h index e42cca763..3530e6533 100644 --- a/deps/oblib/src/lib/objectpool/ob_resource_pool.h +++ b/deps/oblib/src/lib/objectpool/ob_resource_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_UPDATESERVER_RESOURCE_POOL_H_ diff --git a/deps/oblib/src/lib/objectpool/ob_server_object_pool.cpp b/deps/oblib/src/lib/objectpool/ob_server_object_pool.cpp index d95d854ab..a00608f63 100644 --- a/deps/oblib/src/lib/objectpool/ob_server_object_pool.cpp +++ b/deps/oblib/src/lib/objectpool/ob_server_object_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_server_object_pool.h" diff --git a/deps/oblib/src/lib/objectpool/ob_server_object_pool.h b/deps/oblib/src/lib/objectpool/ob_server_object_pool.h index 0aab00683..b06256ab6 100644 --- a/deps/oblib/src/lib/objectpool/ob_server_object_pool.h +++ b/deps/oblib/src/lib/objectpool/ob_server_object_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_SERVER_OBJECT_POOL_H_ @@ -15,17 +19,17 @@ /***************************************************************************** - * 全局对象缓存池,每个类型独立的缓存池。 - * 共核数 2 倍的缓存队列,线程根据线程 ID 映射到缓存队列上。 + * Global object cache pool, each type has its independent cache pool. + * Cache queues are twice the number of cores, threads map to cache queues based on thread ID. * - * sop_borrow(type) 用于获取一个对象 - * sop_return(type, ptr) 归还一个对象 + * sop_borrow(type) is used to obtain an object + * sop_return(type, ptr) returns an object * - * sop_borrow(type) 等价于 ObServerObjectPool::get_instance().borrow_object() - * sop_return(type, ptr) 等价于 ObServerObjectPool::get_instance().return_object(ptr) + * sop_borrow(type) is equivalent to ObServerObjectPool::get_instance().borrow_object() + * sop_return(type, ptr) is equivalent to ObServerObjectPool::get_instance().return_object(ptr) * - * 通过虚拟表 __all_virtual_server_object_pool 可以查看所有对象缓存池的每个缓存队列的信息, - * 虚拟表每列的含义参考 ObPoolArenaHead 里每个属性的注释 + * The virtual table __all_virtual_server_object_pool can be used to view information about each cache queue of all object cache pools, + * the meaning of each column in the virtual table refers to the comments of each attribute in ObPoolArenaHead * *****************************************************************************/ @@ -89,12 +93,12 @@ struct ObPoolArenaHead }; /** - * ObServerObjectPool 是全局单例,用于缓存 Object,主要用处是缓存构造和析构代价大的大对象。 - * 此类会缓存对象,使用核数乘以 2 个数的缓存链表。 + * ObServerObjectPool is a global singleton used to cache Objects, mainly used for caching large objects with high construction and destruction costs. + * This class caches objects, using a number of cache linked lists equal to the number of cores multiplied by 2. * - * 接口: - * borrow_object: 获取对象 - * return_object: 归还对象 + * Interfaces: + * borrow_object: acquire object + * return_object: return object */ template class ObServerObjectPool @@ -167,11 +171,11 @@ class ObServerObjectPool } /** - * 粗暴的在 Pool 构造时给每个入口分配 16 个可用的对象 - * 内存直接根据总大小一次性 ob_malloc 出来 - * 所有对象塞到各个入口中 - * 因为是全局单例,所以是在程序启动时机完成了这些工作 - * TODO: 改为按需分配 + * Brutally allocate 16 available objects for each entry at Pool construction time + * Memory is directly allocated in one go using ob_malloc based on the total size + * All objects are placed into their respective entries + * Since it is a global singleton, this work is completed at program startup + * TODO: Change to on-demand allocation */ ObServerObjectPool(const int64_t tenant_id, const bool regist, const bool is_mini_mode, const int64_t cpu_count) diff --git a/deps/oblib/src/lib/objectpool/ob_small_obj_pool.h b/deps/oblib/src/lib/objectpool/ob_small_obj_pool.h index 40ee84296..bef5a9cd9 100644 --- a/deps/oblib/src/lib/objectpool/ob_small_obj_pool.h +++ b/deps/oblib/src/lib/objectpool/ob_small_obj_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OBJPOOL_OB_SMALL_OBJ_POOL_H__ diff --git a/deps/oblib/src/lib/objectpool/ob_tc_factory.h b/deps/oblib/src/lib/objectpool/ob_tc_factory.h index f2bb4b3dc..c328e2df6 100644 --- a/deps/oblib/src/lib/objectpool/ob_tc_factory.h +++ b/deps/oblib/src/lib/objectpool/ob_tc_factory.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LIB_OBJECTPOOL_OB_TC_FACTORY_ diff --git a/deps/oblib/src/lib/oblog/ob_async_log_struct.cpp b/deps/oblib/src/lib/oblog/ob_async_log_struct.cpp index 76598eb86..390a8b5ea 100644 --- a/deps/oblib/src/lib/oblog/ob_async_log_struct.cpp +++ b/deps/oblib/src/lib/oblog/ob_async_log_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_async_log_struct.h" @@ -26,22 +30,20 @@ ObPLogItem::ObPLogItem() } ObPLogFileStruct::ObPLogFileStruct() - : fd_(STDERR_FILENO), wf_fd_(STDERR_FILENO), write_count_(0), write_size_(0), + : fd_(STDERR_FILENO), write_count_(0), write_size_(0), file_size_(0) { filename_[0] = '\0'; MEMSET(&stat_, 0, sizeof(stat_)); - MEMSET(&wf_stat_, 0, sizeof(wf_stat_)); } -int ObPLogFileStruct::open(const char *file_name, const bool open_wf_flag, const bool redirect_flag) +int ObPLogFileStruct::open(const char *file_name, const bool redirect_flag) { int ret = OB_SUCCESS; size_t fname_len = 0; if (OB_ISNULL(file_name)) { LOG_STDERR("invalid argument log_file = %p\n", file_name); ret = OB_INVALID_ARGUMENT; - //need care .wf.?? } else if (OB_UNLIKELY((fname_len = strlen(file_name)) > MAX_LOG_FILE_NAME_SIZE - 5)) { LOG_STDERR("fname' size is overflow, log_file = %p\n", file_name); ret = OB_SIZE_OVERFLOW; @@ -53,8 +55,6 @@ int ObPLogFileStruct::open(const char *file_name, const bool open_wf_flag, const filename_[fname_len] = '\0'; if (OB_FAIL(reopen(redirect_flag))) { LOG_STDERR("reopen error, ret= %d\n", ret); - } else if (open_wf_flag && OB_FAIL(reopen_wf())) { - LOG_STDERR("reopen_wf error, ret= %d\n", ret); } } return ret; @@ -100,36 +100,6 @@ int ObPLogFileStruct::reopen(const bool redirect_flag) return ret; } -int ObPLogFileStruct::reopen_wf() -{ - int ret = OB_SUCCESS; - int32_t tmp_fd = -1; - if (OB_UNLIKELY(strlen(filename_) <= 0)) { - LOG_STDERR("invalid argument log_file = %p\n", filename_); - ret = OB_INVALID_ARGUMENT; - } else { - char tmp_file_name[MAX_LOG_FILE_NAME_SIZE]; - (void)snprintf(tmp_file_name, sizeof(tmp_file_name), "%s.wf", filename_); - if (OB_UNLIKELY((tmp_fd = ::open(tmp_file_name, O_WRONLY | O_CREAT | O_APPEND | O_CLOEXEC, LOG_FILE_MODE)) < 0)) { - LOG_STDERR("open file = %s errno = %d error = %m\n", tmp_file_name, errno); - ret = OB_ERR_UNEXPECTED; - } else if (OB_UNLIKELY(0 != fstat(tmp_fd, &wf_stat_))) { - LOG_STDERR("fstat file = %s error\n", tmp_file_name); - ret = OB_ERR_UNEXPECTED; - (void)close(tmp_fd); - tmp_fd = -1; - } else { - if (wf_fd_ > STDERR_FILENO) { - (void)dup2(tmp_fd, wf_fd_); - (void)close(tmp_fd); - } else { - wf_fd_ = tmp_fd; - } - } - } - return ret; -} - int ObPLogFileStruct::close_all() { int ret = OB_SUCCESS; @@ -137,10 +107,6 @@ int ObPLogFileStruct::close_all() (void)close(fd_); fd_ = STDERR_FILENO; } - if (wf_fd_ > STDERR_FILENO) { - (void)close(wf_fd_); - wf_fd_ = STDERR_FILENO; - } return ret; } diff --git a/deps/oblib/src/lib/oblog/ob_async_log_struct.h b/deps/oblib/src/lib/oblog/ob_async_log_struct.h index 2cc8e629f..a1b2207cd 100644 --- a/deps/oblib/src/lib/oblog/ob_async_log_struct.h +++ b/deps/oblib/src/lib/oblog/ob_async_log_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_ASYNC_LOG_STRUCT_ @@ -32,8 +36,6 @@ namespace common { enum ObPLogFDType { FD_SVR_FILE = 0, - FD_RS_FILE, - FD_ELEC_FILE, FD_TRACE_FILE, FD_AUDIT_FILE, FD_ALERT_FILE, @@ -76,7 +78,6 @@ class ObPLogItem : public ObIBaseLogItem } ObPLogFDType get_fd_type() const { return fd_type_; } void set_fd_type(const ObPLogFDType fd_type) { fd_type_ = fd_type;} - bool is_elec_file() const { return FD_ELEC_FILE == fd_type_; } bool is_trace_file() const { return FD_TRACE_FILE == fd_type_; } bool is_supported_file() const { return MAX_FD_FILE != fd_type_; } bool is_audit_file() const { return FD_AUDIT_FILE == fd_type_; } @@ -102,9 +103,8 @@ class ObPLogFileStruct public: ObPLogFileStruct(); virtual ~ObPLogFileStruct() { close_all(); } - int open(const char *log_file, const bool open_wf_flag, const bool redirect_flag); + int open(const char *log_file, const bool redirect_flag); int reopen(const bool redirect_flag); - int reopen_wf(); int close_all(); bool is_opened() { return fd_ > STDERR_FILENO; } int64_t get_write_size() const { return write_size_; } @@ -114,12 +114,10 @@ class ObPLogFileStruct char filename_[MAX_LOG_FILE_NAME_SIZE]; int32_t fd_;//descriptor of log-file - int32_t wf_fd_;//descriptor of warning log-file uint32_t write_count_; int64_t write_size_; int64_t file_size_; struct stat stat_; - struct stat wf_stat_; }; } // common diff --git a/deps/oblib/src/lib/oblog/ob_base_log_buffer.cpp b/deps/oblib/src/lib/oblog/ob_base_log_buffer.cpp index 6b4980447..12b1869d6 100644 --- a/deps/oblib/src/lib/oblog/ob_base_log_buffer.cpp +++ b/deps/oblib/src/lib/oblog/ob_base_log_buffer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_base_log_buffer.h" diff --git a/deps/oblib/src/lib/oblog/ob_base_log_buffer.h b/deps/oblib/src/lib/oblog/ob_base_log_buffer.h index a60a4ad7e..3e9d3df6d 100644 --- a/deps/oblib/src/lib/oblog/ob_base_log_buffer.h +++ b/deps/oblib/src/lib/oblog/ob_base_log_buffer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_BASE_LOG_BUFFER_H_ diff --git a/deps/oblib/src/lib/oblog/ob_base_log_writer.cpp b/deps/oblib/src/lib/oblog/ob_base_log_writer.cpp index 0740cc526..a2fdf1e21 100644 --- a/deps/oblib/src/lib/oblog/ob_base_log_writer.cpp +++ b/deps/oblib/src/lib/oblog/ob_base_log_writer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_base_log_writer.h" @@ -78,7 +82,7 @@ int ObBaseLogWriter::init( thread_name_ = thread_name; if (OB_SUCC(ret)) { is_inited_ = true; - LOG_STDOUT("successfully init ObBaseLogWriter\n"); + LOG_STDOUT("successfully init log writer\n"); } } @@ -268,7 +272,7 @@ void ObBaseLogWriter::flush_log() while (!has_stopped_) { IGNORE_RETURN lib::Thread::update_loop_ts(ObTimeUtility::fast_current_time()); pthread_mutex_lock(&thread_mutex_); - // 每个线程执行16次再重新抢占, 对cpu cache hit有利 + // Each thread executes 16 times before re-preempting, which is beneficial for CPU cache hit for (int64_t i = 0; i < 16; i++) { do_flush_log(); } diff --git a/deps/oblib/src/lib/oblog/ob_base_log_writer.h b/deps/oblib/src/lib/oblog/ob_base_log_writer.h index 746a611df..b1a4d8ed1 100644 --- a/deps/oblib/src/lib/oblog/ob_base_log_writer.h +++ b/deps/oblib/src/lib/oblog/ob_base_log_writer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_BASE_LOG_WRITER_H_ diff --git a/deps/oblib/src/lib/oblog/ob_easy_log.h b/deps/oblib/src/lib/oblog/ob_easy_log.h index 1b9f8c353..486558aae 100644 --- a/deps/oblib/src/lib/oblog/ob_easy_log.h +++ b/deps/oblib/src/lib/oblog/ob_easy_log.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_EASY_LOG_H diff --git a/deps/oblib/src/lib/oblog/ob_log.cpp b/deps/oblib/src/lib/oblog/ob_log.cpp index b7435309d..7ac105c46 100644 --- a/deps/oblib/src/lib/oblog/ob_log.cpp +++ b/deps/oblib/src/lib/oblog/ob_log.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -66,16 +70,9 @@ static const int64_t POP_COMPENSATED_TIME[5] = {0, 1, 2, 3, 4};//for pop timeout ObPLogFDType get_fd_type(const char *mod_name) { ObPLogFDType type = FD_SVR_FILE; - static const size_t RS_MODULE_LEN = strlen("[RS"); - static const size_t ELEC_MODULE_LEN = strlen("[ELECT"); static const size_t FLT_MODULE_LEN = strlen("[FLT"); if (0 == STRNCMP(mod_name, "[FLT", FLT_MODULE_LEN)) { type = FD_TRACE_FILE; - } else if (ObThreadFlags::is_rs_thread() - || 0 == STRNCMP(mod_name, "[RS", RS_MODULE_LEN)) { - type = FD_RS_FILE; - } else if (0 == STRNCMP(mod_name, "[ELECT", ELEC_MODULE_LEN)) { - type = FD_ELEC_FILE; } return type; } @@ -463,7 +460,7 @@ void ObLogger::print_trace_buffer(const char* mod_name, pos += len; return OB_SUCCESS; }; - // invoke log_it isn't workable,that will recycle infinitely + // invoke log_it isn't workable, that will recycle infinitely do_log_message(is_async_log_used(), mod_name, nullptr, level, file, line, function, false, 0, log_data_func); tb->reset();//reset, than reuse the TraceBuffer @@ -476,9 +473,9 @@ const char *const ObLogger::errstr_[] = {"ERROR", "WARN", "INFO", "EDIAG", "WDIA ObLogger::ObLogger() : ObBaseLogWriter(), log_file_(), max_file_size_(DEFAULT_MAX_FILE_SIZE), max_file_index_(0), - name_id_map_(), id_level_map_(), wf_level_(OB_LOG_LEVEL_DBA_WARN), alert_log_level_(OB_LOG_LEVEL_DBA_INFO), level_version_(0), - disable_thread_log_level_(false), force_check_(false), redirect_flag_(false), open_wf_flag_(false), - enable_wf_flag_(false), rec_old_file_flag_(false), can_print_(true), + name_id_map_(), id_level_map_(), alert_log_level_(OB_LOG_LEVEL_DBA_INFO), level_version_(0), + disable_thread_log_level_(false), force_check_(false), redirect_flag_(false), + can_print_(true), enable_async_log_(true), use_multi_flush_(false), stop_append_log_(false), enable_perf_mode_(false), last_async_flush_count_per_sec_(0), log_mem_limiter_(nullptr), allocator_(nullptr), error_allocator_(nullptr), log_compressor_(nullptr), enable_log_limit_(true), @@ -546,7 +543,7 @@ void ObLogger::set_trace_mode(bool trace_mode) get_trace_buffer()->reset(); } -void ObLogger::set_log_level(const char *level, const char *wf_level, int64_t version) +void ObLogger::set_log_level(const char *level, int64_t version) { int ret = OB_SUCCESS; if (check_and_set_level_version(version)) { @@ -556,13 +553,6 @@ void ObLogger::set_log_level(const char *level, const char *wf_level, int64_t ve set_log_level(level_int); } } - - if (NULL != wf_level) { - int8_t level_int = OB_LOG_LEVEL_INFO; - if (OB_SUCC(level_str2int(wf_level, level_int))) { - wf_level_ = level_int; - } - } } } @@ -592,30 +582,13 @@ void ObLogger::set_alert_log_level(const char *level, int64_t version) void ObLogger::set_file_name(const char *filename, const bool no_redirect_flag, - const bool open_wf, - const char *rs_filename, - const char *elec_filename, - const char *trace_filename, - const char *alert_filename) + const bool unused) { int ret = OB_SUCCESS; redirect_flag_ = !no_redirect_flag; - //open wf file - open_wf_flag_ = open_wf; - enable_wf_flag_ = open_wf; - if (OB_FAIL(log_file_[FD_SVR_FILE].open(filename, open_wf, redirect_flag_)) + if (OB_FAIL(log_file_[FD_SVR_FILE].open(filename, redirect_flag_)) && OB_FAIL(log_new_file_info(log_file_[FD_SVR_FILE]))) { LOG_STDERR("fail to open log_file = %p, ret=%d\n", filename, ret); - } else if (NULL != rs_filename && OB_FAIL(log_file_[FD_RS_FILE].open(rs_filename, open_wf, false)) - && OB_FAIL(log_new_file_info(log_file_[FD_RS_FILE]))) { - LOG_STDERR("fail to open log_file = %p, ret=%d\n", rs_filename, ret); - } else if (NULL != elec_filename && OB_FAIL(log_file_[FD_ELEC_FILE].open(elec_filename, open_wf, false)) - && OB_FAIL(log_new_file_info(log_file_[FD_ELEC_FILE]))) { - LOG_STDERR("fail to open log_file = %p, ret=%d\n", elec_filename, ret); - } else if (NULL != trace_filename && OB_FAIL(log_file_[FD_TRACE_FILE].open(trace_filename, false, false))) { - LOG_STDERR("fail to open log_file = %p, ret=%d\n", trace_filename, ret); - } else if (NULL != alert_filename && OB_FAIL(log_file_[FD_ALERT_FILE].open(alert_filename, false, false))) { - LOG_STDERR("fail to open log_file = %p, ret=%d\n", alert_filename, ret); } } @@ -757,9 +730,9 @@ void ObLogger::rotate_log(const int64_t size, const bool redirect_flag, if (OB_LIKELY(size > 0) && max_file_size_ > 0 && log_struct.file_size_ >= max_file_size_) { if (OB_LIKELY(0 == pthread_mutex_trylock(&file_size_mutex_))) { rotate_log(log_struct.filename_, fd_type, redirect_flag, log_struct.fd_, - log_struct.wf_fd_, file_list_, wf_file_list_); + file_list_); (void)ATOMIC_SET(&log_struct.file_size_, 0); - if (fd_type <= FD_ELEC_FILE) { + if (fd_type <= FD_SVR_FILE) { (void)log_new_file_info(log_struct); } (void)pthread_mutex_unlock(&file_size_mutex_); @@ -771,21 +744,13 @@ void ObLogger::rotate_log(const char *filename, const ObPLogFDType fd_type, const bool redirect_flag, int32_t &fd, - int32_t &wf_fd, - std::deque &file_list, - std::deque &wf_file_list) + std::deque &file_list) { int ret = OB_SUCCESS; if (NULL != filename) { - char wf_filename[ObPLogFileStruct::MAX_LOG_FILE_NAME_SIZE]; - memset(wf_filename, 0, sizeof(wf_filename)); - //Need to think how to deal failure. - (void)snprintf(wf_filename, sizeof(wf_filename), "%s.wf", filename); if (access(filename, R_OK) == 0) { char old_log_file[ObPLogFileStruct::MAX_LOG_FILE_NAME_SIZE]; - char old_wf_log_file[ObPLogFileStruct::MAX_LOG_FILE_NAME_SIZE]; memset(old_log_file, 0, sizeof(old_log_file)); - memset(old_wf_log_file, 0, sizeof(old_wf_log_file)); struct timeval t; gettimeofday(&t, nullptr); struct tm tm; @@ -793,17 +758,14 @@ void ObLogger::rotate_log(const char *filename, (void)snprintf(old_log_file, sizeof(old_log_file), "%s.%04d%02d%02d%02d%02d%02d%03d", filename, tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, static_cast(t.tv_usec/1000)); - (void)snprintf(old_wf_log_file, sizeof(old_wf_log_file), "%s.%04d%02d%02d%02d%02d%02d%03d", - wf_filename, tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec, static_cast(t.tv_usec/1000)); if (max_file_index_ > 0) { if (OB_LIKELY(0 == pthread_mutex_lock(&file_index_mutex_))) { + file_list.push_back(old_log_file); if (file_list.size() >= max_file_index_) { std::string oldFile = file_list.front(); file_list.pop_front(); unlink_if_need(oldFile.c_str()); } - file_list.push_back(old_log_file); (void)pthread_mutex_unlock(&file_index_mutex_); } } @@ -828,29 +790,6 @@ void ObLogger::rotate_log(const char *filename, } } } - if (open_wf_flag_ && enable_wf_flag_ && ObPLogFDType::FD_ALERT_FILE != fd_type) { - if (max_file_index_ > 0) { - if (OB_LIKELY(0 == pthread_mutex_lock(&file_index_mutex_))) { - if (wf_file_list.size() >= max_file_index_) { - std::string old_wf_file = wf_file_list.front(); - wf_file_list.pop_front(); - unlink(old_wf_file.c_str()); - } - wf_file_list.push_back(old_wf_log_file); - (void)pthread_mutex_unlock(&file_index_mutex_); - } - } - ret = rename(wf_filename, old_wf_log_file); //If failed, TODO - tmp_fd = open(wf_filename, O_WRONLY | O_CREAT | O_APPEND | O_CLOEXEC, ObPLogFileStruct::LOG_FILE_MODE); - if (tmp_fd > 0) { - if (wf_fd > STDERR_FILENO) { - (void)dup2(tmp_fd, wf_fd); - (void)close(tmp_fd); - } else { - wf_fd = tmp_fd; - } - } - } } // awake log compressor when creating new log files if (OB_NOT_NULL(log_compressor_)) { @@ -862,14 +801,12 @@ void ObLogger::rotate_log(const char *filename, void ObLogger::check_file() { - check_file(log_file_[FD_SVR_FILE], redirect_flag_, open_wf_flag_); - check_file(log_file_[FD_RS_FILE], false, open_wf_flag_); - check_file(log_file_[FD_ELEC_FILE], false, open_wf_flag_); - check_file(log_file_[FD_TRACE_FILE], false, false); - check_file(log_file_[FD_ALERT_FILE], false, false); + check_file(log_file_[FD_SVR_FILE], redirect_flag_); + check_file(log_file_[FD_TRACE_FILE], false); + check_file(log_file_[FD_ALERT_FILE], false); } -void ObLogger::check_file(ObPLogFileStruct &log_struct, const bool redirect_flag, const bool open_wf_flag) +void ObLogger::check_file(ObPLogFileStruct &log_struct, const bool redirect_flag) { if (log_struct.is_opened()) { struct stat st_file; @@ -878,17 +815,6 @@ void ObLogger::check_file(ObPLogFileStruct &log_struct, const bool redirect_flag || (err == 0 && (st_file.st_dev != log_struct.stat_.st_dev || st_file.st_ino != log_struct.stat_.st_ino))) { log_struct.reopen(redirect_flag); } - - if (open_wf_flag) { - char wf_file_name[ObPLogFileStruct::MAX_LOG_FILE_NAME_SIZE]; - memset(wf_file_name, 0, sizeof(wf_file_name)); - (void)snprintf(wf_file_name, sizeof(wf_file_name), "%s.wf", log_struct.filename_); - err = stat(wf_file_name, &st_file); - if ((err == -1 && errno == ENOENT) - || (err == 0 && (st_file.st_dev != log_struct.wf_stat_.st_dev || st_file.st_ino != log_struct.wf_stat_.st_ino))) { - (void)log_struct.reopen_wf(); - } - } } } @@ -922,7 +848,7 @@ int ObLogger::set_max_file_index(int64_t max_file_index) max_file_index = MAX_LOG_FILE_COUNT;// 10 * 1024 } max_file_index_ = max_file_index; - if (max_file_index_ > 0 && rec_old_file_flag_) { + if (max_file_index_ > 0) { if (OB_FAIL(record_old_log_file())) { LOG_WARN("Record old log file error", K(ret)); } @@ -930,11 +856,10 @@ int ObLogger::set_max_file_index(int64_t max_file_index) return ret; } -int ObLogger::set_record_old_log_file(bool rec_old_file_flag) +int ObLogger::set_record_old_log_file() { int ret = OB_SUCCESS; - rec_old_file_flag_ = rec_old_file_flag; - if (rec_old_file_flag_ && max_file_index_ > 0) { + if (max_file_index_ > 0) { if (OB_FAIL(record_old_log_file())) { LOG_WARN("Record old log file error", K(ret)); } @@ -1277,35 +1202,34 @@ void ObLogger::log_user_error_line_column(const UserMsgLevel user_msg_level, int ObLogger::record_old_log_file() { int ret = OB_SUCCESS; - if (max_file_index_ <= 0 || !rec_old_file_flag_) { + if (max_file_index_ <= 0) { } else { int tmp_ret = OB_SUCCESS; ObSEArray files; - ObSEArray wf_files; for (int type = FD_SVR_FILE; type < FD_AUDIT_FILE; ++type) { - if (OB_TMP_FAIL(get_log_files_in_dir(log_file_[type].filename_, &files, &wf_files))) { + if (OB_TMP_FAIL(get_log_files_in_dir(log_file_[type].filename_, &files))) { OB_LOG(WARN, "Get log files in log dir error", K(ret)); } } - if (OB_TMP_FAIL(get_log_files_in_dir(log_file_[FD_ALERT_FILE].filename_, &files, &wf_files))) { + if (OB_TMP_FAIL(get_log_files_in_dir(log_file_[FD_ALERT_FILE].filename_, &files))) { OB_LOG(WARN, "Get log files in log dir error", K(ret)); } - if (OB_FAIL(add_files_to_list(&files, &wf_files, file_list_, wf_file_list_))) { + if (OB_FAIL(add_files_to_list(&files, file_list_))) { OB_LOG(WARN, "Add files to list error", K(ret)); } } return ret; } -int ObLogger::get_log_files_in_dir(const char *filename, void *files, void *wf_files) +int ObLogger::get_log_files_in_dir(const char *filename, void *files) { int ret = OB_SUCCESS; char *dirc = NULL; char *basec = NULL; regex_t uncompressed_regex; - if (OB_ISNULL(files) || OB_ISNULL(wf_files)) { + if (OB_ISNULL(files)) { ret = OB_INVALID_ARGUMENT; - OB_LOG(WARN, "Input should not be NULL", K(files), K(wf_files), K(ret)); + OB_LOG(WARN, "Input should not be NULL", K(files), K(ret)); } else if (OB_ISNULL(filename)) { ret = OB_NOT_INIT; OB_LOG(WARN, "filename has not been set", KCSTRING(filename), K(ret)); @@ -1319,20 +1243,13 @@ int ObLogger::get_log_files_in_dir(const char *filename, void *files, void *wf_f OB_LOG(ERROR, "failed to compile regex pattern", K(ret)); } else { ObIArray *files_arr = static_cast *>(files); - ObIArray *wf_files_arr = static_cast *>(wf_files); //get dir and base name char *dir_name = dirname(dirc); char *base_name = basename(basec); - //get file_prefix, wf_file_prefix, wf_file names + //get file_prefix char file_prefix[ObPLogFileStruct::MAX_LOG_FILE_NAME_SIZE]; - char wf_file_prefix[ObPLogFileStruct::MAX_LOG_FILE_NAME_SIZE]; - char wf_file[ObPLogFileStruct::MAX_LOG_FILE_NAME_SIZE]; memset(file_prefix, 0, sizeof(file_prefix)); - memset(wf_file_prefix, 0, sizeof(wf_file_prefix)); - memset(wf_file, 0, sizeof(wf_file)); (void)snprintf(file_prefix, sizeof(file_prefix), "%s.", base_name); - (void)snprintf(wf_file_prefix, sizeof(wf_file_prefix), "%s.wf.", base_name); - (void)snprintf(wf_file, sizeof(wf_file), "%s.wf", base_name); //open dir DIR *dir_pointer = opendir(dir_name); if (NULL == dir_pointer) { @@ -1348,16 +1265,7 @@ int ObLogger::get_log_files_in_dir(const char *filename, void *files, void *wf_f } while (OB_SUCC(ret) && (dir_entry = readdir(dir_pointer)) != NULL) { if (DT_DIR != dir_entry->d_type) { - if (prefix_match(wf_file_prefix, dir_entry->d_name)) { - print_len = snprintf(tmp_file.file_name_, ObPLogFileStruct::MAX_LOG_FILE_NAME_SIZE, "%s/%s", dir_name, dir_entry->d_name); - if (OB_UNLIKELY(print_len <0) || OB_UNLIKELY(print_len >= ObPLogFileStruct::MAX_LOG_FILE_NAME_SIZE)) { - //do nothing - } else if (OB_FAIL(wf_files_arr->push_back(tmp_file))) { - LOG_WARN("Add file to wf files error", K(ret)); - } else { }//do nothing - } else if (prefix_match(wf_file, dir_entry->d_name)) { - //.wf file, do nothing. - } else if (prefix_match(file_prefix, dir_entry->d_name) + if (prefix_match(file_prefix, dir_entry->d_name) && (enable_delete_compressed_file || regexec(&uncompressed_regex, dir_entry->d_name, 0, NULL, 0) == 0)) { print_len = snprintf(tmp_file.file_name_, ObPLogFileStruct::MAX_LOG_FILE_NAME_SIZE, "%s/%s", dir_name, dir_entry->d_name); if (OB_UNLIKELY(print_len <0) || OB_UNLIKELY(print_len >= ObPLogFileStruct::MAX_LOG_FILE_NAME_SIZE)) { @@ -1407,46 +1315,29 @@ int compare_log_filename_by_date_suffix(const void *v1, const void *v2) } int ObLogger::add_files_to_list(void *files, - void *wf_files, - std::deque &file_list, - std::deque &wf_file_list) + std::deque &file_list) { int ret = OB_SUCCESS; - if (OB_ISNULL(files) || OB_ISNULL(wf_files)) { + if (OB_ISNULL(files)) { ret = OB_INVALID_ARGUMENT; - OB_LOG(WARN, "Input should not be NULL", K(files), K(wf_files), K(ret)); + OB_LOG(WARN, "Input should not be NULL", K(files), K(ret)); } else { ObIArray *files_arr = static_cast *>(files); - ObIArray *wf_files_arr = static_cast *>(wf_files); //sort files if (files_arr->count() > 0) { qsort(&files_arr->at(0), files_arr->count(), sizeof(FileName), compare_log_filename_by_date_suffix); } - if (wf_files_arr->count() > 0) { - qsort(&wf_files_arr->at(0), wf_files_arr->count(), sizeof(FileName), compare_log_filename_by_date_suffix); - } - //Add to file_list if (OB_LIKELY(0 == pthread_mutex_lock(&file_index_mutex_))) { file_list.clear(); std::string oldFile; for (int64_t i = 0; OB_SUCC(ret) && i < files_arr->count(); ++i) { + file_list.push_back(files_arr->at(i).file_name_); if (file_list.size() >= max_file_index_) { oldFile = file_list.front(); file_list.pop_front(); unlink_if_need(oldFile.c_str()); } - file_list.push_back(files_arr->at(i).file_name_); - } - wf_file_list.clear(); - std::string old_wf_file; - for (int64_t i = 0; OB_SUCC(ret) && i < wf_files_arr->count(); ++i) { - if (wf_file_list.size() >= max_file_index_) { - old_wf_file = wf_file_list.front(); - wf_file_list.pop_front(); - unlink(old_wf_file.c_str()); - } - wf_file_list.push_back(wf_files_arr->at(i).file_name_); } (void)pthread_mutex_unlock(&file_index_mutex_); } @@ -1574,7 +1465,7 @@ void ObLogger::flush_logs_to_file(ObPLogItem **log_item, const int64_t count) && OB_NOT_NULL(log_item[0])) { if (log_item[0]->get_timestamp() > (last_check_disk_ts + DISK_SAMPLE_TIME)) { last_check_disk_ts = log_item[0]->get_timestamp(); - check_file(log_file_[FD_SVR_FILE], redirect_flag_, open_wf_flag_); + check_file(log_file_[FD_SVR_FILE], redirect_flag_); struct statfs disk_info; if (0 == statfs(log_file_[FD_SVR_FILE].filename_, &disk_info)) { can_print_ = ((disk_info.f_bfree * disk_info.f_bsize) > CAN_PRINT_DISK_SIZE); @@ -1591,8 +1482,6 @@ void ObLogger::flush_logs_to_file(ObPLogItem **log_item, const int64_t count) struct iovec vec[MAX_FD_FILE][GROUP_COMMIT_MAX_ITEM_COUNT]; int iovcnt[MAX_FD_FILE] = {0}; - struct iovec wf_vec[MAX_FD_FILE][GROUP_COMMIT_MAX_ITEM_COUNT]; - int wf_iovcnt[MAX_FD_FILE] = {0}; ObPLogFDType fd_type = MAX_FD_FILE; for (int64_t i = 0; i < count; ++i) { @@ -1606,11 +1495,6 @@ void ObLogger::flush_logs_to_file(ObPLogItem **log_item, const int64_t count) vec[fd_type][iovcnt[fd_type]].iov_base = log_item[i]->get_buf(); vec[fd_type][iovcnt[fd_type]].iov_len = static_cast(log_item[i]->get_data_len()); iovcnt[fd_type] += 1; - if (enable_wf_flag_ && open_wf_flag_ && log_item[i]->get_log_level() <= wf_level_ && fd_type != FD_ALERT_FILE) { - wf_vec[fd_type][wf_iovcnt[fd_type]].iov_base = log_item[i]->get_buf(); - wf_vec[fd_type][wf_iovcnt[fd_type]].iov_len = static_cast(log_item[i]->get_data_len()); - wf_iovcnt[fd_type] += 1; - } if (log_item[i]->get_tl_type() >= 0 && log_item[i]->get_tl_type() < MAX_TASK_LOG_TYPE) { (void)ATOMIC_AAF(written_count_ + log_item[i]->get_tl_type(), 1); (void)ATOMIC_AAF(current_written_count_ + log_item[i]->get_tl_type(), -1); @@ -1636,9 +1520,6 @@ void ObLogger::flush_logs_to_file(ObPLogItem **log_item, const int64_t count) EVENT_ADD(ObStatEventIds::IO_WRITE_COUNT, iovcnt[i]); EVENT_ADD(ObStatEventIds::IO_WRITE_BYTES, size); } - if (wf_iovcnt[i] > 0 && log_file_[i].wf_fd_ > 0) { - (void)::writev(log_file_[i].wf_fd_, wf_vec[i], wf_iovcnt[i]); - } } if (max_file_size_ > 0) { @@ -1864,7 +1745,7 @@ int ObLogger::log_new_file_info(const ObPLogFileStruct &log_file) { int ret = OB_SUCCESS; if (nullptr != new_file_info_ - && (log_file.fd_ > 0 || log_file.wf_fd_ > 0)) { + && (log_file.fd_ > 0)) { static const int64_t max_buf_len = 512; char buf[max_buf_len]; struct timeval tv; @@ -1881,11 +1762,6 @@ int ObLogger::log_new_file_info(const ObPLogFileStruct &log_file) ret = OB_ERR_SYS; } } - if (OB_SUCC(ret) && log_file.wf_fd_ > STDERR_FILENO) { - if (-1 == ::write(log_file.wf_fd_, buf, strlen(buf)) < 0) { - ret = OB_ERR_SYS; - } - } } return ret; } diff --git a/deps/oblib/src/lib/oblog/ob_log.h b/deps/oblib/src/lib/oblog/ob_log.h index b6f8b5a47..8244e286b 100644 --- a/deps/oblib/src/lib/oblog/ob_log.h +++ b/deps/oblib/src/lib/oblog/ob_log.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OBLOG_OB_LOG_ @@ -404,17 +408,13 @@ class ObLogger : public ObBaseLogWriter const char* function); int64_t get_write_size() const { return log_file_[FD_SVR_FILE].write_size_; } - int64_t get_rs_write_size() const { return log_file_[FD_RS_FILE].write_size_; } - int64_t get_elec_write_size() const { return log_file_[FD_ELEC_FILE].write_size_; } int64_t get_trace_write_size() const { return log_file_[FD_TRACE_FILE].write_size_; } int64_t get_alert_write_size() const { return log_file_[FD_ALERT_FILE].write_size_; } int64_t get_total_write_count() const { return log_file_[FD_SVR_FILE].write_count_; } - int64_t get_rs_total_write_count() const { return log_file_[FD_RS_FILE].write_count_; } - int64_t get_elec_total_write_count() const { return log_file_[FD_ELEC_FILE].write_count_; } int64_t get_trace_total_write_count() const { return log_file_[FD_TRACE_FILE].write_count_; } int64_t get_alert_total_write_count() const { return log_file_[FD_ALERT_FILE].write_count_; } - ObPLogFileStruct &get_elec_log() { return *(log_file_ + FD_ELEC_FILE); } + ObPLogFileStruct &get_svr_log() { return *(log_file_ + FD_SVR_FILE); } void insert_warning_buffer(const UserMsgLevel user_msg_level, const int errcode, @@ -580,24 +580,14 @@ class ObLogger : public ObBaseLogWriter //@param[in] filename The log-file's name. //@param[in] flag Whether redirect the stdout and stderr to the descriptor of the log-file. //FALSE:redirect TRUE:no redirect. - //@param[in] open_wf whether create warning log-file to store warning buffer. - //@param[in] finename of rootservice log-file's name. - //@param[in] finename of election log-file's name. void set_file_name(const char *filename, const bool no_redirect_flag = false, - const bool open_wf = false, - const char *rs_filename = NULL, - const char *elec_filename = NULL, - const char *trace_filename = NULL, - const char *alert_filename = NULL); - - //whether log warn/error log to log.wf - void set_log_warn(bool log_warn) { enable_wf_flag_ = log_warn; } + const bool unused = false); //@brief Check the log-file's status. void check_file(); //@brief Check the log-file's status. - void check_file(ObPLogFileStruct &log_struct, const bool redirect_flag, const bool open_wf_flag); + void check_file(ObPLogFileStruct &log_struct, const bool redirect_flag); //@brief Set whether checking the log-file at each message logging. //@param[in] v 1:with check, 0:without check @@ -609,7 +599,7 @@ class ObLogger : public ObBaseLogWriter int set_max_file_index(int64_t max_file_index = 0x0F); //@brief Set whether record old log file. If this flag and max_file_index set, //will record log files in the directory for log file - int set_record_old_log_file(bool rec_old_file_flag = false); + int set_record_old_log_file(); int set_log_compressor(ObLogCompressor *log_compressor); int64_t get_max_file_index() const { return max_file_index_; } @@ -623,9 +613,8 @@ class ObLogger : public ObBaseLogWriter //@brief Set global log-file's level and warning log-file's level. //@param[in] level The log-file's level. - //@param[in] wf_level The warning log-file's level. //@param[in] version The time(us) change the log level. - void set_log_level(const char *level, const char *wf_level = NULL, int64_t version = 0); + void set_log_level(const char *level, int64_t version = 0); //@brief Set global level. void set_log_level(const int32_t level, int64_t version = 0) {set_log_level(static_cast(level), version);} @@ -732,17 +721,14 @@ class ObLogger : public ObBaseLogWriter int setting_list_processing(ObLogIdLevelMap &id_level_map, void *mod_setting_list/*ObList* */); - //@brief record log files in the log directory. It's used when max_file_index and rec_old_file_flag_ set. + //@brief record log files in the log directory. It's used when max_file_index int record_old_log_file(); int get_log_files_in_dir(const char *filename, - void *files/*ObIArray * */, - void *wf_files/*ObIArray * */); + void *files/*ObIArray * */); int add_files_to_list(void *files/*ObIArray * */, - void *wf_files/*ObIArray * */, - std::deque &file_list, - std::deque &wf_file_list); + std::deque &file_list); void rotate_log(const int64_t size, const bool redirect_flag, ObPLogFileStruct &log_struct, const ObPLogFDType fd_type); @@ -751,16 +737,12 @@ class ObLogger : public ObBaseLogWriter //@param[in] fd_type. //@param[in] whether redirect, FALSE:redirect TRUE:no redirect //@param[out] after retated log, open new file_fd - //@param[out] after retated wf log, open new wf_file_fd //@param[out] add retated log file name to file list - //@param[out] add retated wf log file name to file list void rotate_log(const char *filename, const ObPLogFDType fd_type, const bool redirect_flag, int32_t &fd, - int32_t &wf_fd, - std::deque &file_list, - std::deque &wf_file_list); + std::deque &file_list); static void *async_flush_log_handler(void *arg); void flush_logs_to_file(ObPLogItem **log_item, const int64_t count); @@ -832,7 +814,6 @@ class ObLogger : public ObBaseLogWriter //log level ObLogNameIdMap name_id_map_; ObLogIdLevelMap id_level_map_;//level of log-file - int8_t wf_level_;//level of warning log-file int8_t alert_log_level_;//level of alert log-file int64_t level_version_;//version of log level @@ -844,9 +825,6 @@ class ObLogger : public ObBaseLogWriter bool force_check_;//whether check log-file at each message logging. bool redirect_flag_;//whether redirect, TRUE: redirect FALSE: no redirect. - bool open_wf_flag_;//whether open warning log-file. - bool enable_wf_flag_; //whether write waring log to wf log-file. - bool rec_old_file_flag_;//whether record old file. volatile bool can_print_;//when disk has no space, logger control bool enable_async_log_;//if false, use sync way logging @@ -879,7 +857,6 @@ class ObLogger : public ObBaseLogWriter const char *new_file_info_; bool info_as_wdiag_; std::deque file_list_;//to store the names of log-files - std::deque wf_file_list_;//to store the names of warning log-files }; inline ObLogger& ObLogger::get_logger() @@ -1366,12 +1343,8 @@ void OB_PRINT_DBA(const char *mod_name, const char *mod_name_bracket, { if (OB_LIKELY(!OB_LOGGER.get_guard())) { OB_LOGGER.get_guard() = true; - OB_LOGGER.log_message_value(mod_name, dba_event, level, file, line, function, errcode, true, - std::forward(args)...); - if (print_rd_log) { - OB_LOGGER.log_message_value(mod_name_bracket, nullptr, level, file, line, function, errcode, false, + OB_LOGGER.log_message_value(mod_name_bracket, nullptr, level, file, line, function, errcode, false, std::forward(args)...); - } OB_LOGGER.get_guard() = false; } } diff --git a/deps/oblib/src/lib/oblog/ob_log_compressor.cpp b/deps/oblib/src/lib/oblog/ob_log_compressor.cpp index 939e86206..83a4fed1d 100644 --- a/deps/oblib/src/lib/oblog/ob_log_compressor.cpp +++ b/deps/oblib/src/lib/oblog/ob_log_compressor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -65,7 +69,6 @@ int ObLogCompressor::init() LOG_ERROR("failed to init ObThreadCond", K(ret)); } else { strncpy(syslog_dir_, OB_SYSLOG_DIR, strlen(OB_SYSLOG_DIR)); - strncpy(alert_log_dir_, OB_ALERT_LOG_DIR, strlen(OB_ALERT_LOG_DIR)); stopped_ = false; if (OB_FAIL(TG_START(TGDefIDs::SYSLOG_COMPRESS))) { LOG_ERROR("failed to start log compression timer", K(ret)); @@ -215,7 +218,7 @@ bool ObLogCompressor::is_compressed_file(const char *file) void ObLogCompressor::run_timer_task() { int ret = OB_SUCCESS; - + ObSyslogFile syslog_file; char compress_files[OB_SYSLOG_COMPRESS_TYPE_COUNT][OB_MAX_SYSLOG_FILE_NAME_SIZE] = {{0}}; @@ -295,38 +298,6 @@ void ObLogCompressor::run_timer_task() closedir(dir); dir = NULL; } - if (OB_FAIL(ret)) { - // skip - } else if (OB_ISNULL(dir = opendir(alert_log_dir_))) { - ret = OB_ERR_SYS; - LOG_ERROR("failed to open alert log directory", K(ret), K(errno), K(alert_log_dir_)); - } else { - while (OB_SUCC(ret) && OB_NOT_NULL(entry = readdir(dir))) { - if (strncmp(entry->d_name, ".", 1) == 0 || strncmp(entry->d_name, "..", 2) == 0) { - continue; - } - snprintf(syslog_file.file_name_, OB_MAX_SYSLOG_FILE_NAME_SIZE, "%s/%s", alert_log_dir_, entry->d_name); - if (stat(syslog_file.file_name_, &stat_info) == -1) { - ret = OB_FILE_NOT_EXIST; - LOG_WARN("failed to get file info", K(ret), K(errno), K(syslog_file.file_name_)); - continue; - } - if (S_ISREG(stat_info.st_mode)) { - total_size += stat_info.st_size; - int64_t tmp_time = stat_info.st_mtim.tv_sec * 1000000000L + stat_info.st_mtim.tv_nsec; - syslog_file.mtime_ = tmp_time; - if (enable_delete_file - && regexec(®ex_archive_, entry->d_name, 0, NULL, 0) == 0 - && OB_FAIL(oldest_files_.push(syslog_file))) { - LOG_ERROR("failed to put file into array", K(ret), K(syslog_file.file_name_), K(tmp_time)); - } - } - } - } - if (OB_NOT_NULL(dir)) { - closedir(dir); - dir = NULL; - } // get disk remaining size int64_t disk_remaining_size = get_disk_remaining_size_(); diff --git a/deps/oblib/src/lib/oblog/ob_log_compressor.h b/deps/oblib/src/lib/oblog/ob_log_compressor.h index 20756d2c8..c6244656f 100644 --- a/deps/oblib/src/lib/oblog/ob_log_compressor.h +++ b/deps/oblib/src/lib/oblog/ob_log_compressor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_LOG_COMPRESSOR_H_ @@ -44,7 +48,6 @@ static const int64_t OB_SYSLOG_COMPRESS_RESERVE_SIZE = 4 * (1LL << 30); // 4GB static const int64_t OB_SYSLOG_DELETE_RESERVE_SIZE = 2 * (1LL << 30); // 2GB static const int64_t OB_SYSLOG_COMPRESS_LOOP_INTERVAL = 5000000; // 5s static const char OB_SYSLOG_DIR[] = "log"; // same as LOG_DIR in src/observer/main.cpp -static const char OB_ALERT_LOG_DIR[] = "log/alert"; // same as ALERT_DIR in src/observer/main.cpp static const char OB_SYSLOG_COMPRESS_ZSTD_SUFFIX[] = ".zst"; // name suffix of file compressed by zstd static const char OB_UNCOMPRESSED_SYSLOG_FILE_PATTERN[] = "^[a-z]+\\.log\\.[0-9]+$"; // only uncompressed files static const char OB_COMPRESSED_SYSLOG_FILE_PATTERN[] = "^[a-z]+\\.log\\.[0-9]+\\.[a-z0-9]+$"; // only compressed files @@ -52,12 +55,10 @@ static const char OB_ARCHIVED_SYSLOG_FILE_PATTERN[] = "^[a-z]+\\.log\\.[0-9]+ static const char *OB_SYSLOG_FILE_PREFIX[OB_SYSLOG_COMPRESS_TYPE_COUNT] = { "observer.log", // FD_SVR_FILE - "rootservice.log", // FD_RS_FILE - "election.log", // FD_ELEC_FILE "trace.log", // FD_TRACE_FILE // no need to compress audit log and alert log }; -STATIC_ASSERT(MAX_FD_FILE == 6, "if you add a new log type, add it's prefix here !!!"); +STATIC_ASSERT(MAX_FD_FILE == 4, "if you add a new log type, add it's prefix here !!!"); #define OB_LOG_COMPRESSOR ::oceanbase::common::ObLogCompressor::get_log_compressor() diff --git a/deps/oblib/src/lib/oblog/ob_log_dba_event.cpp b/deps/oblib/src/lib/oblog/ob_log_dba_event.cpp index beecbcf7c..cd15760a4 100644 --- a/deps/oblib/src/lib/oblog/ob_log_dba_event.cpp +++ b/deps/oblib/src/lib/oblog/ob_log_dba_event.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/oblog/ob_log_dba_event.h" diff --git a/deps/oblib/src/lib/oblog/ob_log_dba_event.h b/deps/oblib/src/lib/oblog/ob_log_dba_event.h index c09b2d3c4..c38136cbd 100644 --- a/deps/oblib/src/lib/oblog/ob_log_dba_event.h +++ b/deps/oblib/src/lib/oblog/ob_log_dba_event.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OBLOG_OB_LOG_DBA_EVENT_ diff --git a/deps/oblib/src/lib/oblog/ob_log_level.h b/deps/oblib/src/lib/oblog/ob_log_level.h index ffa8c52e2..c5601926d 100644 --- a/deps/oblib/src/lib/oblog/ob_log_level.h +++ b/deps/oblib/src/lib/oblog/ob_log_level.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OBLOG_OB_LOG_LEVEL_ diff --git a/deps/oblib/src/lib/oblog/ob_log_module.h b/deps/oblib/src/lib/oblog/ob_log_module.h index 90c63b372..575b0c660 100644 --- a/deps/oblib/src/lib/oblog/ob_log_module.h +++ b/deps/oblib/src/lib/oblog/ob_log_module.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OBLOG_OB_LOG_MODULE_ diff --git a/deps/oblib/src/lib/oblog/ob_log_module.ipp b/deps/oblib/src/lib/oblog/ob_log_module.ipp index 27b2382ba..e227b61ed 100644 --- a/deps/oblib/src/lib/oblog/ob_log_module.ipp +++ b/deps/oblib/src/lib/oblog/ob_log_module.ipp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ namespace oceanbase diff --git a/deps/oblib/src/lib/oblog/ob_log_print_kv.h b/deps/oblib/src/lib/oblog/ob_log_print_kv.h index e98e4c242..64147482c 100644 --- a/deps/oblib/src/lib/oblog/ob_log_print_kv.h +++ b/deps/oblib/src/lib/oblog/ob_log_print_kv.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEABASE_COMMON_OB_LOG_PRINT_KV_H_ diff --git a/deps/oblib/src/lib/oblog/ob_log_time_fmt.cpp b/deps/oblib/src/lib/oblog/ob_log_time_fmt.cpp index 0c76724b4..ed06c5372 100644 --- a/deps/oblib/src/lib/oblog/ob_log_time_fmt.cpp +++ b/deps/oblib/src/lib/oblog/ob_log_time_fmt.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_log_time_fmt.h" @@ -60,4 +64,4 @@ const char *ObTime2Str::ob_timestamp_str_range_(const int64_t ts, TimeRange begi } }// namespace common -}// namespace oceanbase \ No newline at end of file +}// namespace oceanbase diff --git a/deps/oblib/src/lib/oblog/ob_log_time_fmt.h b/deps/oblib/src/lib/oblog/ob_log_time_fmt.h index c396c133e..4233dd0f6 100644 --- a/deps/oblib/src/lib/oblog/ob_log_time_fmt.h +++ b/deps/oblib/src/lib/oblog/ob_log_time_fmt.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_LOG_TIME_FMT_H @@ -43,4 +47,4 @@ struct ObTime2Str { } //end common } //end oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/oblog/ob_syslog_rate_limiter.cpp b/deps/oblib/src/lib/oblog/ob_syslog_rate_limiter.cpp index 7ae2a83ed..1b20f6247 100644 --- a/deps/oblib/src/lib/oblog/ob_syslog_rate_limiter.cpp +++ b/deps/oblib/src/lib/oblog/ob_syslog_rate_limiter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/deps/oblib/src/lib/oblog/ob_syslog_rate_limiter.h b/deps/oblib/src/lib/oblog/ob_syslog_rate_limiter.h index a6ea7f3ce..e7696e333 100644 --- a/deps/oblib/src/lib/oblog/ob_syslog_rate_limiter.h +++ b/deps/oblib/src/lib/oblog/ob_syslog_rate_limiter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_SYSLOG_RATE_LIMITER_H diff --git a/deps/oblib/src/lib/oblog/ob_trace_log.cpp b/deps/oblib/src/lib/oblog/ob_trace_log.cpp index 23c8dcb58..5d9e10140 100644 --- a/deps/oblib/src/lib/oblog/ob_trace_log.cpp +++ b/deps/oblib/src/lib/oblog/ob_trace_log.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/oblog/ob_trace_log.h b/deps/oblib/src/lib/oblog/ob_trace_log.h index 307a7c088..bf33a001a 100644 --- a/deps/oblib/src/lib/oblog/ob_trace_log.h +++ b/deps/oblib/src/lib/oblog/ob_trace_log.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OBLOG_OB_TRACE_LOG_ diff --git a/deps/oblib/src/lib/oblog/ob_warning_buffer.cpp b/deps/oblib/src/lib/oblog/ob_warning_buffer.cpp index 25e2012a3..25697862f 100644 --- a/deps/oblib/src/lib/oblog/ob_warning_buffer.cpp +++ b/deps/oblib/src/lib/oblog/ob_warning_buffer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/oblog/ob_warning_buffer.h" diff --git a/deps/oblib/src/lib/oblog/ob_warning_buffer.h b/deps/oblib/src/lib/oblog/ob_warning_buffer.h index 9413e2864..6f86038b5 100644 --- a/deps/oblib/src/lib/oblog/ob_warning_buffer.h +++ b/deps/oblib/src/lib/oblog/ob_warning_buffer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OBLOG_OB_WARNING_BUFFER_ diff --git a/deps/oblib/src/lib/other/recursion.cpp b/deps/oblib/src/lib/other/recursion.cpp index 6b9d0493f..4ed6d5980 100644 --- a/deps/oblib/src/lib/other/recursion.cpp +++ b/deps/oblib/src/lib/other/recursion.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/lib/other/recursion.h b/deps/oblib/src/lib/other/recursion.h index bc7ec3b17..2e5ce77d8 100644 --- a/deps/oblib/src/lib/other/recursion.h +++ b/deps/oblib/src/lib/other/recursion.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_RECURSION_H_ diff --git a/deps/oblib/src/lib/profile/ob_trace_id.cpp b/deps/oblib/src/lib/profile/ob_trace_id.cpp index ac47f6629..19f6bb8de 100644 --- a/deps/oblib/src/lib/profile/ob_trace_id.cpp +++ b/deps/oblib/src/lib/profile/ob_trace_id.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/profile/ob_trace_id.h" diff --git a/deps/oblib/src/lib/profile/ob_trace_id.h b/deps/oblib/src/lib/profile/ob_trace_id.h index c3e54ddf4..84660ff0f 100644 --- a/deps/oblib/src/lib/profile/ob_trace_id.h +++ b/deps/oblib/src/lib/profile/ob_trace_id.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_TRACE_ID_H diff --git a/deps/oblib/src/lib/profile/ob_trace_id_adaptor.cpp b/deps/oblib/src/lib/profile/ob_trace_id_adaptor.cpp index ed7365044..07e312179 100644 --- a/deps/oblib/src/lib/profile/ob_trace_id_adaptor.cpp +++ b/deps/oblib/src/lib/profile/ob_trace_id_adaptor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/profile/ob_trace_id_adaptor.h" diff --git a/deps/oblib/src/lib/profile/ob_trace_id_adaptor.h b/deps/oblib/src/lib/profile/ob_trace_id_adaptor.h index b2db70507..c2c2861bf 100644 --- a/deps/oblib/src/lib/profile/ob_trace_id_adaptor.h +++ b/deps/oblib/src/lib/profile/ob_trace_id_adaptor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_COMMON_OB_TRACE_ID_ADAPTOR_H_ diff --git a/deps/oblib/src/lib/queue/ob_co_seq_queue.h b/deps/oblib/src/lib/queue/ob_co_seq_queue.h index cf33faea4..c629a208a 100644 --- a/deps/oblib/src/lib/queue/ob_co_seq_queue.h +++ b/deps/oblib/src/lib/queue/ob_co_seq_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_LIB_QUEUE_OB_SEQ_QUEUE_H_ diff --git a/deps/oblib/src/lib/queue/ob_dedup_queue.cpp b/deps/oblib/src/lib/queue/ob_dedup_queue.cpp index a6a59333b..7a00195b9 100644 --- a/deps/oblib/src/lib/queue/ob_dedup_queue.cpp +++ b/deps/oblib/src/lib/queue/ob_dedup_queue.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/queue/ob_dedup_queue.h" diff --git a/deps/oblib/src/lib/queue/ob_dedup_queue.h b/deps/oblib/src/lib/queue/ob_dedup_queue.h index 3294e8975..2b137d90a 100644 --- a/deps/oblib/src/lib/queue/ob_dedup_queue.h +++ b/deps/oblib/src/lib/queue/ob_dedup_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_DEDUP_QUEUE_ diff --git a/deps/oblib/src/lib/queue/ob_fixed_queue.h b/deps/oblib/src/lib/queue/ob_fixed_queue.h index 5db781b9b..f49ea8ded 100644 --- a/deps/oblib/src/lib/queue/ob_fixed_queue.h +++ b/deps/oblib/src/lib/queue/ob_fixed_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_FIXED_QUEUE_ diff --git a/deps/oblib/src/lib/queue/ob_lighty_queue.cpp b/deps/oblib/src/lib/queue/ob_lighty_queue.cpp index ac426df73..f4f689843 100644 --- a/deps/oblib/src/lib/queue/ob_lighty_queue.cpp +++ b/deps/oblib/src/lib/queue/ob_lighty_queue.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/queue/ob_lighty_queue.h" diff --git a/deps/oblib/src/lib/queue/ob_lighty_queue.h b/deps/oblib/src/lib/queue/ob_lighty_queue.h index 5cb8f56d7..e43f86512 100644 --- a/deps/oblib/src/lib/queue/ob_lighty_queue.h +++ b/deps/oblib/src/lib/queue/ob_lighty_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_COMMON_OB_LIGHTY_QUEUE_ diff --git a/deps/oblib/src/lib/queue/ob_link.h b/deps/oblib/src/lib/queue/ob_link.h index 6ac89c60b..9ce37903b 100644 --- a/deps/oblib/src/lib/queue/ob_link.h +++ b/deps/oblib/src/lib/queue/ob_link.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_QUEUE_ diff --git a/deps/oblib/src/lib/queue/ob_link_queue.cpp b/deps/oblib/src/lib/queue/ob_link_queue.cpp index 50d5f3700..c7e7ea9ab 100644 --- a/deps/oblib/src/lib/queue/ob_link_queue.cpp +++ b/deps/oblib/src/lib/queue/ob_link_queue.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/queue/ob_link_queue.h" diff --git a/deps/oblib/src/lib/queue/ob_link_queue.h b/deps/oblib/src/lib/queue/ob_link_queue.h index f2390f71b..af88ace75 100644 --- a/deps/oblib/src/lib/queue/ob_link_queue.h +++ b/deps/oblib/src/lib/queue/ob_link_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_QUEUE_OB_LINK_QUEUE_ diff --git a/deps/oblib/src/lib/queue/ob_ms_queue.cpp b/deps/oblib/src/lib/queue/ob_ms_queue.cpp index 27ee51187..1fffc3c20 100644 --- a/deps/oblib/src/lib/queue/ob_ms_queue.cpp +++ b/deps/oblib/src/lib/queue/ob_ms_queue.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/queue/ob_ms_queue.h b/deps/oblib/src/lib/queue/ob_ms_queue.h index 9ca1deb64..63591d08c 100644 --- a/deps/oblib/src/lib/queue/ob_ms_queue.h +++ b/deps/oblib/src/lib/queue/ob_ms_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_QUEUE_OB_MS_QUEUE_H_ diff --git a/deps/oblib/src/lib/queue/ob_multi_fixed_queue.h b/deps/oblib/src/lib/queue/ob_multi_fixed_queue.h index 7750340de..f8bf80077 100644 --- a/deps/oblib/src/lib/queue/ob_multi_fixed_queue.h +++ b/deps/oblib/src/lib/queue/ob_multi_fixed_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_QUEUE_M_FIXED_QUEUE_H_ diff --git a/deps/oblib/src/lib/queue/ob_priority_queue.h b/deps/oblib/src/lib/queue/ob_priority_queue.h index 33087a235..d0b80848b 100644 --- a/deps/oblib/src/lib/queue/ob_priority_queue.h +++ b/deps/oblib/src/lib/queue/ob_priority_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_QUEUE_OB_PRIORITY_QUEUE_ diff --git a/deps/oblib/src/lib/random/ob_mysql_random.h b/deps/oblib/src/lib/random/ob_mysql_random.h index bc24db586..754a047cd 100644 --- a/deps/oblib/src/lib/random/ob_mysql_random.h +++ b/deps/oblib/src/lib/random/ob_mysql_random.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_MYSQL_RANDOM_H_ diff --git a/deps/oblib/src/lib/random/ob_random.cpp b/deps/oblib/src/lib/random/ob_random.cpp index 6d92bd906..87a9b6744 100644 --- a/deps/oblib/src/lib/random/ob_random.cpp +++ b/deps/oblib/src/lib/random/ob_random.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/random/ob_random.h" diff --git a/deps/oblib/src/lib/random/ob_random.h b/deps/oblib/src/lib/random/ob_random.h index 2a9bc6182..eca21a5d4 100644 --- a/deps/oblib/src/lib/random/ob_random.h +++ b/deps/oblib/src/lib/random/ob_random.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_RANDOM_H_ diff --git a/deps/oblib/src/lib/rc/context.cpp b/deps/oblib/src/lib/rc/context.cpp index ac3196780..f9b1792fa 100644 --- a/deps/oblib/src/lib/rc/context.cpp +++ b/deps/oblib/src/lib/rc/context.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -31,7 +35,7 @@ __MemoryContext__ &__MemoryContext__::root() param.set_properties(ADD_CHILD_THREAD_SAFE | ALLOC_THREAD_SAFE) .set_parallel(4) .set_mem_attr(OB_SERVER_TENANT_ID, ObModIds::OB_ROOT_CONTEXT, ObCtxIds::DEFAULT_CTX_ID); - // root_context相对底层,被其他static对象依赖,而static对象之间析构顺序又是不确定的, + // root_context is at a lower level, being depended on by other static objects, while the destruction order of static objects is uncertain, // So here is modeled on ObMallocAllocator to design a non-destroy mode static StaticInfo static_info{__FILENAME__, __LINE__, __FUNCTION__}; __MemoryContext__ *tmp = new (std::nothrow) __MemoryContext__(false, DynamicInfo(), nullptr, param, &static_info); diff --git a/deps/oblib/src/lib/rc/context.h b/deps/oblib/src/lib/rc/context.h index 1a80f690d..c283df6fe 100644 --- a/deps/oblib/src/lib/rc/context.h +++ b/deps/oblib/src/lib/rc/context.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CONTEXT_H_ diff --git a/deps/oblib/src/lib/rc/ob_rc.cpp b/deps/oblib/src/lib/rc/ob_rc.cpp index f68faf09b..7c3358327 100644 --- a/deps/oblib/src/lib/rc/ob_rc.cpp +++ b/deps/oblib/src/lib/rc/ob_rc.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_rc.h" diff --git a/deps/oblib/src/lib/rc/ob_rc.h b/deps/oblib/src/lib/rc/ob_rc.h index fdfef3f09..3b2ac4a66 100644 --- a/deps/oblib/src/lib/rc/ob_rc.h +++ b/deps/oblib/src/lib/rc/ob_rc.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_RC_H_ diff --git a/deps/oblib/src/lib/resource/achunk_mgr.cpp b/deps/oblib/src/lib/resource/achunk_mgr.cpp index 7cdac3a13..424348b2a 100644 --- a/deps/oblib/src/lib/resource/achunk_mgr.cpp +++ b/deps/oblib/src/lib/resource/achunk_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -48,7 +52,7 @@ AChunkMgr &AChunkMgr::instance() } AChunkMgr::AChunkMgr() - : limit_(DEFAULT_LIMIT), urgent_(0), hold_(0), + : limit_(DEFAULT_LIMIT), hard_limit_(INT64_MAX), hold_(0), total_hold_(0), cache_hold_(0), large_cache_hold_(0), max_chunk_cache_size_(limit_) { @@ -178,7 +182,7 @@ AChunk *AChunkMgr::alloc_chunk(const uint64_t size, bool high_prio) if (hold_size == orig_hold_size) { // do-nothing } else if (hold_size > orig_hold_size) { - need_free = !update_hold(hold_size - orig_hold_size, high_prio); + need_free = !try_inc_hold_soft(hold_size - orig_hold_size); } else if (chunk->is_hugetlb_) { need_free = true; } else { @@ -187,28 +191,29 @@ AChunk *AChunkMgr::alloc_chunk(const uint64_t size, bool high_prio) LOG_WARN_RET(OB_ERR_SYS, "madvise failed", K(errno)); need_free = true; } else { - IGNORE_RETURN update_hold(hold_size - orig_hold_size, false); + // hold_size < orig_hold_size + dec_hold(orig_hold_size - hold_size); } } if (need_free) { direct_free(chunk, all_size); - IGNORE_RETURN update_hold(-orig_hold_size, false); + dec_hold(orig_hold_size); chunk = nullptr; } } if (OB_ISNULL(chunk)) { bool updated = false; for (int chunk_idx = MAX_LARGE_ACHUNK_INDEX; !updated && chunk_idx >= 0; --chunk_idx) { - while (!(updated = update_hold(hold_size, high_prio)) && + while (!(updated = try_inc_hold_soft(hold_size)) && OB_NOT_NULL(chunk = pop_chunk_with_index(chunk_idx))) { int64_t orig_all_size = chunk->aligned(); int64_t orig_hold_size = chunk->hold(); direct_free(chunk, orig_all_size); - IGNORE_RETURN update_hold(-orig_hold_size, false); + dec_hold(orig_hold_size); chunk = nullptr; } } - if (updated) { + if (updated || try_inc_hold_hard(hold_size, high_prio)) { bool hugetlb_used = false; void *ptr = direct_alloc(all_size, true, hugetlb_used, SANITY_BOOL_EXPR(true)); if (ptr != nullptr) { @@ -221,7 +226,7 @@ AChunk *AChunkMgr::alloc_chunk(const uint64_t size, bool high_prio) #endif chunk->is_hugetlb_ = hugetlb_used; } else { - IGNORE_RETURN update_hold(-hold_size, false); + dec_hold(hold_size); } } } @@ -252,7 +257,7 @@ void AChunkMgr::free_chunk(AChunk *chunk) } if (freed) { direct_free(chunk, all_size); - IGNORE_RETURN update_hold(-hold_size, false); + dec_hold(hold_size); } } } @@ -265,16 +270,16 @@ AChunk *AChunkMgr::alloc_co_chunk(const uint64_t size) AChunk *chunk = nullptr; bool updated = false; for (int chunk_idx = MAX_LARGE_ACHUNK_INDEX; !updated && chunk_idx >= 0; --chunk_idx) { - while (!(updated = update_hold(hold_size, true)) && + while (!(updated = try_inc_hold_soft(hold_size)) && OB_NOT_NULL(chunk = pop_chunk_with_index(chunk_idx))) { int64_t all_size = chunk->aligned(); int64_t hold_size = chunk->hold(); direct_free(chunk, all_size); - IGNORE_RETURN update_hold(-hold_size, false); + dec_hold(hold_size); chunk = nullptr; } } - if (updated) { + if (updated || try_inc_hold_hard(hold_size, true)) { // there is performance drop when thread stack on huge_page memory. bool hugetlb_used = false; void *ptr = direct_alloc(all_size, false, hugetlb_used, SANITY_BOOL_EXPR(false)); @@ -282,7 +287,7 @@ AChunk *AChunkMgr::alloc_co_chunk(const uint64_t size) chunk = new (ptr) AChunk(); chunk->is_hugetlb_ = hugetlb_used; } else { - IGNORE_RETURN update_hold(-hold_size, true); + dec_hold(hold_size); } } @@ -304,17 +309,39 @@ void AChunkMgr::free_co_chunk(AChunk *chunk) const int64_t hold_size = chunk->hold(); const uint64_t all_size = chunk->aligned(); direct_free(chunk, all_size); - IGNORE_RETURN update_hold(-hold_size, false); + dec_hold(hold_size); } } -bool AChunkMgr::update_hold(int64_t bytes, bool high_prio) +bool AChunkMgr::try_inc_hold_hard(int64_t bytes, bool high_prio) +{ + bool bret = try_inc_hold(bytes, hard_limit_, high_prio); + if (!bret) { + auto &afc = g_alloc_failed_ctx(); + afc.reason_ = SERVER_HOLD_REACH_LIMIT; + afc.alloc_size_ = bytes; + afc.server_hold_ = hold_; + afc.server_limit_ = hard_limit_; + } + return bret; +} + +bool AChunkMgr::try_inc_hold_soft(int64_t bytes) +{ + return try_inc_hold(bytes, limit_, false); +} + +// bytes need to be positive +void AChunkMgr::dec_hold(int64_t bytes) +{ + IGNORE_RETURN ATOMIC_AAF(&hold_, -bytes); +} + +bool AChunkMgr::try_inc_hold(int64_t bytes, int64_t limit, bool high_prio) { bool bret = true; - const int64_t limit = high_prio ? limit_ + urgent_ : limit_; - if (bytes <= 0) { - IGNORE_RETURN ATOMIC_AAF(&hold_, bytes); - } else if (hold_ + bytes <= limit) { + limit = high_prio ? INT64_MAX : limit; + if (hold_ + bytes <= limit) { const int64_t nvalue = ATOMIC_AAF(&hold_, bytes); if (nvalue > limit) { IGNORE_RETURN ATOMIC_AAF(&hold_, -bytes); @@ -323,13 +350,6 @@ bool AChunkMgr::update_hold(int64_t bytes, bool high_prio) } else { bret = false; } - if (!bret) { - auto &afc = g_alloc_failed_ctx(); - afc.reason_ = SERVER_HOLD_REACH_LIMIT; - afc.alloc_size_ = bytes; - afc.server_hold_ = hold_; - afc.server_limit_ = limit_; - } return bret; } @@ -455,7 +475,7 @@ int64_t AChunkMgr::sync_wash() direct_free(chunk, all_size); chunk = next_chunk; } while (chunk != head); - IGNORE_RETURN update_hold(-cache_hold, false); + dec_hold(cache_hold); washed_size += cache_hold; } } diff --git a/deps/oblib/src/lib/resource/achunk_mgr.h b/deps/oblib/src/lib/resource/achunk_mgr.h index 11e4eb08f..402775443 100644 --- a/deps/oblib/src/lib/resource/achunk_mgr.h +++ b/deps/oblib/src/lib/resource/achunk_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_LIB_ALLOC_ACHUNK_MGR_H_ @@ -234,15 +238,14 @@ class AChunkMgr } } inline static AChunk *ptr2chunk(const void *ptr); - bool update_hold(int64_t bytes, bool high_prio); + void dec_hold(int64_t bytes); virtual int madvise(void *addr, size_t length, int advice); void munmap(void *addr, size_t length); int64_t to_string(char *buf, const int64_t buf_len) const; + inline void set_hard_limit(int64_t hard_limit); inline void set_limit(int64_t limit); inline int64_t get_limit() const; - inline void set_urgent(int64_t limit); - inline int64_t get_urgent() const; inline int64_t get_hold() const; inline int64_t get_total_hold() const { return ATOMIC_LOAD(&total_hold_); } inline int64_t get_used() const; @@ -252,6 +255,9 @@ class AChunkMgr private: + bool try_inc_hold(int64_t bytes, int64_t limit, bool high_prio); + bool try_inc_hold_hard(int64_t bytes, bool high_prio); + bool try_inc_hold_soft(int64_t bytes); void *direct_alloc(const uint64_t size, const bool can_use_huge_page, bool &huge_page_used, const bool alloc_shadow); void direct_free(const void *ptr, const uint64_t size); // wrap for mmap @@ -341,7 +347,7 @@ class AChunkMgr } protected: int64_t limit_; - int64_t urgent_; + int64_t hard_limit_; int64_t hold_; // Including the memory occupied by free_list, limited by memory_limit int64_t total_hold_; // Including virtual memory, just for statifics. int64_t cache_hold_; @@ -365,6 +371,11 @@ OB_INLINE uint64_t AChunkMgr::hold(const uint64_t size) return AChunk::calc_hold(size); } +inline void AChunkMgr::set_hard_limit(int64_t hard_limit) +{ + hard_limit_ = hard_limit; +} + inline void AChunkMgr::set_limit(int64_t limit) { limit_ = limit; @@ -375,16 +386,6 @@ inline int64_t AChunkMgr::get_limit() const return limit_; } -inline void AChunkMgr::set_urgent(int64_t urgent) -{ - urgent_ = urgent; -} - -inline int64_t AChunkMgr::get_urgent() const -{ - return urgent_; -} - inline int64_t AChunkMgr::get_hold() const { return hold_; diff --git a/deps/oblib/src/lib/resource/ob_affinity_ctrl.cpp b/deps/oblib/src/lib/resource/ob_affinity_ctrl.cpp index c705dc42f..26e57d8e5 100644 --- a/deps/oblib/src/lib/resource/ob_affinity_ctrl.cpp +++ b/deps/oblib/src/lib/resource/ob_affinity_ctrl.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/resource/ob_affinity_ctrl.h b/deps/oblib/src/lib/resource/ob_affinity_ctrl.h index 0bd0b6f34..b84140298 100644 --- a/deps/oblib/src/lib/resource/ob_affinity_ctrl.h +++ b/deps/oblib/src/lib/resource/ob_affinity_ctrl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_AFFINITY_CTRL_H diff --git a/deps/oblib/src/lib/resource/ob_cache_washer.h b/deps/oblib/src/lib/resource/ob_cache_washer.h index 5c367c1f3..e05a45ff3 100644 --- a/deps/oblib/src/lib/resource/ob_cache_washer.h +++ b/deps/oblib/src/lib/resource/ob_cache_washer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_CACHE_OB_CACHE_WASHER_H_ diff --git a/deps/oblib/src/lib/resource/ob_resource_mgr.cpp b/deps/oblib/src/lib/resource/ob_resource_mgr.cpp index 20a87b6ca..7a530c070 100644 --- a/deps/oblib/src/lib/resource/ob_resource_mgr.cpp +++ b/deps/oblib/src/lib/resource/ob_resource_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON @@ -24,12 +28,13 @@ namespace lib { ObTenantMemoryMgr::ObTenantMemoryMgr(const uint64_t tenant_id) : cache_washer_(NULL), tenant_id_(tenant_id), - limit_(INT64_MAX), sum_hold_(0), + limit_(INT64_MAX), hard_limit_(INT64_MAX), sum_hold_(0), cache_hold_(0), cache_item_count_(0) { for (uint64_t i = 0; i < common::ObCtxIds::MAX_CTX_ID; i++) { ATOMIC_STORE(&(hold_bytes_[i]), 0); ATOMIC_STORE(&(limit_bytes_[i]), INT64_MAX); + ATOMIC_STORE(&(hard_limit_bytes_[i]), INT64_MAX); } } void ObTenantMemoryMgr::set_cache_washer(ObICacheWasher &cache_washer) @@ -50,7 +55,7 @@ AChunk *ObTenantMemoryMgr::alloc_chunk(const int64_t size, const ObMemAttr &attr } else { const int64_t hold_size = static_cast(CHUNK_MGR.hold(static_cast(size))); bool reach_ctx_limit = false; - if (update_hold(hold_size, attr.ctx_id_, attr.label_, reach_ctx_limit)) { + if (update_hold(hold_size, attr.ctx_id_, attr.label_, reach_ctx_limit, OB_HIGH_ALLOC == attr.prio_)) { chunk = alloc_chunk_(size, attr); if (NULL == chunk) { update_hold(-hold_size, attr.ctx_id_, attr.label_, reach_ctx_limit); @@ -79,7 +84,7 @@ AChunk *ObTenantMemoryMgr::alloc_chunk(const int64_t size, const ObMemAttr &attr } if (update_hold(static_cast(hold_size), attr.ctx_id_, attr.label_, - reach_ctx_limit)) { + reach_ctx_limit, OB_HIGH_ALLOC == attr.prio_)) { chunk = alloc_chunk_(size, attr); if (NULL == chunk) { update_hold(-hold_size, attr.ctx_id_, attr.label_, reach_ctx_limit); @@ -140,6 +145,18 @@ void ObTenantMemoryMgr::free_cache_mb(void *ptr) } } +int ObTenantMemoryMgr::set_ctx_hard_limit(const uint64_t ctx_id, const int64_t hard_limit) +{ + int ret = OB_SUCCESS; + if (ctx_id >= ObCtxIds::MAX_CTX_ID || hard_limit <= 0) { + ret = OB_INVALID_ARGUMENT; + LOG_WARN("invalid arguemnt", K(ret), K(ctx_id), K(hard_limit)); + } else { + hard_limit_bytes_[ctx_id] = hard_limit; + } + return ret; +} + int ObTenantMemoryMgr::set_ctx_limit(const uint64_t ctx_id, const int64_t limit) { int ret = OB_SUCCESS; @@ -188,12 +205,13 @@ void ObTenantMemoryMgr::update_cache_hold(const int64_t size) } bool ObTenantMemoryMgr::update_hold(const int64_t size, const uint64_t ctx_id, - const lib::ObLabel &label, bool &reach_ctx_limit) + const lib::ObLabel &label, bool &reach_ctx_limit, bool high_prio) { bool updated = true; reach_ctx_limit = false; + const int64_t limit = high_prio ? INT64_MAX : hard_limit_; const int64_t nvalue = ATOMIC_AAF(&sum_hold_, size); - if (nvalue > limit_) { + if (nvalue > limit) { ATOMIC_AAF(&sum_hold_, -size); updated = false; auto &afc = g_alloc_failed_ctx(); @@ -201,9 +219,9 @@ bool ObTenantMemoryMgr::update_hold(const int64_t size, const uint64_t ctx_id, afc.alloc_size_ = size; afc.tenant_id_ = tenant_id_; afc.tenant_hold_ = get_sum_hold(); - afc.tenant_limit_ = limit_; + afc.tenant_limit_ = hard_limit_; } else if (label != ObNewModIds::OB_KVSTORE_CACHE_MB) { - if (!update_ctx_hold(ctx_id, size)) { + if (!update_ctx_hold(ctx_id, size, high_prio)) { ATOMIC_AAF(&sum_hold_, -size); updated = false; reach_ctx_limit = true; @@ -214,12 +232,12 @@ bool ObTenantMemoryMgr::update_hold(const int64_t size, const uint64_t ctx_id, return updated; } -bool ObTenantMemoryMgr::update_ctx_hold(const uint64_t ctx_id, const int64_t size) +bool ObTenantMemoryMgr::update_ctx_hold(const uint64_t ctx_id, const int64_t size, bool high_prio) { bool updated = false; if (ctx_id < ObCtxIds::MAX_CTX_ID) { volatile int64_t &hold = hold_bytes_[ctx_id]; - volatile int64_t &limit = limit_bytes_[ctx_id]; + const int64_t limit = high_prio ? INT64_MAX : hard_limit_bytes_[ctx_id]; if (size <= 0) { ATOMIC_AAF(&hold, size); updated = true; diff --git a/deps/oblib/src/lib/resource/ob_resource_mgr.h b/deps/oblib/src/lib/resource/ob_resource_mgr.h index e7b76f1b4..771d75314 100644 --- a/deps/oblib/src/lib/resource/ob_resource_mgr.h +++ b/deps/oblib/src/lib/resource/ob_resource_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RESOURCE_OB_RESOURCE_MGR_H_ @@ -44,6 +48,7 @@ class ObTenantMemoryMgr void free_cache_mb(void *ptr); uint64_t get_tenant_id() const { return tenant_id_; } + void set_hard_limit(const int64_t hard_limit) { hard_limit_ = hard_limit; } void set_limit(const int64_t limit) { limit_ = limit; } int64_t get_limit() const { return limit_; } int64_t get_sum_hold() const { return sum_hold_; } @@ -54,25 +59,28 @@ class ObTenantMemoryMgr { return static_cast(CHUNK_MGR.aligned(static_cast(size))); } + int set_ctx_hard_limit(const uint64_t ctx_id, const int64_t hard_limit); int set_ctx_limit(const uint64_t ctx_id, const int64_t limit); int get_ctx_limit(const uint64_t ctx_id, int64_t &limit) const; int get_ctx_hold(const uint64_t ctx_id, int64_t &hold) const; bool update_hold(const int64_t size, const uint64_t ctx_id, const lib::ObLabel &label, - bool &reach_ctx_limit); + bool &reach_ctx_limit, bool high_prio = false); private: void update_cache_hold(const int64_t size); - bool update_ctx_hold(const uint64_t ctx_id, const int64_t size); + bool update_ctx_hold(const uint64_t ctx_id, const int64_t size, bool high_prio); AChunk *ptr2chunk(void *ptr); AChunk *alloc_chunk_(const int64_t size, const ObMemAttr &attr); void free_chunk_(AChunk *chunk, const ObMemAttr &attr); ObICacheWasher *cache_washer_; uint64_t tenant_id_; int64_t limit_; + int64_t hard_limit_; int64_t sum_hold_; int64_t cache_hold_; int64_t cache_item_count_; volatile int64_t hold_bytes_[common::ObCtxIds::MAX_CTX_ID]; volatile int64_t limit_bytes_[common::ObCtxIds::MAX_CTX_ID]; + volatile int64_t hard_limit_bytes_[common::ObCtxIds::MAX_CTX_ID]; }; struct ObTenantResourceMgr : public common::ObLink diff --git a/deps/oblib/src/lib/restore/cos/ob_cos_wrapper.cpp b/deps/oblib/src/lib/restore/cos/ob_cos_wrapper.cpp index dca74098a..b9e7ee507 100644 --- a/deps/oblib/src/lib/restore/cos/ob_cos_wrapper.cpp +++ b/deps/oblib/src/lib/restore/cos/ob_cos_wrapper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/deps/oblib/src/lib/restore/cos/ob_cos_wrapper.h b/deps/oblib/src/lib/restore/cos/ob_cos_wrapper.h index 6ec95d006..fa9a7ab07 100644 --- a/deps/oblib/src/lib/restore/cos/ob_cos_wrapper.h +++ b/deps/oblib/src/lib/restore/cos/ob_cos_wrapper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_LIBRARY_SRC_LIB_OB_COS_WRAPPER_H_ diff --git a/deps/oblib/src/lib/restore/cos/ob_cos_wrapper_handle.cpp b/deps/oblib/src/lib/restore/cos/ob_cos_wrapper_handle.cpp index 01ea5d642..8c12ffcc5 100644 --- a/deps/oblib/src/lib/restore/cos/ob_cos_wrapper_handle.cpp +++ b/deps/oblib/src/lib/restore/cos/ob_cos_wrapper_handle.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_cos_wrapper_handle.h" diff --git a/deps/oblib/src/lib/restore/cos/ob_cos_wrapper_handle.h b/deps/oblib/src/lib/restore/cos/ob_cos_wrapper_handle.h index 5003a5d4b..e7c798948 100644 --- a/deps/oblib/src/lib/restore/cos/ob_cos_wrapper_handle.h +++ b/deps/oblib/src/lib/restore/cos/ob_cos_wrapper_handle.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_LIBRARY_SRC_LIB_RESTORE_OB_COS_WRAPPER_HANDLE_H_ diff --git a/deps/oblib/src/lib/restore/cos/ob_singleton.h b/deps/oblib/src/lib/restore/cos/ob_singleton.h index c746c2b4a..a7579d695 100644 --- a/deps/oblib/src/lib/restore/cos/ob_singleton.h +++ b/deps/oblib/src/lib/restore/cos/ob_singleton.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_LIBRARY_SRC_LIB_OB_SINGLETON_H_ @@ -52,4 +56,4 @@ class __attribute__ ((visibility ("default"))) ObSingleton } // common } // oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/restore/hdfs/ob_storage_hdfs_cache.cpp b/deps/oblib/src/lib/restore/hdfs/ob_storage_hdfs_cache.cpp index 340c61235..86bd84bd4 100644 --- a/deps/oblib/src/lib/restore/hdfs/ob_storage_hdfs_cache.cpp +++ b/deps/oblib/src/lib/restore/hdfs/ob_storage_hdfs_cache.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_storage_hdfs_cache.h" @@ -657,4 +661,4 @@ int ObHdfsFsCache::get_connection(const ObString &namenode, } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/restore/hdfs/ob_storage_hdfs_cache.h b/deps/oblib/src/lib/restore/hdfs/ob_storage_hdfs_cache.h index 87be59cc9..201be1392 100644 --- a/deps/oblib/src/lib/restore/hdfs/ob_storage_hdfs_cache.h +++ b/deps/oblib/src/lib/restore/hdfs/ob_storage_hdfs_cache.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_LIBRARY_SRC_LIB_RESTORE_OB_STORAGE_HDFS_CACHE_H_ #define SRC_LIBRARY_SRC_LIB_RESTORE_OB_STORAGE_HDFS_CACHE_H_ @@ -133,4 +137,4 @@ class ObHdfsFsCache } // namespace common } // namespace oceanbase -#endif /* SRC_LIBRARY_SRC_LIB_RESTORE_OB_STORAGE_HDFS_CACHE_H_ */ \ No newline at end of file +#endif /* SRC_LIBRARY_SRC_LIB_RESTORE_OB_STORAGE_HDFS_CACHE_H_ */ diff --git a/deps/oblib/src/lib/restore/hdfs/ob_storage_hdfs_jni_base.cpp b/deps/oblib/src/lib/restore/hdfs/ob_storage_hdfs_jni_base.cpp index 1d2063132..07d37cd6d 100644 --- a/deps/oblib/src/lib/restore/hdfs/ob_storage_hdfs_jni_base.cpp +++ b/deps/oblib/src/lib/restore/hdfs/ob_storage_hdfs_jni_base.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/restore/ob_storage.h" diff --git a/deps/oblib/src/lib/restore/hdfs/ob_storage_hdfs_jni_base.h b/deps/oblib/src/lib/restore/hdfs/ob_storage_hdfs_jni_base.h index 61ad2b266..c5780a99e 100644 --- a/deps/oblib/src/lib/restore/hdfs/ob_storage_hdfs_jni_base.h +++ b/deps/oblib/src/lib/restore/hdfs/ob_storage_hdfs_jni_base.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_LIBRARY_SRC_LIB_RESTORE_OB_STORAGE_HDFS_JNI_BASE_H_ #define SRC_LIBRARY_SRC_LIB_RESTORE_OB_STORAGE_HDFS_JNI_BASE_H_ @@ -130,4 +134,4 @@ class ObStorageHdfsReader : public ObStorageHdfsBase, public ObIStorageReader } // common } // oceanbase -#endif /* SRC_LIBRARY_SRC_LIB_RESTORE_OB_STORAGE_HDFS_JNI_BASE_H_ */ \ No newline at end of file +#endif /* SRC_LIBRARY_SRC_LIB_RESTORE_OB_STORAGE_HDFS_JNI_BASE_H_ */ diff --git a/deps/oblib/src/lib/restore/hmac_signature.cpp b/deps/oblib/src/lib/restore/hmac_signature.cpp index fe0f52b98..5b583e256 100644 --- a/deps/oblib/src/lib/restore/hmac_signature.cpp +++ b/deps/oblib/src/lib/restore/hmac_signature.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "hmac_signature.h" @@ -308,4 +312,4 @@ int sign_request( return ret; } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/restore/hmac_signature.h b/deps/oblib/src/lib/restore/hmac_signature.h index 1d251878c..cc4ab56f8 100644 --- a/deps/oblib/src/lib/restore/hmac_signature.h +++ b/deps/oblib/src/lib/restore/hmac_signature.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_HMAC_SIGNATURE_H_ #define OB_HMAC_SIGNATURE_H_ @@ -44,4 +48,4 @@ int sign_request(ObArray> params, const ch } // namespace common } // namespace oceanbase -#endif // OB_HMAC_SIGNATURE_H_ \ No newline at end of file +#endif // OB_HMAC_SIGNATURE_H_ diff --git a/deps/oblib/src/lib/restore/ob_i_storage.cpp b/deps/oblib/src/lib/restore/ob_i_storage.cpp index c801a16b3..a2e847a52 100644 --- a/deps/oblib/src/lib/restore/ob_i_storage.cpp +++ b/deps/oblib/src/lib/restore/ob_i_storage.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_i_storage.h" diff --git a/deps/oblib/src/lib/restore/ob_i_storage.h b/deps/oblib/src/lib/restore/ob_i_storage.h index d0d04c8e4..52fb35577 100644 --- a/deps/oblib/src/lib/restore/ob_i_storage.h +++ b/deps/oblib/src/lib/restore/ob_i_storage.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_LIBRARY_SRC_LIB_RESTORE_OB_I_STORAGE_H_ diff --git a/deps/oblib/src/lib/restore/ob_object_device.cpp b/deps/oblib/src/lib/restore/ob_object_device.cpp index 600748a56..717fa3b8f 100644 --- a/deps/oblib/src/lib/restore/ob_object_device.cpp +++ b/deps/oblib/src/lib/restore/ob_object_device.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_object_device.h" diff --git a/deps/oblib/src/lib/restore/ob_object_device.h b/deps/oblib/src/lib/restore/ob_object_device.h index 294728e96..f617bd11a 100644 --- a/deps/oblib/src/lib/restore/ob_object_device.h +++ b/deps/oblib/src/lib/restore/ob_object_device.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_LIBRARY_SRC_LIB_RESTORE_OB_STORAGE_DEVICE_H_ diff --git a/deps/oblib/src/lib/restore/ob_object_storage_base.cpp b/deps/oblib/src/lib/restore/ob_object_storage_base.cpp index d481d1f8d..cc204e7dc 100644 --- a/deps/oblib/src/lib/restore/ob_object_storage_base.cpp +++ b/deps/oblib/src/lib/restore/ob_object_storage_base.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_object_storage_base.h" @@ -46,4 +50,4 @@ int64_t ObObjectStorageTenantGuard::get_timeout_us() } } // common -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/deps/oblib/src/lib/restore/ob_object_storage_base.h b/deps/oblib/src/lib/restore/ob_object_storage_base.h index 736f884a2..159f50028 100644 --- a/deps/oblib/src/lib/restore/ob_object_storage_base.h +++ b/deps/oblib/src/lib/restore/ob_object_storage_base.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_LIBRARY_SRC_LIB_RESTORE_OB_OBJECT_STORAGE_BASE_H_ diff --git a/deps/oblib/src/lib/restore/ob_storage.cpp b/deps/oblib/src/lib/restore/ob_storage.cpp index 4c57efe72..991c1177c 100644 --- a/deps/oblib/src/lib/restore/ob_storage.cpp +++ b/deps/oblib/src/lib/restore/ob_storage.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_storage.h" diff --git a/deps/oblib/src/lib/restore/ob_storage.h b/deps/oblib/src/lib/restore/ob_storage.h index 430dd0cac..540f9898e 100644 --- a/deps/oblib/src/lib/restore/ob_storage.h +++ b/deps/oblib/src/lib/restore/ob_storage.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_LIBRARY_SRC_LIB_RESTORE_OB_STORAGE_H_ diff --git a/deps/oblib/src/lib/restore/ob_storage_cos_base.cpp b/deps/oblib/src/lib/restore/ob_storage_cos_base.cpp index 87b265364..4006c00bf 100644 --- a/deps/oblib/src/lib/restore/ob_storage_cos_base.cpp +++ b/deps/oblib/src/lib/restore/ob_storage_cos_base.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_storage_cos_base.h" diff --git a/deps/oblib/src/lib/restore/ob_storage_cos_base.h b/deps/oblib/src/lib/restore/ob_storage_cos_base.h index 12625e171..a6f6da55d 100644 --- a/deps/oblib/src/lib/restore/ob_storage_cos_base.h +++ b/deps/oblib/src/lib/restore/ob_storage_cos_base.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_AGENTSERVER_OSS_STORAGE_COS_BASE_H_ @@ -239,4 +243,4 @@ class ObStorageParallelCosMultiPartWriter: public ObStorageCosBase, } //common } //oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/restore/ob_storage_file.cpp b/deps/oblib/src/lib/restore/ob_storage_file.cpp index e210dac1a..6ff79f98f 100644 --- a/deps/oblib/src/lib/restore/ob_storage_file.cpp +++ b/deps/oblib/src/lib/restore/ob_storage_file.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/deps/oblib/src/lib/restore/ob_storage_file.h b/deps/oblib/src/lib/restore/ob_storage_file.h index 389280d39..501b7716c 100644 --- a/deps/oblib/src/lib/restore/ob_storage_file.h +++ b/deps/oblib/src/lib/restore/ob_storage_file.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_LIBRARY_SRC_LIB_RESTORE_OB_STORAGE_FILE_H_ diff --git a/deps/oblib/src/lib/restore/ob_storage_info.cpp b/deps/oblib/src/lib/restore/ob_storage_info.cpp index c796777b1..b5163b0f2 100644 --- a/deps/oblib/src/lib/restore/ob_storage_info.cpp +++ b/deps/oblib/src/lib/restore/ob_storage_info.cpp @@ -1,15 +1,17 @@ /* - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * Authors: - * + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE @@ -1624,8 +1626,8 @@ int64_t ObDeviceCredentialMgr::on_write_data_( ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid argument", K(ret), KP(ptr), K(size), K(nmemb), KP(user_data)); } else { - // "阿里云STS服务返回的安全令牌(STS - // Token)的长度不固定,强烈建议您不要假设安全令牌的最大长度。" there exists sts_token in the + // "Alibaba Cloud STS service returns the security token (STS" + // Token length is not fixed, it is strongly recommended that you do not assume the maximum length of the security token. " there exists sts_token in the // response of curl. therefore, use allocator to alloc mem dynamically ResponseAndAllocator *res_and_allocator = static_cast(user_data); char *&response = res_and_allocator->response_; diff --git a/deps/oblib/src/lib/restore/ob_storage_info.h b/deps/oblib/src/lib/restore/ob_storage_info.h index f7957ec69..fbb58b8cb 100644 --- a/deps/oblib/src/lib/restore/ob_storage_info.h +++ b/deps/oblib/src/lib/restore/ob_storage_info.h @@ -1,15 +1,17 @@ /* - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * Authors: - * + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_RESTORE_OB_STORAGE_INFO_H_ @@ -129,7 +131,7 @@ struct ObSTSToken int set(const ObString &token); int assign(const ObSTSToken &token); const char *get_data() const; - // "阿里云STS服务返回的安全令牌(STS Token)的长度不固定,强烈建议您不要假设安全令牌的最大长度。" + // "The length of the security token (STS Token) returned by the Alibaba Cloud STS service is not fixed, it is strongly recommended that you do not assume the maximum length of the security token." // therefore, use allocator to alloc mem for sts_token dynamically int64_t length() const {return data_len_;}; bool is_below_predefined_length() const {return is_below_predefined_length_;}; @@ -223,10 +225,9 @@ class ObStorageAccount ObStorageDeleteMode delete_mode_; ObSTSToken sts_token_; }; - -// ObObjectStorageInfo 存储了需要访问对象存储的所有信息,包括 ak、sk、endpoint 等等 -// ObObjectStorageInfo 可以由一个特定格式的字符串进行初始化,也可以由另外一个 ObObjectStorageInfo 对象赋值,除此之外不提供修改数据的途径 -// 一些字段是可选的,例如 region, checksum_type, addressing_model,它们存在 extension 字段中,但为了方便提取,使用成员变量存放副本 +// ObObjectStorageInfo stores all the information needed to access object storage, including ak, sk, endpoint, etc. +// ObObjectStorageInfo can be initialized by a string of a specific format, or by another ObObjectStorageInfo object, no other means of modifying the data are provided +// Some fields are optional, for example region, checksum_type, addressing_model, they exist in the extension field, but for convenience of extraction, use member variables to store copies class ObObjectStorageInfo { OB_UNIS_VERSION(1); diff --git a/deps/oblib/src/lib/restore/ob_storage_oss_base.cpp b/deps/oblib/src/lib/restore/ob_storage_oss_base.cpp index 73a70c234..36c5f2700 100644 --- a/deps/oblib/src/lib/restore/ob_storage_oss_base.cpp +++ b/deps/oblib/src/lib/restore/ob_storage_oss_base.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_storage_oss_base.h" @@ -685,7 +689,7 @@ int ObOssAccount::parse_oss_arg(const common::ObString &storage_info) OB_LOG(WARN, "failed to set oss_key_", K(ret)); } } else if (0 == strncmp(STS_TOKEN_KEY, token, strlen(STS_TOKEN_KEY))) { - // "阿里云STS服务返回的安全令牌(STS Token)的长度不固定,强烈建议您不要假设安全令牌的最大长度。" + // "The length of the security token (STS Token) returned by the Alibaba Cloud STS service is not fixed, it is strongly recommended that you do not assume the maximum length of the security token." // therefore, use allocator to alloc mem for sts_token dynamically const int64_t sts_token_len = strlen(token) - strlen(STS_TOKEN_KEY); if (OB_ISNULL(oss_sts_token_ = reinterpret_cast(allocator_.alloc(sts_token_len + 1)))) { diff --git a/deps/oblib/src/lib/restore/ob_storage_oss_base.h b/deps/oblib/src/lib/restore/ob_storage_oss_base.h index b2a224ebd..49ccdc781 100644 --- a/deps/oblib/src/lib/restore/ob_storage_oss_base.h +++ b/deps/oblib/src/lib/restore/ob_storage_oss_base.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_AGENTSERVER_OSS_STORAGE_OSS_BASE_H_ @@ -137,7 +141,7 @@ class ObOssAccount { char oss_id_[MAX_OSS_ID_LENGTH]; char oss_key_[MAX_OSS_KEY_LENGTH]; char *oss_sts_token_; - // "阿里云STS服务返回的安全令牌(STS Token)的长度不固定,强烈建议您不要假设安全令牌的最大长度。" + // "The length of the security token (STS Token) returned by the Alibaba Cloud STS service is not fixed, it is strongly recommended that you do not assume the maximum length of the security token." // therefore, use allocator to alloc mem for sts_token dynamically common::ObArenaAllocator allocator_; ObStorageDeleteMode delete_mode_; diff --git a/deps/oblib/src/lib/restore/ob_storage_path.cpp b/deps/oblib/src/lib/restore/ob_storage_path.cpp index 1f2be7ca3..8fa0c710c 100644 --- a/deps/oblib/src/lib/restore/ob_storage_path.cpp +++ b/deps/oblib/src/lib/restore/ob_storage_path.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/utility/ob_print_utils.h" diff --git a/deps/oblib/src/lib/restore/ob_storage_path.h b/deps/oblib/src/lib/restore/ob_storage_path.h index c6bf06b11..0061d1d5b 100644 --- a/deps/oblib/src/lib/restore/ob_storage_path.h +++ b/deps/oblib/src/lib/restore/ob_storage_path.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/alloc/alloc_assist.h" diff --git a/deps/oblib/src/lib/restore/ob_storage_s3_base.cpp b/deps/oblib/src/lib/restore/ob_storage_s3_base.cpp index c00026729..f6c6533ee 100644 --- a/deps/oblib/src/lib/restore/ob_storage_s3_base.cpp +++ b/deps/oblib/src/lib/restore/ob_storage_s3_base.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/restore/ob_storage.h" diff --git a/deps/oblib/src/lib/restore/ob_storage_s3_base.h b/deps/oblib/src/lib/restore/ob_storage_s3_base.h index 4cad6a806..cb3833837 100644 --- a/deps/oblib/src/lib/restore/ob_storage_s3_base.h +++ b/deps/oblib/src/lib/restore/ob_storage_s3_base.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_LIBRARY_SRC_LIB_RESTORE_OB_STORAGE_S3_BASE_H_ diff --git a/deps/oblib/src/lib/roaringbitmap/ob_rb_bin.cpp b/deps/oblib/src/lib/roaringbitmap/ob_rb_bin.cpp index 144149661..3dee889de 100644 --- a/deps/oblib/src/lib/roaringbitmap/ob_rb_bin.cpp +++ b/deps/oblib/src/lib/roaringbitmap/ob_rb_bin.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -967,4 +971,4 @@ uint64_t ObRoaring64Bin::high32_advance_until(uint64_t idx, uint32_t min) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/roaringbitmap/ob_rb_bin.h b/deps/oblib/src/lib/roaringbitmap/ob_rb_bin.h index b443d76c2..fc674e9c4 100644 --- a/deps/oblib/src/lib/roaringbitmap/ob_rb_bin.h +++ b/deps/oblib/src/lib/roaringbitmap/ob_rb_bin.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_ROARINGBITMAP_OB_RB_BIN_ @@ -96,4 +100,4 @@ class ObRoaring64Bin } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_ROARINGBITMAP_OB_RB_BIN_ \ No newline at end of file +#endif // OCEANBASE_LIB_ROARINGBITMAP_OB_RB_BIN_ diff --git a/deps/oblib/src/lib/roaringbitmap/ob_rb_memory_mgr.cpp b/deps/oblib/src/lib/roaringbitmap/ob_rb_memory_mgr.cpp index db88fe026..e56429886 100644 --- a/deps/oblib/src/lib/roaringbitmap/ob_rb_memory_mgr.cpp +++ b/deps/oblib/src/lib/roaringbitmap/ob_rb_memory_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/deps/oblib/src/lib/roaringbitmap/ob_rb_memory_mgr.h b/deps/oblib/src/lib/roaringbitmap/ob_rb_memory_mgr.h index 9b4690a2e..baea20dc9 100644 --- a/deps/oblib/src/lib/roaringbitmap/ob_rb_memory_mgr.h +++ b/deps/oblib/src/lib/roaringbitmap/ob_rb_memory_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEABASE_LIB_OB_RB_MEMORY_MGR_ @@ -58,4 +62,4 @@ class ObRbMemMgr } // common } // oceanbase -#endif // OCEABASE_LIB_OB_RB_MEMORY_MGR_ \ No newline at end of file +#endif // OCEABASE_LIB_OB_RB_MEMORY_MGR_ diff --git a/deps/oblib/src/lib/roaringbitmap/ob_rb_utils.cpp b/deps/oblib/src/lib/roaringbitmap/ob_rb_utils.cpp index a3407ae6a..8d66ea6e3 100644 --- a/deps/oblib/src/lib/roaringbitmap/ob_rb_utils.cpp +++ b/deps/oblib/src/lib/roaringbitmap/ob_rb_utils.cpp @@ -1,15 +1,18 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the roaringbitmap utils abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/roaringbitmap/ob_rb_utils.h b/deps/oblib/src/lib/roaringbitmap/ob_rb_utils.h index 9775003c2..37a143432 100644 --- a/deps/oblib/src/lib/roaringbitmap/ob_rb_utils.h +++ b/deps/oblib/src/lib/roaringbitmap/ob_rb_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_ROARINGBITMAP_OB_RB_UTILS_ @@ -149,4 +153,4 @@ class ObRbAggAllocator } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_ROARINGBITMAP_OB_RB_UTILS_ \ No newline at end of file +#endif // OCEANBASE_LIB_ROARINGBITMAP_OB_RB_UTILS_ diff --git a/deps/oblib/src/lib/roaringbitmap/ob_roaringbitmap.cpp b/deps/oblib/src/lib/roaringbitmap/ob_roaringbitmap.cpp index 6a4ec85c0..10ac93064 100644 --- a/deps/oblib/src/lib/roaringbitmap/ob_roaringbitmap.cpp +++ b/deps/oblib/src/lib/roaringbitmap/ob_roaringbitmap.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -824,4 +828,4 @@ int ObRoaringBitmapIter::get_next() } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/roaringbitmap/ob_roaringbitmap.h b/deps/oblib/src/lib/roaringbitmap/ob_roaringbitmap.h index 02f8b5170..88216b564 100644 --- a/deps/oblib/src/lib/roaringbitmap/ob_roaringbitmap.h +++ b/deps/oblib/src/lib/roaringbitmap/ob_roaringbitmap.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_ROARINGBITMAP_OB_ROARINGBITMAP_ @@ -200,4 +204,4 @@ class ObRoaringBitmapIter } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_ROARINGBITMAP_OB_ROARINGBITMAP_ \ No newline at end of file +#endif // OCEANBASE_LIB_ROARINGBITMAP_OB_ROARINGBITMAP_ diff --git a/deps/oblib/src/lib/runtime.cpp b/deps/oblib/src/lib/runtime.cpp index 383c57ba0..8c955c6b8 100644 --- a/deps/oblib/src/lib/runtime.cpp +++ b/deps/oblib/src/lib/runtime.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "runtime.h" diff --git a/deps/oblib/src/lib/runtime.h b/deps/oblib/src/lib/runtime.h index 549582521..6baefa06c 100644 --- a/deps/oblib/src/lib/runtime.h +++ b/deps/oblib/src/lib/runtime.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LIB_RUNTIME_H diff --git a/deps/oblib/src/lib/signal/ob_libunwind.c b/deps/oblib/src/lib/signal/ob_libunwind.c index 118d348fe..791be15a4 100644 --- a/deps/oblib/src/lib/signal/ob_libunwind.c +++ b/deps/oblib/src/lib/signal/ob_libunwind.c @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef __x86_64__ diff --git a/deps/oblib/src/lib/signal/ob_libunwind.h b/deps/oblib/src/lib/signal/ob_libunwind.h index 57538df71..214954dc5 100644 --- a/deps/oblib/src/lib/signal/ob_libunwind.h +++ b/deps/oblib/src/lib/signal/ob_libunwind.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIBUNWIND_BT_H_ diff --git a/deps/oblib/src/lib/signal/ob_signal_handlers.cpp b/deps/oblib/src/lib/signal/ob_signal_handlers.cpp index 56d5868dd..d5e594542 100644 --- a/deps/oblib/src/lib/signal/ob_signal_handlers.cpp +++ b/deps/oblib/src/lib/signal/ob_signal_handlers.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/lib/signal/ob_signal_handlers.h b/deps/oblib/src/lib/signal/ob_signal_handlers.h index 92fb28be3..00161032d 100644 --- a/deps/oblib/src/lib/signal/ob_signal_handlers.h +++ b/deps/oblib/src/lib/signal/ob_signal_handlers.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SIGNAL_HANDLERS_H_ diff --git a/deps/oblib/src/lib/signal/ob_signal_struct.cpp b/deps/oblib/src/lib/signal/ob_signal_struct.cpp index d8c4c2483..2f76f54a6 100644 --- a/deps/oblib/src/lib/signal/ob_signal_struct.cpp +++ b/deps/oblib/src/lib/signal/ob_signal_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/lib/signal/ob_signal_struct.h b/deps/oblib/src/lib/signal/ob_signal_struct.h index b4026dbdc..eb581dd39 100644 --- a/deps/oblib/src/lib/signal/ob_signal_struct.h +++ b/deps/oblib/src/lib/signal/ob_signal_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SIGNAL_STRUCT_H_ diff --git a/deps/oblib/src/lib/signal/ob_signal_utils.cpp b/deps/oblib/src/lib/signal/ob_signal_utils.cpp index d0cac490e..48134c8e4 100644 --- a/deps/oblib/src/lib/signal/ob_signal_utils.cpp +++ b/deps/oblib/src/lib/signal/ob_signal_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/lib/signal/ob_signal_utils.h b/deps/oblib/src/lib/signal/ob_signal_utils.h index 782ca4c9f..3d659d893 100644 --- a/deps/oblib/src/lib/signal/ob_signal_utils.h +++ b/deps/oblib/src/lib/signal/ob_signal_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SIGNAL_UTILS_H_ diff --git a/deps/oblib/src/lib/ssl/ob_ssl_config.cpp b/deps/oblib/src/lib/ssl/ob_ssl_config.cpp index 46af59206..bc9fd98f0 100644 --- a/deps/oblib/src/lib/ssl/ob_ssl_config.cpp +++ b/deps/oblib/src/lib/ssl/ob_ssl_config.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/src/lib/ssl/ob_ssl_config.h b/deps/oblib/src/lib/ssl/ob_ssl_config.h index 9c3295988..63f40c849 100644 --- a/deps/oblib/src/lib/ssl/ob_ssl_config.h +++ b/deps/oblib/src/lib/ssl/ob_ssl_config.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_SSL_CONFIG_H_ @@ -58,4 +62,4 @@ ssize_t ob_write_regard_ssl(int fd, const void *buf, size_t nbytes, ssl_state_st } } -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/stat/mock_diagnostic_info.cpp b/deps/oblib/src/lib/stat/mock_diagnostic_info.cpp index 35cb1df8a..4bd1103ab 100644 --- a/deps/oblib/src/lib/stat/mock_diagnostic_info.cpp +++ b/deps/oblib/src/lib/stat/mock_diagnostic_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public @@ -28,4 +32,4 @@ __attribute__((constructor)) void init_diagnostic_info() lib::ObPerfModeGuard::get_tl_instance() = true; } -} /* namespace oceanbase */ \ No newline at end of file +} /* namespace oceanbase */ diff --git a/deps/oblib/src/lib/stat/ob_di_cache.cpp b/deps/oblib/src/lib/stat/ob_di_cache.cpp index a125b433a..2883088ec 100644 --- a/deps/oblib/src/lib/stat/ob_di_cache.cpp +++ b/deps/oblib/src/lib/stat/ob_di_cache.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/lib/stat/ob_di_cache.h b/deps/oblib/src/lib/stat/ob_di_cache.h index 4d1e14edb..3993431c3 100644 --- a/deps/oblib/src/lib/stat/ob_di_cache.h +++ b/deps/oblib/src/lib/stat/ob_di_cache.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_DI_CACHE_H_ diff --git a/deps/oblib/src/lib/stat/ob_di_list.h b/deps/oblib/src/lib/stat/ob_di_list.h index 4e8c29913..ded08d168 100644 --- a/deps/oblib/src/lib/stat/ob_di_list.h +++ b/deps/oblib/src/lib/stat/ob_di_list.h @@ -1,190 +1,194 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ -#ifndef OB_DI_LIST_H_ -#define OB_DI_LIST_H_ -#include -#include -#include -#include - -namespace oceanbase -{ -namespace common -{ -template -struct ObDINode -{ - ObDINode() : prev_(NULL), next_(NULL) {} - virtual ~ObDINode() {} - Value *get_next() { return next_; } - Value *get_prev() { return prev_; } - void add_before(Value *e); - void add_after(Value *e); - void add(Value *prev, Value *e, Value *next); - void unlink(); - Value *prev_; - Value *next_; -}; - -template -struct ObDIList -{ - ObDIList(); - virtual ~ObDIList(); - DLinkNode *get_header() {return static_cast(&header_);} - DLinkNode *get_first() { return header_.next_; } - bool is_empty() const { return header_.next_ == static_cast(&header_); } - bool add_last(DLinkNode *e); - bool add_first(DLinkNode *e); - bool move_to_first(DLinkNode *e); - bool move_to_last(DLinkNode *e); - DLinkNode *remove(DLinkNode *e); - DLinkNode *remove_last(); - DLinkNode *remove_first(); - ObDINode header_; - int32_t size_; -}; - -template -void ObDINode::add_before(Value *e) -{ - add(prev_, e, static_cast(this)); -} - -template -void ObDINode::add_after(Value *e) -{ - add(static_cast(this), e, next_); -} - -template -void ObDINode::add(Value *prev, Value *e, Value *next) -{ - prev->next_ = e; - e->prev_ = prev; - next->prev_ = e; - e->next_ = next; -} - -template -void ObDINode::unlink() -{ - if (NULL != prev_ && NULL != next_) { - prev_->next_ = next_; - next_->prev_ = prev_; - prev_ = NULL; - next_ = NULL; - } -} - -template -ObDIList::ObDIList() -{ - header_.next_ = static_cast(&header_); - header_.prev_ = static_cast(&header_); - size_ = 0; -} - -template -ObDIList::~ObDIList() -{ -} - -template -bool ObDIList::add_last(DLinkNode *e) -{ - bool ret = true; - if (OB_ISNULL(e)) { - ret = false; - } else if (OB_UNLIKELY(e->get_prev() != NULL - || e->get_next() != NULL)) { - ret = false; - } else { - header_.add_before(e); - ++size_; - } - return ret; -} - -template -bool ObDIList::add_first(DLinkNode *e) -{ - bool ret = true; - if (OB_ISNULL(e)) { - ret = false; - } else if (e->get_prev() != NULL - || e->get_next() != NULL) { - ret = false; - } else { - header_.add_after(e); - ++size_; - } - return ret; -} - -template -bool ObDIList::move_to_first(DLinkNode *e) -{ - bool ret = true; - if (OB_UNLIKELY(e == &header_) || OB_ISNULL(e)) { - ret = false; - } else { - e->unlink(); - --size_; - ret = add_first(e); - } - return ret; -} - -template -bool ObDIList::move_to_last(DLinkNode *e) -{ - bool ret = true; - if (OB_UNLIKELY(e == &header_) || OB_ISNULL(e)) { - ret = false; - } else { - e->unlink(); - size_--; - ret = add_last(e); - } - return ret; -} - -template -DLinkNode *ObDIList::remove(DLinkNode *e) -{ - DLinkNode *ret = e; +#ifndef OB_DI_LIST_H_ +#define OB_DI_LIST_H_ +#include +#include +#include +#include + +namespace oceanbase +{ +namespace common +{ +template +struct ObDINode +{ + ObDINode() : prev_(NULL), next_(NULL) {} + virtual ~ObDINode() {} + Value *get_next() { return next_; } + Value *get_prev() { return prev_; } + void add_before(Value *e); + void add_after(Value *e); + void add(Value *prev, Value *e, Value *next); + void unlink(); + Value *prev_; + Value *next_; +}; + +template +struct ObDIList +{ + ObDIList(); + virtual ~ObDIList(); + DLinkNode *get_header() {return static_cast(&header_);} + DLinkNode *get_first() { return header_.next_; } + bool is_empty() const { return header_.next_ == static_cast(&header_); } + bool add_last(DLinkNode *e); + bool add_first(DLinkNode *e); + bool move_to_first(DLinkNode *e); + bool move_to_last(DLinkNode *e); + DLinkNode *remove(DLinkNode *e); + DLinkNode *remove_last(); + DLinkNode *remove_first(); + ObDINode header_; + int32_t size_; +}; + +template +void ObDINode::add_before(Value *e) +{ + add(prev_, e, static_cast(this)); +} + +template +void ObDINode::add_after(Value *e) +{ + add(static_cast(this), e, next_); +} + +template +void ObDINode::add(Value *prev, Value *e, Value *next) +{ + prev->next_ = e; + e->prev_ = prev; + next->prev_ = e; + e->next_ = next; +} + +template +void ObDINode::unlink() +{ + if (NULL != prev_ && NULL != next_) { + prev_->next_ = next_; + next_->prev_ = prev_; + prev_ = NULL; + next_ = NULL; + } +} + +template +ObDIList::ObDIList() +{ + header_.next_ = static_cast(&header_); + header_.prev_ = static_cast(&header_); + size_ = 0; +} + +template +ObDIList::~ObDIList() +{ +} + +template +bool ObDIList::add_last(DLinkNode *e) +{ + bool ret = true; + if (OB_ISNULL(e)) { + ret = false; + } else if (OB_UNLIKELY(e->get_prev() != NULL + || e->get_next() != NULL)) { + ret = false; + } else { + header_.add_before(e); + ++size_; + } + return ret; +} + +template +bool ObDIList::add_first(DLinkNode *e) +{ + bool ret = true; + if (OB_ISNULL(e)) { + ret = false; + } else if (e->get_prev() != NULL + || e->get_next() != NULL) { + ret = false; + } else { + header_.add_after(e); + ++size_; + } + return ret; +} + +template +bool ObDIList::move_to_first(DLinkNode *e) +{ + bool ret = true; + if (OB_UNLIKELY(e == &header_) || OB_ISNULL(e)) { + ret = false; + } else { + e->unlink(); + --size_; + ret = add_first(e); + } + return ret; +} + +template +bool ObDIList::move_to_last(DLinkNode *e) +{ + bool ret = true; + if (OB_UNLIKELY(e == &header_) || OB_ISNULL(e)) { + ret = false; + } else { + e->unlink(); + size_--; + ret = add_last(e); + } + return ret; +} + +template +DLinkNode *ObDIList::remove(DLinkNode *e) +{ + DLinkNode *ret = e; if (OB_UNLIKELY(e == &header_) || OB_ISNULL(e)) { ret = NULL; } else { e->unlink(); size_--; } - return ret; -} - -template -DLinkNode *ObDIList::remove_last() -{ - return remove(header_.prev_); -} - -template -DLinkNode *ObDIList::remove_first() -{ - return remove(header_.next_); -} - -}//common -}//oceanbase -#endif /* OB_DI_LIST_H_ */ + return ret; +} + +template +DLinkNode *ObDIList::remove_last() +{ + return remove(header_.prev_); +} + +template +DLinkNode *ObDIList::remove_first() +{ + return remove(header_.next_); +} + +}//common +}//oceanbase +#endif /* OB_DI_LIST_H_ */ diff --git a/deps/oblib/src/lib/stat/ob_di_tls.cpp b/deps/oblib/src/lib/stat/ob_di_tls.cpp index 50e46da60..462824bb0 100644 --- a/deps/oblib/src/lib/stat/ob_di_tls.cpp +++ b/deps/oblib/src/lib/stat/ob_di_tls.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_di_tls.h" diff --git a/deps/oblib/src/lib/stat/ob_di_tls.h b/deps/oblib/src/lib/stat/ob_di_tls.h index 058e3ce7c..26e64aa29 100644 --- a/deps/oblib/src/lib/stat/ob_di_tls.h +++ b/deps/oblib/src/lib/stat/ob_di_tls.h @@ -1,187 +1,191 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ - -#ifndef OB_DI_TLS_H_ -#define OB_DI_TLS_H_ - -#include "lib/ob_define.h" -#include "lib/allocator/ob_malloc.h" - -#include - -namespace oceanbase -{ -namespace common -{ -template -struct ObDITlsPlaceHolder -{ - char buf_[sizeof(T[N])]; -}; - -extern thread_local bool is_thread_in_exit; - -template -class ObDITls -{ - // avoid reconstruct during construction. - static constexpr uint64_t PLACE_HOLDER = 0x1; - static constexpr uint64_t MAX_TNAME_LENGTH = 128; -public: - static T* get_instance(); - OB_INLINE bool is_valid() { return OB_NOT_NULL(instance_) && PLACE_HOLDER != (uint64_t)instance_; } -private: - ObDITls() : instance_(nullptr) {} - ~ObDITls(); - static const char* get_label(); -private: - T* instance_; -}; - -template -const char* ObDITls::get_label() { - const char* cxxname = typeid(T).name(); - const char* ret = "DITls"; - static char buf[MAX_TNAME_LENGTH]; - if (nullptr == cxxname || strlen(cxxname) > MAX_TNAME_LENGTH - 5) { - // do nothing, avoid realloc in __cxa_demangle - } else { - int status = 0; - int length = MAX_TNAME_LENGTH - 3; - ret = abi::__cxa_demangle(cxxname, buf + 3, (size_t*)&length, &status); - if (0 != status) { - ret = "DITls"; - } else { - // remove namespace - length = MAX_TNAME_LENGTH - 1; - while (length >= 3 && buf[length] != ':') { - --length; - } - length -= 2; - buf[length] = '['; - buf[length + 1] = 'T'; - buf[length + 2] = ']'; - ret = buf + length; - } - } - return ret; -} - -template -ObDITls::~ObDITls() -{ - is_thread_in_exit = true; - if (is_valid()) { - lib::ObDisableDiagnoseGuard disable_diagnose_guard; - ob_delete(instance_); - instance_ = nullptr; - } -} - -template -T* ObDITls::get_instance() -{ - // for static check - static ObDITlsPlaceHolder placeholder __attribute__((used)); - static thread_local ObDITls di_tls; - if (OB_LIKELY(!di_tls.is_valid() && !is_thread_in_exit)) { - static const char* label = get_label(); - di_tls.instance_ = (T*)PLACE_HOLDER; - // add tenant - ObMemAttr attr(ob_thread_tenant_id(), label); - SET_USE_500(attr); - di_tls.instance_ = OB_NEW(T, attr); - } - return di_tls.instance_; -} -template -class ObDITls -{ - // avoid reconstruct during construction. - static constexpr uint64_t PLACE_HOLDER = 0x1; - static constexpr uint64_t MAX_TNAME_LENGTH = 128; -public: - static T* get_instance(); - OB_INLINE bool is_valid() { return OB_NOT_NULL(instance_) && PLACE_HOLDER != (uint64_t)instance_; } -private: - ObDITls() : instance_(nullptr) {} - ~ObDITls(); - static const char* get_label(); -private: - T* instance_; -}; - -template -const char* ObDITls::get_label() { - const char* cxxname = typeid(T).name(); - const char* ret = "DITls"; - static char buf[MAX_TNAME_LENGTH]; - if (nullptr == cxxname || strlen(cxxname) > MAX_TNAME_LENGTH - 5) { - // do nothing, avoid realloc in __cxa_demangle - } else { - int status = 0; - int length = MAX_TNAME_LENGTH - 3; - ret = abi::__cxa_demangle(cxxname, buf + 3, (size_t*)&length, &status); - if (0 != status) { - ret = "DITls"; - } else { - // remove namespace - length = MAX_TNAME_LENGTH - 1; - while (length >= 3 && buf[length] != ':') { - --length; - } - length -= 2; - buf[length] = '['; - buf[length + 1] = 'T'; - buf[length + 2] = ']'; - ret = buf + length; - } - } - return ret; -} - -template -ObDITls::~ObDITls() -{ - is_thread_in_exit = true; - if (is_valid()) { - for (auto i = 0; i < N; ++i) { - instance_[i].~T(); - } - ob_free(instance_); - } -} - -template -T* ObDITls::get_instance() -{ - // for static check - static ObDITlsPlaceHolder placeholder __attribute__((used)); - static thread_local ObDITls di_tls; - if (OB_LIKELY(!di_tls.is_valid() && !is_thread_in_exit)) { - static const char* label = get_label(); - di_tls.instance_ = (T*)PLACE_HOLDER; - ObMemAttr attr(ob_thread_tenant_id(), label); - SET_USE_500(attr); - // add tenant - if (OB_NOT_NULL(di_tls.instance_ = (T*)ob_malloc(sizeof(T) * N, attr))) { - for (auto i = 0; i < N; ++i) { - new (di_tls.instance_ + i) T; - } - } - } - return di_tls.instance_; -} - -} -} -#endif +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ + +#ifndef OB_DI_TLS_H_ +#define OB_DI_TLS_H_ + +#include "lib/ob_define.h" +#include "lib/allocator/ob_malloc.h" + +#include + +namespace oceanbase +{ +namespace common +{ +template +struct ObDITlsPlaceHolder +{ + char buf_[sizeof(T[N])]; +}; + +extern thread_local bool is_thread_in_exit; + +template +class ObDITls +{ + // avoid reconstruct during construction. + static constexpr uint64_t PLACE_HOLDER = 0x1; + static constexpr uint64_t MAX_TNAME_LENGTH = 128; +public: + static T* get_instance(); + OB_INLINE bool is_valid() { return OB_NOT_NULL(instance_) && PLACE_HOLDER != (uint64_t)instance_; } +private: + ObDITls() : instance_(nullptr) {} + ~ObDITls(); + static const char* get_label(); +private: + T* instance_; +}; + +template +const char* ObDITls::get_label() { + const char* cxxname = typeid(T).name(); + const char* ret = "DITls"; + static char buf[MAX_TNAME_LENGTH]; + if (nullptr == cxxname || strlen(cxxname) > MAX_TNAME_LENGTH - 5) { + // do nothing, avoid realloc in __cxa_demangle + } else { + int status = 0; + int length = MAX_TNAME_LENGTH - 3; + ret = abi::__cxa_demangle(cxxname, buf + 3, (size_t*)&length, &status); + if (0 != status) { + ret = "DITls"; + } else { + // remove namespace + length = MAX_TNAME_LENGTH - 1; + while (length >= 3 && buf[length] != ':') { + --length; + } + length -= 2; + buf[length] = '['; + buf[length + 1] = 'T'; + buf[length + 2] = ']'; + ret = buf + length; + } + } + return ret; +} + +template +ObDITls::~ObDITls() +{ + is_thread_in_exit = true; + if (is_valid()) { + lib::ObDisableDiagnoseGuard disable_diagnose_guard; + ob_delete(instance_); + instance_ = nullptr; + } +} + +template +T* ObDITls::get_instance() +{ + // for static check + static ObDITlsPlaceHolder placeholder __attribute__((used)); + static thread_local ObDITls di_tls; + if (OB_LIKELY(!di_tls.is_valid() && !is_thread_in_exit)) { + static const char* label = get_label(); + di_tls.instance_ = (T*)PLACE_HOLDER; + // add tenant + ObMemAttr attr(ob_thread_tenant_id(), label); + SET_USE_500(attr); + di_tls.instance_ = OB_NEW(T, attr); + } + return di_tls.instance_; +} +template +class ObDITls +{ + // avoid reconstruct during construction. + static constexpr uint64_t PLACE_HOLDER = 0x1; + static constexpr uint64_t MAX_TNAME_LENGTH = 128; +public: + static T* get_instance(); + OB_INLINE bool is_valid() { return OB_NOT_NULL(instance_) && PLACE_HOLDER != (uint64_t)instance_; } +private: + ObDITls() : instance_(nullptr) {} + ~ObDITls(); + static const char* get_label(); +private: + T* instance_; +}; + +template +const char* ObDITls::get_label() { + const char* cxxname = typeid(T).name(); + const char* ret = "DITls"; + static char buf[MAX_TNAME_LENGTH]; + if (nullptr == cxxname || strlen(cxxname) > MAX_TNAME_LENGTH - 5) { + // do nothing, avoid realloc in __cxa_demangle + } else { + int status = 0; + int length = MAX_TNAME_LENGTH - 3; + ret = abi::__cxa_demangle(cxxname, buf + 3, (size_t*)&length, &status); + if (0 != status) { + ret = "DITls"; + } else { + // remove namespace + length = MAX_TNAME_LENGTH - 1; + while (length >= 3 && buf[length] != ':') { + --length; + } + length -= 2; + buf[length] = '['; + buf[length + 1] = 'T'; + buf[length + 2] = ']'; + ret = buf + length; + } + } + return ret; +} + +template +ObDITls::~ObDITls() +{ + is_thread_in_exit = true; + if (is_valid()) { + for (auto i = 0; i < N; ++i) { + instance_[i].~T(); + } + ob_free(instance_); + } +} + +template +T* ObDITls::get_instance() +{ + // for static check + static ObDITlsPlaceHolder placeholder __attribute__((used)); + static thread_local ObDITls di_tls; + if (OB_LIKELY(!di_tls.is_valid() && !is_thread_in_exit)) { + static const char* label = get_label(); + di_tls.instance_ = (T*)PLACE_HOLDER; + ObMemAttr attr(ob_thread_tenant_id(), label); + SET_USE_500(attr); + // add tenant + if (OB_NOT_NULL(di_tls.instance_ = (T*)ob_malloc(sizeof(T) * N, attr))) { + for (auto i = 0; i < N; ++i) { + new (di_tls.instance_ + i) T; + } + } + } + return di_tls.instance_; +} + +} +} +#endif diff --git a/deps/oblib/src/lib/stat/ob_diagnose_info.cpp b/deps/oblib/src/lib/stat/ob_diagnose_info.cpp index 0a77db8b3..fba57a9a2 100644 --- a/deps/oblib/src/lib/stat/ob_diagnose_info.cpp +++ b/deps/oblib/src/lib/stat/ob_diagnose_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/lib/stat/ob_diagnose_info.h b/deps/oblib/src/lib/stat/ob_diagnose_info.h index 9b77ffb99..d446df375 100644 --- a/deps/oblib/src/lib/stat/ob_diagnose_info.h +++ b/deps/oblib/src/lib/stat/ob_diagnose_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_DIAGNOSE_INFO_H_ diff --git a/deps/oblib/src/lib/stat/ob_diagnostic_info.cpp b/deps/oblib/src/lib/stat/ob_diagnostic_info.cpp index c424be2d6..3df312a0f 100644 --- a/deps/oblib/src/lib/stat/ob_diagnostic_info.cpp +++ b/deps/oblib/src/lib/stat/ob_diagnostic_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/lib/stat/ob_diagnostic_info.h b/deps/oblib/src/lib/stat/ob_diagnostic_info.h index 2da81b105..233c54c7e 100644 --- a/deps/oblib/src/lib/stat/ob_diagnostic_info.h +++ b/deps/oblib/src/lib/stat/ob_diagnostic_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_DIAGNOSTIC_INFO_H_ diff --git a/deps/oblib/src/lib/stat/ob_diagnostic_info_container.cpp b/deps/oblib/src/lib/stat/ob_diagnostic_info_container.cpp index 0ae042b14..fe9634ba5 100644 --- a/deps/oblib/src/lib/stat/ob_diagnostic_info_container.cpp +++ b/deps/oblib/src/lib/stat/ob_diagnostic_info_container.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/lib/stat/ob_diagnostic_info_container.h b/deps/oblib/src/lib/stat/ob_diagnostic_info_container.h index 0704d3ff3..9f7720531 100644 --- a/deps/oblib/src/lib/stat/ob_diagnostic_info_container.h +++ b/deps/oblib/src/lib/stat/ob_diagnostic_info_container.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_DIAGNOSTIC_INFO_CONTAINER_H_ @@ -197,4 +201,4 @@ class ObDiagnosticInfoContainer } /* namespace common */ } /* namespace oceanbase */ -#endif /* OB_DIAGNOSTIC_INFO_CONTAINER_H_ */ \ No newline at end of file +#endif /* OB_DIAGNOSTIC_INFO_CONTAINER_H_ */ diff --git a/deps/oblib/src/lib/stat/ob_diagnostic_info_guard.cpp b/deps/oblib/src/lib/stat/ob_diagnostic_info_guard.cpp index 3abaf962e..5132072a3 100644 --- a/deps/oblib/src/lib/stat/ob_diagnostic_info_guard.cpp +++ b/deps/oblib/src/lib/stat/ob_diagnostic_info_guard.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/lib/stat/ob_diagnostic_info_guard.h b/deps/oblib/src/lib/stat/ob_diagnostic_info_guard.h index b2b99104d..190927533 100644 --- a/deps/oblib/src/lib/stat/ob_diagnostic_info_guard.h +++ b/deps/oblib/src/lib/stat/ob_diagnostic_info_guard.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_DIAGNOSTIC_INFO_GUARD_H_ diff --git a/deps/oblib/src/lib/stat/ob_diagnostic_info_summary.cpp b/deps/oblib/src/lib/stat/ob_diagnostic_info_summary.cpp index a1fc190f1..8a23e4461 100644 --- a/deps/oblib/src/lib/stat/ob_diagnostic_info_summary.cpp +++ b/deps/oblib/src/lib/stat/ob_diagnostic_info_summary.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/lib/stat/ob_diagnostic_info_summary.h b/deps/oblib/src/lib/stat/ob_diagnostic_info_summary.h index de18fc7a9..d288bc85a 100644 --- a/deps/oblib/src/lib/stat/ob_diagnostic_info_summary.h +++ b/deps/oblib/src/lib/stat/ob_diagnostic_info_summary.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_DIAGNOSTIC_SUMMARY_H_ @@ -215,4 +219,4 @@ class ObBaseDiagnosticInfoSummary } /* namespace common */ } /* namespace oceanbase */ -#endif /* OB_DIAGNOSTIC_SUMMARY_H_ */ \ No newline at end of file +#endif /* OB_DIAGNOSTIC_SUMMARY_H_ */ diff --git a/deps/oblib/src/lib/stat/ob_diagnostic_info_util.cpp b/deps/oblib/src/lib/stat/ob_diagnostic_info_util.cpp index f8ee3d4cf..383583451 100644 --- a/deps/oblib/src/lib/stat/ob_diagnostic_info_util.cpp +++ b/deps/oblib/src/lib/stat/ob_diagnostic_info_util.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/lib/stat/ob_diagnostic_info_util.h b/deps/oblib/src/lib/stat/ob_diagnostic_info_util.h index b6d659be2..ac6eaed5a 100644 --- a/deps/oblib/src/lib/stat/ob_diagnostic_info_util.h +++ b/deps/oblib/src/lib/stat/ob_diagnostic_info_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_DIAGNOSTIC_INFO_UTIL_H_ @@ -37,4 +41,4 @@ extern share::ObActiveSessHistList* lib_get_ash_list_instance(); } // namespace common } // namespace oceanbase -#endif /* OB_DIAGNOSTIC_INFO_UTIL_H_ */ \ No newline at end of file +#endif /* OB_DIAGNOSTIC_INFO_UTIL_H_ */ diff --git a/deps/oblib/src/lib/stat/ob_latch_define.cpp b/deps/oblib/src/lib/stat/ob_latch_define.cpp index 89f8ba56d..993d9b4d2 100644 --- a/deps/oblib/src/lib/stat/ob_latch_define.cpp +++ b/deps/oblib/src/lib/stat/ob_latch_define.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/stat/ob_latch_define.h" @@ -29,7 +33,7 @@ LATCH_DEF_##enable(def, id, name, policy, max_spin_cnt, max_yield_cnt) #undef LATCH_DEF_true #undef LATCH_DEF_false -static_assert(ARRAYSIZEOF(OB_LATCHES) == 264, "DO NOT delete latch defination"); +static_assert(ARRAYSIZEOF(OB_LATCHES) == 265, "DO NOT delete latch defination"); static_assert(ObLatchIds::LATCH_END == ARRAYSIZEOF(OB_LATCHES) - 1, "update id of LATCH_END before adding your defination"); } diff --git a/deps/oblib/src/lib/stat/ob_latch_define.h b/deps/oblib/src/lib/stat/ob_latch_define.h index c92d3b261..7880bc017 100644 --- a/deps/oblib/src/lib/stat/ob_latch_define.h +++ b/deps/oblib/src/lib/stat/ob_latch_define.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef LATCH_DEF @@ -351,7 +355,7 @@ LATCH_DEF(DEVICE_MANIFEST_RW_LOCK, 320, "device manifest rw lock", LATCH_READ_PR LATCH_DEF(MANIFEST_TASK_LOCK, 321, "manifest task lock", LATCH_FIFO, 2000, 0, true) LATCH_DEF(OB_DEVICE_CREDENTIAL_MGR_LOCK, 322, "device credential mgr rw lock", LATCH_READ_PREFER, 2000, 0, true) LATCH_DEF(DISK_SPACE_MANAGER_LOCK, 323, "share storage disk space manager lock", LATCH_FIFO, INT64_MAX, 0, true) -LATCH_DEF(MC_PREWARM_LOCK, 324, "major compaction prewarm lock", LATCH_FIFO, 2000, 0, true) // FARM COMPAT WHITELIST, 432之后改名 +LATCH_DEF(MC_PREWARM_LOCK, 324, "major compaction prewarm lock", LATCH_FIFO, 2000, 0, true) // FARM COMPATIBILITY WHITELIST, renamed after 432 LATCH_DEF(TSLOG_PROCESSING_MUTEX, 325, "tslog processing mutex", LATCH_FIFO, INT64_MAX, 0, true) LATCH_DEF(TSLOG_CKPT_LOCK, 326, "tslog checkpoint lock", LATCH_FIFO, INT64_MAX, 0, true) LATCH_DEF(FILE_MANAGER_LOCK, 327, "file manager lock", LATCH_FIFO, INT64_MAX, 0, true) @@ -387,8 +391,9 @@ LATCH_DEF(STORAGE_CACHE_POLICY_MGR_LOCK, 353, "storage cache policy lock", LATCH LATCH_DEF(STORAGE_CACHE_POLICY_TASK_LOCK, 354, "storage cache policy task lock", LATCH_READ_PREFER, 2000, 0, true) LATCH_DEF(UNIQUE_CHECKING_CONTEXT_LOCK, 355, "unique checking context lock", LATCH_FIFO, 2000, 0, true) LATCH_DEF(TABLET_SPLIT_CONTEXT_LOCK, 356, "tablet split context lock", LATCH_FIFO, 2000, 0, true) +LATCH_DEF(HYBRID_VECTOR_LOCK, 357, "hybrid vector lock", LATCH_FIFO, 2000, 0, true)// only use in hybrid vector -LATCH_DEF(LATCH_END, 357, "latch end", LATCH_FIFO, 2000, 0, true) +LATCH_DEF(LATCH_END, 358, "latch end", LATCH_FIFO, 2000, 0, true) #endif diff --git a/deps/oblib/src/lib/stat/ob_session_stat.cpp b/deps/oblib/src/lib/stat/ob_session_stat.cpp index ee6e03c8f..482b604b8 100644 --- a/deps/oblib/src/lib/stat/ob_session_stat.cpp +++ b/deps/oblib/src/lib/stat/ob_session_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/lib/stat/ob_session_stat.h b/deps/oblib/src/lib/stat/ob_session_stat.h index 6ac11fffe..a86d424d8 100644 --- a/deps/oblib/src/lib/stat/ob_session_stat.h +++ b/deps/oblib/src/lib/stat/ob_session_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_SESSION_STAT_H_ diff --git a/deps/oblib/src/lib/stat/ob_stat_template.cpp b/deps/oblib/src/lib/stat/ob_stat_template.cpp index 6fdb0a37f..54b2802d6 100644 --- a/deps/oblib/src/lib/stat/ob_stat_template.cpp +++ b/deps/oblib/src/lib/stat/ob_stat_template.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_stat_template.h" diff --git a/deps/oblib/src/lib/stat/ob_stat_template.h b/deps/oblib/src/lib/stat/ob_stat_template.h index 01d57b96b..0facdd465 100644 --- a/deps/oblib/src/lib/stat/ob_stat_template.h +++ b/deps/oblib/src/lib/stat/ob_stat_template.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_STAT_TEMPLATE_H_ diff --git a/deps/oblib/src/lib/statistic_event/ob_stat_class.h b/deps/oblib/src/lib/statistic_event/ob_stat_class.h index 06a780504..112912e6c 100644 --- a/deps/oblib/src/lib/statistic_event/ob_stat_class.h +++ b/deps/oblib/src/lib/statistic_event/ob_stat_class.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef STAT_CLASS_DEF diff --git a/deps/oblib/src/lib/statistic_event/ob_stat_event.cpp b/deps/oblib/src/lib/statistic_event/ob_stat_event.cpp index 99aa57fcb..946531d28 100644 --- a/deps/oblib/src/lib/statistic_event/ob_stat_event.cpp +++ b/deps/oblib/src/lib/statistic_event/ob_stat_event.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/statistic_event/ob_stat_event.h" diff --git a/deps/oblib/src/lib/statistic_event/ob_stat_event.h b/deps/oblib/src/lib/statistic_event/ob_stat_event.h index cea01aa81..6613ff5a9 100644 --- a/deps/oblib/src/lib/statistic_event/ob_stat_event.h +++ b/deps/oblib/src/lib/statistic_event/ob_stat_event.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef STAT_EVENT_ADD_DEF @@ -437,8 +441,6 @@ STAT_EVENT_ADD_DEF(CLOG_EXTLOG_FETCH_RPC_COUNT, "external log service fetch rpc // CLOG.PROXY -// ELECTION - //OBSERVER // rootservice @@ -878,11 +880,7 @@ STAT_EVENT_SET_DEF(HIDDEN_SYS_DATA_DISK_SIZE, "hidden sys data disk size", ObSta // DEBUG STAT_EVENT_SET_DEF(OBLOGGER_WRITE_SIZE, "oblogger log bytes", ObStatClassIds::DEBUG, 160001, false, true, true) -STAT_EVENT_SET_DEF(ELECTION_WRITE_SIZE, "election log bytes", ObStatClassIds::DEBUG, 160002, false, true, true) -STAT_EVENT_SET_DEF(ROOTSERVICE_WRITE_SIZE, "rootservice log bytes", ObStatClassIds::DEBUG, 160003, false, true, true) STAT_EVENT_SET_DEF(OBLOGGER_TOTAL_WRITE_COUNT, "oblogger total log count", ObStatClassIds::DEBUG, 160004, false, true, true) -STAT_EVENT_SET_DEF(ELECTION_TOTAL_WRITE_COUNT, "election total log count", ObStatClassIds::DEBUG, 160005, false, true, true) -STAT_EVENT_SET_DEF(ROOTSERVICE_TOTAL_WRITE_COUNT, "rootservice total log count", ObStatClassIds::DEBUG, 160006, false, true, true) STAT_EVENT_SET_DEF(ASYNC_ERROR_LOG_DROPPED_COUNT, "async error log dropped count", ObStatClassIds::DEBUG, 160019, false, true, true) STAT_EVENT_SET_DEF(ASYNC_WARN_LOG_DROPPED_COUNT, "async warn log dropped count", ObStatClassIds::DEBUG, 160020, false, true, true) STAT_EVENT_SET_DEF(ASYNC_INFO_LOG_DROPPED_COUNT, "async info log dropped count", ObStatClassIds::DEBUG, 160021, false, true, true) diff --git a/deps/oblib/src/lib/string/ob_fixed_length_string.h b/deps/oblib/src/lib/string/ob_fixed_length_string.h index 5dfb570fb..12134e367 100644 --- a/deps/oblib/src/lib/string/ob_fixed_length_string.h +++ b/deps/oblib/src/lib/string/ob_fixed_length_string.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_STRING_OB_FIXED_LENGTH_STRING_H_ diff --git a/deps/oblib/src/lib/string/ob_hex_utils_base.cpp b/deps/oblib/src/lib/string/ob_hex_utils_base.cpp index 7087ce4a0..50d5527e9 100644 --- a/deps/oblib/src/lib/string/ob_hex_utils_base.cpp +++ b/deps/oblib/src/lib/string/ob_hex_utils_base.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/string/ob_hex_utils_base.h b/deps/oblib/src/lib/string/ob_hex_utils_base.h index dd7a7393d..bc2620cca 100644 --- a/deps/oblib/src/lib/string/ob_hex_utils_base.h +++ b/deps/oblib/src/lib/string/ob_hex_utils_base.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_HEX_UTILS_BASE_H_ diff --git a/deps/oblib/src/lib/string/ob_sensitive_string.h b/deps/oblib/src/lib/string/ob_sensitive_string.h index 97c454587..89cf1aaf5 100644 --- a/deps/oblib/src/lib/string/ob_sensitive_string.h +++ b/deps/oblib/src/lib/string/ob_sensitive_string.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_STRING_OB_SENSITIVE_STRING @@ -72,4 +76,4 @@ class ObSensitiveString } // end namespace common } // end namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/string/ob_sql_string.cpp b/deps/oblib/src/lib/string/ob_sql_string.cpp index 682646a3d..389ecfc45 100644 --- a/deps/oblib/src/lib/string/ob_sql_string.cpp +++ b/deps/oblib/src/lib/string/ob_sql_string.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/string/ob_sql_string.h b/deps/oblib/src/lib/string/ob_sql_string.h index 30dec56ef..6246e44ea 100644 --- a/deps/oblib/src/lib/string/ob_sql_string.h +++ b/deps/oblib/src/lib/string/ob_sql_string.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_SQL_STRING_H_ diff --git a/deps/oblib/src/lib/string/ob_string.cpp b/deps/oblib/src/lib/string/ob_string.cpp index 5d87f4b66..ca8a07a37 100644 --- a/deps/oblib/src/lib/string/ob_string.cpp +++ b/deps/oblib/src/lib/string/ob_string.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/string/ob_string.h" diff --git a/deps/oblib/src/lib/string/ob_string.h b/deps/oblib/src/lib/string/ob_string.h index 9a2aabc2c..f69118679 100644 --- a/deps/oblib/src/lib/string/ob_string.h +++ b/deps/oblib/src/lib/string/ob_string.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_STRING_H_ @@ -302,6 +306,35 @@ class ObString final return OB_SUCCESS; } + inline bool case_compare_equal(const ObString &obstr) const + { + bool cmp = true; + if (NULL == ptr_) { + if (NULL != obstr.ptr_) { + cmp = false; + } + } else if (NULL == obstr.ptr_) { + cmp = false; + } else if (data_length_ != obstr.data_length_) { + cmp = false; + } else { + cmp = (0 == strncasecmp(ptr_, obstr.ptr_, data_length_)); + } + + return cmp; + } + + inline bool case_compare_equal(const char *str) const + { + obstr_size_t len = 0; + if (NULL != str) { + len = static_cast(strlen(str)); + } + char *p = const_cast(str); + const ObString rv(0, len, p); + return case_compare_equal(rv); + } + inline int case_compare(const ObString &obstr) const { int cmp = 0; @@ -331,6 +364,31 @@ class ObString final return case_compare(rv); } + inline bool compare_equal(const ObString &obstr) const + { + bool cmp = true; + if (ptr_ == obstr.ptr_) { + cmp = data_length_ == obstr.data_length_; + } else if (0 == data_length_ && 0 == obstr.data_length_) { + cmp = true; + } else if (data_length_ != obstr.data_length_) { + cmp = false; + } else { + cmp = (0 == MEMCMP(ptr_, obstr.ptr_, data_length_)); + } + return cmp; + } + + inline bool compare_equal(const char *str) const + { + obstr_size_t len = 0; + if (NULL != str) { + len = static_cast(strlen(str)); + } + char *p = const_cast(str); + const ObString rv(0, len, p); + return compare_equal(rv); + } inline int compare(const ObString &obstr) const { @@ -434,7 +492,7 @@ class ObString final char *p = const_cast(str); const ObString rv(0, len, p); return prefix_match_ci(rv); - } + } inline obstr_size_t shrink() { diff --git a/deps/oblib/src/lib/string/ob_string_buffer.cpp b/deps/oblib/src/lib/string/ob_string_buffer.cpp index f194cdec7..825d51a8c 100644 --- a/deps/oblib/src/lib/string/ob_string_buffer.cpp +++ b/deps/oblib/src/lib/string/ob_string_buffer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -186,4 +190,4 @@ const ObString ObStringBuffer::string() const } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/string/ob_string_buffer.h b/deps/oblib/src/lib/string/ob_string_buffer.h index 11ddd97d4..67f83bf32 100644 --- a/deps/oblib/src/lib/string/ob_string_buffer.h +++ b/deps/oblib/src/lib/string/ob_string_buffer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_STRING_OB_STRING_BUFFER_ @@ -79,4 +83,4 @@ class ObStringBuffer } // namespace common } // namespace oceanbase -#endif // OCEANBASE_LIB_STRING_OB_STRING_BUFFER_ \ No newline at end of file +#endif // OCEANBASE_LIB_STRING_OB_STRING_BUFFER_ diff --git a/deps/oblib/src/lib/string/ob_string_holder.h b/deps/oblib/src/lib/string/ob_string_holder.h index b1cc6309d..836ee7906 100644 --- a/deps/oblib/src/lib/string/ob_string_holder.h +++ b/deps/oblib/src/lib/string/ob_string_holder.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LIB_STRING_OB_STRING_HOLDER_H diff --git a/deps/oblib/src/lib/string/ob_strings.cpp b/deps/oblib/src/lib/string/ob_strings.cpp index daa8b9ca9..9eaf87940 100644 --- a/deps/oblib/src/lib/string/ob_strings.cpp +++ b/deps/oblib/src/lib/string/ob_strings.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/string/ob_strings.h b/deps/oblib/src/lib/string/ob_strings.h index 83f797a39..d6edf9e61 100644 --- a/deps/oblib/src/lib/string/ob_strings.h +++ b/deps/oblib/src/lib/string/ob_strings.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_OB_STRINGS_H_ diff --git a/deps/oblib/src/lib/task/ob_timer.cpp b/deps/oblib/src/lib/task/ob_timer.cpp index 0fa5b3378..6911c0ace 100644 --- a/deps/oblib/src/lib/task/ob_timer.cpp +++ b/deps/oblib/src/lib/task/ob_timer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_timer.h" diff --git a/deps/oblib/src/lib/task/ob_timer.h b/deps/oblib/src/lib/task/ob_timer.h index a9240238e..10b610922 100644 --- a/deps/oblib/src/lib/task/ob_timer.h +++ b/deps/oblib/src/lib/task/ob_timer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_TIMER_ diff --git a/deps/oblib/src/lib/task/ob_timer_monitor.cpp b/deps/oblib/src/lib/task/ob_timer_monitor.cpp index 4d1c08b06..b316fa72f 100644 --- a/deps/oblib/src/lib/task/ob_timer_monitor.cpp +++ b/deps/oblib/src/lib/task/ob_timer_monitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/task/ob_timer_monitor.h" diff --git a/deps/oblib/src/lib/task/ob_timer_monitor.h b/deps/oblib/src/lib/task/ob_timer_monitor.h index 779776c60..7b6099e6a 100644 --- a/deps/oblib/src/lib/task/ob_timer_monitor.h +++ b/deps/oblib/src/lib/task/ob_timer_monitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_TIMER_MONITOR_ diff --git a/deps/oblib/src/lib/task/ob_timer_service.cpp b/deps/oblib/src/lib/task/ob_timer_service.cpp index 1758cfea9..54770d502 100644 --- a/deps/oblib/src/lib/task/ob_timer_service.cpp +++ b/deps/oblib/src/lib/task/ob_timer_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/lib/task/ob_timer_service.h b/deps/oblib/src/lib/task/ob_timer_service.h index eeee42b82..c54117d9b 100644 --- a/deps/oblib/src/lib/task/ob_timer_service.h +++ b/deps/oblib/src/lib/task/ob_timer_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_TIMER_SERVICE_ diff --git a/deps/oblib/src/lib/tc/deps/atomic.h b/deps/oblib/src/lib/tc/deps/atomic.h index 58e7b9b45..3fd55c9a2 100644 --- a/deps/oblib/src/lib/tc/deps/atomic.h +++ b/deps/oblib/src/lib/tc/deps/atomic.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef ATOMIC_LOAD #define ATOMIC_LOAD(x) __atomic_load_n((x), __ATOMIC_ACQUIRE) diff --git a/deps/oblib/src/lib/tc/deps/batch_pop_queue.h b/deps/oblib/src/lib/tc/deps/batch_pop_queue.h index 3b3842e12..a6abfa568 100644 --- a/deps/oblib/src/lib/tc/deps/batch_pop_queue.h +++ b/deps/oblib/src/lib/tc/deps/batch_pop_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ class BatchPopQueue { diff --git a/deps/oblib/src/lib/tc/deps/define.h b/deps/oblib/src/lib/tc/deps/define.h index 06e9d2e60..cc82725f5 100644 --- a/deps/oblib/src/lib/tc/deps/define.h +++ b/deps/oblib/src/lib/tc/deps/define.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef TC_INFO #define TC_INFO(format, ...) fprintf(stderr, format "\n", ##__VA_ARGS__) diff --git a/deps/oblib/src/lib/tc/deps/deps.h b/deps/oblib/src/lib/tc/deps/deps.h index 241b9c54c..d3a42ec4c 100644 --- a/deps/oblib/src/lib/tc/deps/deps.h +++ b/deps/oblib/src/lib/tc/deps/deps.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once #include diff --git a/deps/oblib/src/lib/tc/deps/drwlock.h b/deps/oblib/src/lib/tc/deps/drwlock.h index 595514a76..229cfb16e 100644 --- a/deps/oblib/src/lib/tc/deps/drwlock.h +++ b/deps/oblib/src/lib/tc/deps/drwlock.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ struct QRWLock { diff --git a/deps/oblib/src/lib/tc/deps/fifo_alloc.h b/deps/oblib/src/lib/tc/deps/fifo_alloc.h index dcb8cbfeb..4a930aee2 100644 --- a/deps/oblib/src/lib/tc/deps/fifo_alloc.h +++ b/deps/oblib/src/lib/tc/deps/fifo_alloc.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include #define MAGIC 0xdeadbeafdeadbeafULL diff --git a/deps/oblib/src/lib/tc/deps/futex.h b/deps/oblib/src/lib/tc/deps/futex.h index b0973c325..510fe9b91 100644 --- a/deps/oblib/src/lib/tc/deps/futex.h +++ b/deps/oblib/src/lib/tc/deps/futex.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include #include diff --git a/deps/oblib/src/lib/tc/deps/get_us.h b/deps/oblib/src/lib/tc/deps/get_us.h index a8c1135cc..ef393cd1f 100644 --- a/deps/oblib/src/lib/tc/deps/get_us.h +++ b/deps/oblib/src/lib/tc/deps/get_us.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ // static int64_t tc_get_us() diff --git a/deps/oblib/src/lib/tc/deps/link.h b/deps/oblib/src/lib/tc/deps/link.h index d4b18c3db..bd48c2599 100644 --- a/deps/oblib/src/lib/tc/deps/link.h +++ b/deps/oblib/src/lib/tc/deps/link.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ static void link_del(TCLink* h, TCLink* p) diff --git a/deps/oblib/src/lib/tc/deps/lock.h b/deps/oblib/src/lib/tc/deps/lock.h index befaf2d41..2a7a2c121 100644 --- a/deps/oblib/src/lib/tc/deps/lock.h +++ b/deps/oblib/src/lib/tc/deps/lock.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef QWGuard diff --git a/deps/oblib/src/lib/tc/deps/simple_link_queue.h b/deps/oblib/src/lib/tc/deps/simple_link_queue.h index c0348cd3d..d0f7758bf 100644 --- a/deps/oblib/src/lib/tc/deps/simple_link_queue.h +++ b/deps/oblib/src/lib/tc/deps/simple_link_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ class SimpleTCLinkQueue diff --git a/deps/oblib/src/lib/tc/deps/single_waiter_cond.h b/deps/oblib/src/lib/tc/deps/single_waiter_cond.h index 43dccc764..93d421cf3 100644 --- a/deps/oblib/src/lib/tc/deps/single_waiter_cond.h +++ b/deps/oblib/src/lib/tc/deps/single_waiter_cond.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ class SingleWaiterCond diff --git a/deps/oblib/src/lib/tc/deps/str_format.h b/deps/oblib/src/lib/tc/deps/str_format.h index befe0f730..159825135 100644 --- a/deps/oblib/src/lib/tc/deps/str_format.h +++ b/deps/oblib/src/lib/tc/deps/str_format.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ class StrFormat diff --git a/deps/oblib/src/lib/tc/ob_tc.cpp b/deps/oblib/src/lib/tc/ob_tc.cpp index 129425d92..b907040be 100644 --- a/deps/oblib/src/lib/tc/ob_tc.cpp +++ b/deps/oblib/src/lib/tc/ob_tc.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_tc.h" diff --git a/deps/oblib/src/lib/tc/ob_tc.h b/deps/oblib/src/lib/tc/ob_tc.h index fd4876ba2..40955e006 100644 --- a/deps/oblib/src/lib/tc/ob_tc.h +++ b/deps/oblib/src/lib/tc/ob_tc.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/deps/oblib/src/lib/tc/ob_tc_interface.cpp b/deps/oblib/src/lib/tc/ob_tc_interface.cpp index 8a41faa2e..0bcb7ed4e 100644 --- a/deps/oblib/src/lib/tc/ob_tc_interface.cpp +++ b/deps/oblib/src/lib/tc/ob_tc_interface.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ const int QID_CAPACITY = 1<<10; @@ -379,4 +383,4 @@ int tclimit_get_limit(int limiter_id, int64_t &limit) limit = L->get_limit_per_sec(); } return err; -} \ No newline at end of file +} diff --git a/deps/oblib/src/lib/tc/ob_tc_limit.cpp b/deps/oblib/src/lib/tc/ob_tc_limit.cpp index 282760006..b6df628d6 100644 --- a/deps/oblib/src/lib/tc/ob_tc_limit.cpp +++ b/deps/oblib/src/lib/tc/ob_tc_limit.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ class BytesLimiter: public ITCLimiter diff --git a/deps/oblib/src/lib/tc/ob_tc_stat.cpp b/deps/oblib/src/lib/tc/ob_tc_stat.cpp index 2882560fe..75ea22bc6 100644 --- a/deps/oblib/src/lib/tc/ob_tc_stat.cpp +++ b/deps/oblib/src/lib/tc/ob_tc_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ class QSchedStat { diff --git a/deps/oblib/src/lib/tc/ob_tc_wrapper.cpp b/deps/oblib/src/lib/tc/ob_tc_wrapper.cpp index f9ad27b27..e865cdfad 100644 --- a/deps/oblib/src/lib/tc/ob_tc_wrapper.cpp +++ b/deps/oblib/src/lib/tc/ob_tc_wrapper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_TC_OB_TC_WRAPPER_H_ #define OCEANBASE_TC_OB_TC_WRAPPER_H_ diff --git a/deps/oblib/src/lib/tc/test/test-2limit.cpp b/deps/oblib/src/lib/tc/test/test-2limit.cpp index cf5ba4716..7dbab63d7 100644 --- a/deps/oblib/src/lib/tc/test/test-2limit.cpp +++ b/deps/oblib/src/lib/tc/test/test-2limit.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ DEF_LIMIT(L1, 1000000); DEF_LIMIT(L2, 4000000); diff --git a/deps/oblib/src/lib/tc/test/test-base.cpp b/deps/oblib/src/lib/tc/test/test-base.cpp index 400fbc9a6..7b7669b87 100644 --- a/deps/oblib/src/lib/tc/test/test-base.cpp +++ b/deps/oblib/src/lib/tc/test/test-base.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include #define info(format,...) fprintf(stderr, format "\n", ## __VA_ARGS__) diff --git a/deps/oblib/src/lib/tc/test/test-fallback.cpp b/deps/oblib/src/lib/tc/test/test-fallback.cpp index 7be71ac75..2a0e24824 100644 --- a/deps/oblib/src/lib/tc/test/test-fallback.cpp +++ b/deps/oblib/src/lib/tc/test/test-fallback.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ ROOT(root); SCHED(); diff --git a/deps/oblib/src/lib/tc/test/test-limit-1leaf.cpp b/deps/oblib/src/lib/tc/test/test-limit-1leaf.cpp index 202654201..c4f3898f8 100644 --- a/deps/oblib/src/lib/tc/test/test-limit-1leaf.cpp +++ b/deps/oblib/src/lib/tc/test/test-limit-1leaf.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ DEF_LIMIT(L1, 1000000); ROOT(root); diff --git a/deps/oblib/src/lib/tc/test/test-limit-2leaf.cpp b/deps/oblib/src/lib/tc/test/test-limit-2leaf.cpp index e081759c9..97f8b0653 100644 --- a/deps/oblib/src/lib/tc/test/test-limit-2leaf.cpp +++ b/deps/oblib/src/lib/tc/test/test-limit-2leaf.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ DEF_LIMIT(L1, 10000000); ROOT(root); diff --git a/deps/oblib/src/lib/tc/test/test-limit-4leaf.cpp b/deps/oblib/src/lib/tc/test/test-limit-4leaf.cpp index d755e74cb..4f393c9e4 100644 --- a/deps/oblib/src/lib/tc/test/test-limit-4leaf.cpp +++ b/deps/oblib/src/lib/tc/test/test-limit-4leaf.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ DEF_LIMIT(L1, 1000000); ROOT(root); diff --git a/deps/oblib/src/lib/tc/test/test-limit-clog-2leaf.cpp b/deps/oblib/src/lib/tc/test/test-limit-clog-2leaf.cpp index f81543cc8..c9be1f612 100644 --- a/deps/oblib/src/lib/tc/test/test-limit-clog-2leaf.cpp +++ b/deps/oblib/src/lib/tc/test/test-limit-clog-2leaf.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ ROOT(root); diff --git a/deps/oblib/src/lib/tc/test/test-limit-top.cpp b/deps/oblib/src/lib/tc/test/test-limit-top.cpp index 98736baa5..7ede13380 100644 --- a/deps/oblib/src/lib/tc/test/test-limit-top.cpp +++ b/deps/oblib/src/lib/tc/test/test-limit-top.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ DEF_COUNT_LIMIT(L1, 10000); diff --git a/deps/oblib/src/lib/tc/test/test-ob.cpp b/deps/oblib/src/lib/tc/test/test-ob.cpp index 9f053eb06..9d7a9c5b7 100644 --- a/deps/oblib/src/lib/tc/test/test-ob.cpp +++ b/deps/oblib/src/lib/tc/test/test-ob.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define MAX_GROUP_STAT 30 DEF_COUNT_LIMIT(B1R, 10000); diff --git a/deps/oblib/src/lib/tc/test/test-over-reserve-2leaf.cpp b/deps/oblib/src/lib/tc/test/test-over-reserve-2leaf.cpp index f737c53aa..18a998f5a 100644 --- a/deps/oblib/src/lib/tc/test/test-over-reserve-2leaf.cpp +++ b/deps/oblib/src/lib/tc/test/test-over-reserve-2leaf.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ ROOT(root); SHARED(t1, root, 1); diff --git a/deps/oblib/src/lib/tc/test/test-perf.cpp b/deps/oblib/src/lib/tc/test/test-perf.cpp index 5c22dec74..df255c70f 100644 --- a/deps/oblib/src/lib/tc/test/test-perf.cpp +++ b/deps/oblib/src/lib/tc/test/test-perf.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ ROOT(root); int fifos = cfgi("fifos", "4"); diff --git a/deps/oblib/src/lib/tc/test/test-plimit.cpp b/deps/oblib/src/lib/tc/test/test-plimit.cpp index fc46a60e1..a656f6b40 100644 --- a/deps/oblib/src/lib/tc/test/test-plimit.cpp +++ b/deps/oblib/src/lib/tc/test/test-plimit.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ DEF_LIMIT(L1, 1000000); ROOT(root); diff --git a/deps/oblib/src/lib/tc/test/test-plimit2.cpp b/deps/oblib/src/lib/tc/test/test-plimit2.cpp index 86dac9bdd..0d335d7f3 100644 --- a/deps/oblib/src/lib/tc/test/test-plimit2.cpp +++ b/deps/oblib/src/lib/tc/test/test-plimit2.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ DEF_LIMIT(L1, 1000000); ROOT(root); diff --git a/deps/oblib/src/lib/tc/test/test-reserve-1leaf.cpp b/deps/oblib/src/lib/tc/test/test-reserve-1leaf.cpp index 68fa7c1d0..a863db447 100644 --- a/deps/oblib/src/lib/tc/test/test-reserve-1leaf.cpp +++ b/deps/oblib/src/lib/tc/test/test-reserve-1leaf.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ DEF_COUNT_LIMIT(L1, 80000); ROOT(root); diff --git a/deps/oblib/src/lib/tc/test/test-reserve-2leaf.cpp b/deps/oblib/src/lib/tc/test/test-reserve-2leaf.cpp index 480607e01..214969905 100644 --- a/deps/oblib/src/lib/tc/test/test-reserve-2leaf.cpp +++ b/deps/oblib/src/lib/tc/test/test-reserve-2leaf.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ DEF_COUNT_LIMIT(L1, 8000); DEF_COUNT_LIMIT(L2, 10000); diff --git a/deps/oblib/src/lib/tc/test/test-reserve-4leaf.cpp b/deps/oblib/src/lib/tc/test/test-reserve-4leaf.cpp index 3ac014f94..4d981e520 100644 --- a/deps/oblib/src/lib/tc/test/test-reserve-4leaf.cpp +++ b/deps/oblib/src/lib/tc/test/test-reserve-4leaf.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ DEF_LIMIT(L1, 100 * 8000); DEF_LIMIT(L2, 100 * 10000); diff --git a/deps/oblib/src/lib/tc/test/test-reserve-clog-2leaf.cpp b/deps/oblib/src/lib/tc/test/test-reserve-clog-2leaf.cpp index 54971b881..87cbdfa8e 100644 --- a/deps/oblib/src/lib/tc/test/test-reserve-clog-2leaf.cpp +++ b/deps/oblib/src/lib/tc/test/test-reserve-clog-2leaf.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ ROOT(root); diff --git a/deps/oblib/src/lib/tc/test/test-reserve-clog-4leaf.cpp b/deps/oblib/src/lib/tc/test/test-reserve-clog-4leaf.cpp index 42d468a0a..6974f4302 100644 --- a/deps/oblib/src/lib/tc/test/test-reserve-clog-4leaf.cpp +++ b/deps/oblib/src/lib/tc/test/test-reserve-clog-4leaf.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ ROOT(root); diff --git a/deps/oblib/src/lib/tc/test/test-weight-L2.cpp b/deps/oblib/src/lib/tc/test/test-weight-L2.cpp index c24c40296..743c3c363 100644 --- a/deps/oblib/src/lib/tc/test/test-weight-L2.cpp +++ b/deps/oblib/src/lib/tc/test/test-weight-L2.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ ROOT(root); SHARED(tt1, root, 1); diff --git a/deps/oblib/src/lib/tc/test/test-weight.cpp b/deps/oblib/src/lib/tc/test/test-weight.cpp index 0413b29a4..20de3dc87 100644 --- a/deps/oblib/src/lib/tc/test/test-weight.cpp +++ b/deps/oblib/src/lib/tc/test/test-weight.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ DEF_COUNT_LIMIT(L1, 5000); diff --git a/deps/oblib/src/lib/thread/launcher.h b/deps/oblib/src/lib/thread/launcher.h index eca36bbd4..1e793aac2 100644 --- a/deps/oblib/src/lib/thread/launcher.h +++ b/deps/oblib/src/lib/thread/launcher.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ namespace oceanbase { @@ -57,39 +61,38 @@ namespace lib { // } // } //// -// 整体原则 +// Overall principle // -// 1. Launcher状态转换规则: +// 1. Launcher state transition rules: // // init/destroy start stop -// 未初始化 <===> 初始化未启动 ==> 已启动 ==> 正在停止 +// Uninitialized <===> Initialization not started ==> Started ==> Stopping // /\ || // || wait || // \=======================/ // -// 2. init和destroy配对出现,start和stop配对出现。 -// 3. init不要启动线程,也不要到destroy中再停线程,这会打乱外层的逻辑。 -// 4. 实现init时,如果中途失败需要调用已经init成功成员的destroy函数, -// 不要出现多余的状态。start函数同理。 -// 5. 错误的状态转移,比如“未初始化”时调用start方法,属于要修复的BUG。 -// 推荐打印ERROR日志提早暴露。 -// 6. 所有自包含线程的类都应该继承并遵循这套规则。 +// 2. init and destroy appear in pairs, start and stop appear in pairs. +// 3. do not start the thread in init, nor stop the thread in destroy, this will disrupt the outer logic. +// 4. Implement init, if it fails midway, need to call the destroy function of already successfully initialized members, +// Do not have extra states. start function similarly. +// 5. Error state transition, for example, calling the start method when "uninitialized", belongs to a bug that needs to be fixed. +// Recommend printing ERROR logs to expose issues early. +// 6. All self-contained thread classes should inherit and follow this set of rules. // class ILauncher { public: virtual ~ILauncher() {} - - // 初始化资源 + // Initialize resources virtual int init() = 0; - // 启动线程 + // Start thread virtual int start() = 0; - // 停止线程 + // Stop thread // - // 注意该接口返回并不保证线程已经停止,只有调用wait返回了才表示线程已经退出。 + // Note that the interface return does not guarantee that the thread has already stopped, only when wait returns does it indicate that the thread has exited. virtual void stop() = 0; - // 和stop接口配合使用,wait返回表示所有线程都已经成功退出。 + // Use in conjunction with the stop interface, wait returns indicating that all threads have successfully exited. virtual void wait() = 0; - // 释放资源。 + // Release resources. virtual void destroy() = 0; }; diff --git a/deps/oblib/src/lib/thread/ob_async_task_queue.cpp b/deps/oblib/src/lib/thread/ob_async_task_queue.cpp index 117e26eda..1aa48337e 100644 --- a/deps/oblib/src/lib/thread/ob_async_task_queue.cpp +++ b/deps/oblib/src/lib/thread/ob_async_task_queue.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE @@ -117,7 +121,7 @@ void ObAsyncTaskQueue::run2() while (!stop_) { IGNORE_RETURN lib::Thread::update_loop_ts(ObTimeUtility::fast_current_time()); if (REACH_TIME_INTERVAL(600 * 1000 * 1000)) { - //每隔一段时间,打印队列的大小 + // Print the size of the queue at regular intervals LOG_INFO("[ASYNC TASK QUEUE]", "queue_size", queue_.size()); } ObAsyncTask *task = NULL; diff --git a/deps/oblib/src/lib/thread/ob_async_task_queue.h b/deps/oblib/src/lib/thread/ob_async_task_queue.h index dabf83fd5..aad0b52f4 100644 --- a/deps/oblib/src/lib/thread/ob_async_task_queue.h +++ b/deps/oblib/src/lib/thread/ob_async_task_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SHARE_OB_ASYNC_TASK_QUEUE_H_ diff --git a/deps/oblib/src/lib/thread/ob_dynamic_thread_pool.cpp b/deps/oblib/src/lib/thread/ob_dynamic_thread_pool.cpp index 697a1bb2c..042b0168e 100644 --- a/deps/oblib/src/lib/thread/ob_dynamic_thread_pool.cpp +++ b/deps/oblib/src/lib/thread/ob_dynamic_thread_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_dynamic_thread_pool.h" diff --git a/deps/oblib/src/lib/thread/ob_dynamic_thread_pool.h b/deps/oblib/src/lib/thread/ob_dynamic_thread_pool.h index 9bd0531d3..09f268edf 100644 --- a/deps/oblib/src/lib/thread/ob_dynamic_thread_pool.h +++ b/deps/oblib/src/lib/thread/ob_dynamic_thread_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_LIBRARY_SRC_LIB_THREAD_OB_DYNAMIC_THREAD_POOL_H_ diff --git a/deps/oblib/src/lib/thread/ob_map_queue.h b/deps/oblib/src/lib/thread/ob_map_queue.h index eb4106656..08dda5899 100644 --- a/deps/oblib/src/lib/thread/ob_map_queue.h +++ b/deps/oblib/src/lib/thread/ob_map_queue.h @@ -1,15 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. * - * Multi-thread queue based on hash map. + * Licensed 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. */ #ifndef OCEANBASE_MAP_QUEUE_H__ diff --git a/deps/oblib/src/lib/thread/ob_map_queue_thread_pool.cpp b/deps/oblib/src/lib/thread/ob_map_queue_thread_pool.cpp index 59befb151..476f5dd50 100644 --- a/deps/oblib/src/lib/thread/ob_map_queue_thread_pool.cpp +++ b/deps/oblib/src/lib/thread/ob_map_queue_thread_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/src/lib/thread/ob_map_queue_thread_pool.h b/deps/oblib/src/lib/thread/ob_map_queue_thread_pool.h index ef129ee22..ec5c7bbaa 100644 --- a/deps/oblib/src/lib/thread/ob_map_queue_thread_pool.h +++ b/deps/oblib/src/lib/thread/ob_map_queue_thread_pool.h @@ -1,15 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. * - * Thread pool with ObMapQueue + * Licensed 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. */ #ifndef OCEANBASE_COMMON_MAP_QUEUE_THREAD_POOL_H__ diff --git a/deps/oblib/src/lib/thread/ob_multi_fixed_queue_thread.h b/deps/oblib/src/lib/thread/ob_multi_fixed_queue_thread.h index 312320d5b..6b71dd182 100644 --- a/deps/oblib/src/lib/thread/ob_multi_fixed_queue_thread.h +++ b/deps/oblib/src/lib/thread/ob_multi_fixed_queue_thread.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_MULTI_FIXED_QUEUE_THREAD_H__ @@ -25,8 +29,7 @@ namespace oceanbase { namespace common { - -// ModuleClass: 标识使用该线程池的目标模块 +// ModuleClass: Identify the target module using this thread pool template class ObMQThread { @@ -58,11 +61,9 @@ class ObMQThread int push(void *data, const uint64_t hash_value, const int64_t timeout); int64_t get_thread_num() const { return thread_num_; } - - // 获取所有队列总任务个数 + // Get the total number of tasks in all queues int get_total_task_num(int64_t &task_count); - - // 获取第thread_idx个线程对应queue待处理任务个数 + // Get the number of pending tasks in queue for thread thread_idx int get_task_num(const int64_t thread_idx, int64_t &task_count); private: @@ -228,11 +229,9 @@ void ObMQThread::run() } } } - - // 退出都调用thread_end() + // Exit all calls thread_end() thread_end(); - - // NOTE: 一个线程退出,其他线程同时退出 + // NOTE: One thread exits, other threads exit simultaneously stop_flag_ = true; } diff --git a/deps/oblib/src/lib/thread/ob_pthread.cpp b/deps/oblib/src/lib/thread/ob_pthread.cpp index fc7449dcb..93f786acf 100644 --- a/deps/oblib/src/lib/thread/ob_pthread.cpp +++ b/deps/oblib/src/lib/thread/ob_pthread.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/thread/threads.h" @@ -74,4 +78,4 @@ pthread_t ob_pthread_get_pth(void *ptr) } return pth; } -} /* extern "C" */ \ No newline at end of file +} /* extern "C" */ diff --git a/deps/oblib/src/lib/thread/ob_reentrant_thread.cpp b/deps/oblib/src/lib/thread/ob_reentrant_thread.cpp index 8d2ab6106..00e46a9f8 100644 --- a/deps/oblib/src/lib/thread/ob_reentrant_thread.cpp +++ b/deps/oblib/src/lib/thread/ob_reentrant_thread.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE diff --git a/deps/oblib/src/lib/thread/ob_reentrant_thread.h b/deps/oblib/src/lib/thread/ob_reentrant_thread.h index 00b9791bb..65339f386 100644 --- a/deps/oblib/src/lib/thread/ob_reentrant_thread.h +++ b/deps/oblib/src/lib/thread/ob_reentrant_thread.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SHARE_OB_REENTRANT_THREAD_H_ diff --git a/deps/oblib/src/lib/thread/ob_simple_thread_pool.h b/deps/oblib/src/lib/thread/ob_simple_thread_pool.h index 4c30f53a2..8460ef2ea 100644 --- a/deps/oblib/src/lib/thread/ob_simple_thread_pool.h +++ b/deps/oblib/src/lib/thread/ob_simple_thread_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_SIMPLE_THREAD_POOL_H_ diff --git a/deps/oblib/src/lib/thread/ob_simple_thread_pool.ipp b/deps/oblib/src/lib/thread/ob_simple_thread_pool.ipp index eebeed553..26f831032 100644 --- a/deps/oblib/src/lib/thread/ob_simple_thread_pool.ipp +++ b/deps/oblib/src/lib/thread/ob_simple_thread_pool.ipp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/thread/ob_thread_name.h" diff --git a/deps/oblib/src/lib/thread/ob_tenant_hook.cpp b/deps/oblib/src/lib/thread/ob_tenant_hook.cpp index 32418d5ab..c3ff9c92e 100644 --- a/deps/oblib/src/lib/thread/ob_tenant_hook.cpp +++ b/deps/oblib/src/lib/thread/ob_tenant_hook.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_TENANT_PRELOAD_H_ diff --git a/deps/oblib/src/lib/thread/ob_thread_lease.h b/deps/oblib/src/lib/thread/ob_thread_lease.h index aa9094b66..c3a45221b 100644 --- a/deps/oblib/src/lib/thread/ob_thread_lease.h +++ b/deps/oblib/src/lib/thread/ob_thread_lease.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_THREAD_LEASE_H__ diff --git a/deps/oblib/src/lib/thread/ob_thread_name.cpp b/deps/oblib/src/lib/thread/ob_thread_name.cpp index 63426ce69..7078a0665 100644 --- a/deps/oblib/src/lib/thread/ob_thread_name.cpp +++ b/deps/oblib/src/lib/thread/ob_thread_name.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/thread/ob_thread_name.h" diff --git a/deps/oblib/src/lib/thread/ob_thread_name.h b/deps/oblib/src/lib/thread/ob_thread_name.h index 26e4ca519..579af619b 100644 --- a/deps/oblib/src/lib/thread/ob_thread_name.h +++ b/deps/oblib/src/lib/thread/ob_thread_name.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_THREAD_OB_THREAD_NAME_H_ diff --git a/deps/oblib/src/lib/thread/ob_work_queue.cpp b/deps/oblib/src/lib/thread/ob_work_queue.cpp index c221ae16b..e8c67082c 100644 --- a/deps/oblib/src/lib/thread/ob_work_queue.cpp +++ b/deps/oblib/src/lib/thread/ob_work_queue.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/thread/ob_work_queue.h b/deps/oblib/src/lib/thread/ob_work_queue.h index 8c39ef1c2..0c1c18791 100644 --- a/deps/oblib/src/lib/thread/ob_work_queue.h +++ b/deps/oblib/src/lib/thread/ob_work_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_WORK_QUEUE_H diff --git a/deps/oblib/src/lib/thread/protected_stack_allocator.cpp b/deps/oblib/src/lib/thread/protected_stack_allocator.cpp index 124069fc3..9ac8ca17f 100644 --- a/deps/oblib/src/lib/thread/protected_stack_allocator.cpp +++ b/deps/oblib/src/lib/thread/protected_stack_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/thread/protected_stack_allocator.h b/deps/oblib/src/lib/thread/protected_stack_allocator.h index bcf1f97d6..eb208d71b 100644 --- a/deps/oblib/src/lib/thread/protected_stack_allocator.h +++ b/deps/oblib/src/lib/thread/protected_stack_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef PROTECTED_STACK_ALLOCATOR diff --git a/deps/oblib/src/lib/thread/thread.cpp b/deps/oblib/src/lib/thread/thread.cpp index 46e15ad18..d10b2d3c3 100644 --- a/deps/oblib/src/lib/thread/thread.cpp +++ b/deps/oblib/src/lib/thread/thread.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -71,7 +75,6 @@ int Thread::start() const int64_t count = ATOMIC_FAA(&total_thread_count_, 1); ObNumaNodeGuard numa_guard(numa_node_); if (count >= get_max_thread_num() - OB_RESERVED_THREAD_NUM) { - ATOMIC_FAA(&total_thread_count_, -1); ret = OB_SIZE_OVERFLOW; LOG_ERROR("thread count reach limit", K(ret), "current count", count); } else if (stack_size_ <= 0) { @@ -108,7 +111,6 @@ int Thread::start() } } if (0 != pret) { - ATOMIC_FAA(&total_thread_count_, -1); ret = OB_ERR_SYS; stop_ = true; } @@ -117,6 +119,7 @@ int Thread::start() } } if (OB_FAIL(ret)) { + ATOMIC_FAA(&total_thread_count_, -1); destroy(); } return ret; @@ -313,8 +316,8 @@ void* Thread::__th_start(void *arg) ret = OB_INVALID_ARGUMENT; LOG_ERROR("invalid argument", K(th), K(ret)); } else { - // pm析构逻辑上会访问其它pthread_key绑定的对象,为了避免析构顺序的影响 - // pm不用TSI而是自己做线程局部(__thread) + // pm destructor logically accesses objects bound to other pthread_key, to avoid the impact of destruction order + // pm does not use TSI but instead does thread-local (__thread) // create page manager ObPageManager pm; ret = pm.set_tenant_ctx(common::OB_SERVER_TENANT_ID, common::ObCtxIds::GLIBC); diff --git a/deps/oblib/src/lib/thread/thread.h b/deps/oblib/src/lib/thread/thread.h index 0fe9c35eb..46473d25b 100644 --- a/deps/oblib/src/lib/thread/thread.h +++ b/deps/oblib/src/lib/thread/thread.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CORO_THREAD_H diff --git a/deps/oblib/src/lib/thread/thread_define.h b/deps/oblib/src/lib/thread/thread_define.h index ac82ba857..fcb3c42b1 100644 --- a/deps/oblib/src/lib/thread/thread_define.h +++ b/deps/oblib/src/lib/thread/thread_define.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef TG_DEF diff --git a/deps/oblib/src/lib/thread/thread_mgr.cpp b/deps/oblib/src/lib/thread/thread_mgr.cpp index df4fb7e27..d0758cc1a 100644 --- a/deps/oblib/src/lib/thread/thread_mgr.cpp +++ b/deps/oblib/src/lib/thread/thread_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/thread/thread_mgr.h" diff --git a/deps/oblib/src/lib/thread/thread_mgr.h b/deps/oblib/src/lib/thread/thread_mgr.h index 06a9d5052..66f9a6ba9 100644 --- a/deps/oblib/src/lib/thread/thread_mgr.h +++ b/deps/oblib/src/lib/thread/thread_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OBLIB_THREAD_MGR_H @@ -1026,7 +1030,7 @@ class TGMgr ITG *tg = nullptr; auto func = create_funcs_[tg_def_id]; if (!func) { - // 不做逻辑,但需要将id占掉 + // No logic, but need to occupy the id alloc_tg_id(start_idx); } else if (FALSE_IT(tg_id = alloc_tg_id(start_idx))) { } else if (tg_id < 0) { @@ -1057,7 +1061,7 @@ class TGMgr ITG *tg = nullptr; auto func = create_funcs_[tg_def_id]; if (!func) { - // 不做逻辑,但需要将id占掉 + // No logic, but need to occupy the id alloc_tg_id(TGDefIDs::END); } else if (FALSE_IT(tg_id = alloc_tg_id(TGDefIDs::END))) { } else if (tg_id < 0) { @@ -1066,7 +1070,7 @@ class TGMgr ret = common::OB_INIT_FAIL; } else { TGHelper *tg_helper = get_tenant_tg_helper(); - // 目前只打印日志 + // Currently only prints log if (OB_ISNULL(tg_helper)) { // ignore ret OB_LOG(WARN, "create tg tenant but tenant tg helper is null", K(tg_def_id), K(tg_id), K(ret)); diff --git a/deps/oblib/src/lib/thread/thread_mgr_interface.cpp b/deps/oblib/src/lib/thread/thread_mgr_interface.cpp index e091ada50..0a848a58d 100644 --- a/deps/oblib/src/lib/thread/thread_mgr_interface.cpp +++ b/deps/oblib/src/lib/thread/thread_mgr_interface.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/thread/thread_mgr_interface.h" diff --git a/deps/oblib/src/lib/thread/thread_mgr_interface.h b/deps/oblib/src/lib/thread/thread_mgr_interface.h index d6bdb255b..ee4c26ce2 100644 --- a/deps/oblib/src/lib/thread/thread_mgr_interface.h +++ b/deps/oblib/src/lib/thread/thread_mgr_interface.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OBLIB_THREAD_MGR_INTERFACE_H diff --git a/deps/oblib/src/lib/thread/thread_pool.h b/deps/oblib/src/lib/thread/thread_pool.h index c80ca571a..187e39506 100644 --- a/deps/oblib/src/lib/thread/thread_pool.h +++ b/deps/oblib/src/lib/thread/thread_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OBLIB_THREAD_POOL_H diff --git a/deps/oblib/src/lib/thread/threads.cpp b/deps/oblib/src/lib/thread/threads.cpp index 216791dfb..c561e0ca8 100644 --- a/deps/oblib/src/lib/thread/threads.cpp +++ b/deps/oblib/src/lib/thread/threads.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -22,8 +26,7 @@ using namespace oceanbase::common; int64_t global_thread_stack_size = (1L << 19) - SIG_STACK_SIZE - ACHUNK_PRESERVE_SIZE; thread_local uint64_t ThreadPool::thread_idx_ = 0; - -// 获取线程局部的租户上下文,为线程池启动时检查使用 +// Get the thread-local tenant context, for use when checking at thread pool startup IRunWrapper *&Threads::get_expect_run_wrapper() { static thread_local IRunWrapper *instance = nullptr; @@ -194,7 +197,7 @@ int Threads::init() int Threads::start() { int ret = OB_SUCCESS; - // 检查租户上下文 + // Check tenant context IRunWrapper *expect_wrapper = get_expect_run_wrapper(); n_threads_ = init_threads_; if (expect_wrapper != nullptr && expect_wrapper != run_wrapper_) { diff --git a/deps/oblib/src/lib/thread/threads.h b/deps/oblib/src/lib/thread/threads.h index e2645c2a1..85f4de864 100644 --- a/deps/oblib/src/lib/thread/threads.h +++ b/deps/oblib/src/lib/thread/threads.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USER_THREAD_H @@ -63,8 +67,8 @@ class Threads int try_thread_recycle(); int init(); - // IRunWrapper 用于创建多租户线程时指定租户上下文 - // cgroup_ctrl 和IRunWrapper配合使用,实现多租户线程的CPU隔离 + // IRunWrapper is used to specify the tenant context when creating multi-tenant threads + // cgroup_ctrl and IRunWrapper work together to achieve CPU isolation for multi-tenant threads void set_run_wrapper(IRunWrapper *run_wrapper) { run_wrapper_ = run_wrapper; diff --git a/deps/oblib/src/lib/thread_local/ob_tsi_factory.h b/deps/oblib/src/lib/thread_local/ob_tsi_factory.h index adf3c5df5..388322199 100644 --- a/deps/oblib/src/lib/thread_local/ob_tsi_factory.h +++ b/deps/oblib/src/lib/thread_local/ob_tsi_factory.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_TSI_FACTORY_ diff --git a/deps/oblib/src/lib/thread_local/ob_tsi_utils.cpp b/deps/oblib/src/lib/thread_local/ob_tsi_utils.cpp index 9a1b0e284..2bc07122b 100644 --- a/deps/oblib/src/lib/thread_local/ob_tsi_utils.cpp +++ b/deps/oblib/src/lib/thread_local/ob_tsi_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_tsi_utils.h" diff --git a/deps/oblib/src/lib/thread_local/ob_tsi_utils.h b/deps/oblib/src/lib/thread_local/ob_tsi_utils.h index b0b8441fe..e044ad0d6 100644 --- a/deps/oblib/src/lib/thread_local/ob_tsi_utils.h +++ b/deps/oblib/src/lib/thread_local/ob_tsi_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_TSI_UTILS_ diff --git a/deps/oblib/src/lib/thread_local/thread_buffer.cpp b/deps/oblib/src/lib/thread_local/thread_buffer.cpp index 64f8d5aea..639b55635 100644 --- a/deps/oblib/src/lib/thread_local/thread_buffer.cpp +++ b/deps/oblib/src/lib/thread_local/thread_buffer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/thread_local/thread_buffer.h" diff --git a/deps/oblib/src/lib/thread_local/thread_buffer.h b/deps/oblib/src/lib/thread_local/thread_buffer.h index 327ddaf3f..9f236883c 100644 --- a/deps/oblib/src/lib/thread_local/thread_buffer.h +++ b/deps/oblib/src/lib/thread_local/thread_buffer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_THREAD_BUFFER_ diff --git a/deps/oblib/src/lib/time/ob_cur_time.cpp b/deps/oblib/src/lib/time/ob_cur_time.cpp index 0ff671981..f44a8d440 100644 --- a/deps/oblib/src/lib/time/ob_cur_time.cpp +++ b/deps/oblib/src/lib/time/ob_cur_time.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/time/ob_cur_time.h" diff --git a/deps/oblib/src/lib/time/ob_cur_time.h b/deps/oblib/src/lib/time/ob_cur_time.h index 8cae04567..8d7652108 100644 --- a/deps/oblib/src/lib/time/ob_cur_time.h +++ b/deps/oblib/src/lib/time/ob_cur_time.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_CUR_TIME_H diff --git a/deps/oblib/src/lib/time/ob_time_utility.cpp b/deps/oblib/src/lib/time/ob_time_utility.cpp index 18f691ad5..02f8fedd5 100644 --- a/deps/oblib/src/lib/time/ob_time_utility.cpp +++ b/deps/oblib/src/lib/time/ob_time_utility.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/time/ob_time_utility.h" diff --git a/deps/oblib/src/lib/time/ob_time_utility.h b/deps/oblib/src/lib/time/ob_time_utility.h index 025ff10d7..5413ded88 100644 --- a/deps/oblib/src/lib/time/ob_time_utility.h +++ b/deps/oblib/src/lib/time/ob_time_utility.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEANBASE_COMMON_OB_TIME_UTILITY_H_ diff --git a/deps/oblib/src/lib/time/ob_tsc_timestamp.cpp b/deps/oblib/src/lib/time/ob_tsc_timestamp.cpp index b2d05252e..918b5a92f 100644 --- a/deps/oblib/src/lib/time/ob_tsc_timestamp.cpp +++ b/deps/oblib/src/lib/time/ob_tsc_timestamp.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_tsc_timestamp.h" diff --git a/deps/oblib/src/lib/time/ob_tsc_timestamp.h b/deps/oblib/src/lib/time/ob_tsc_timestamp.h index f4d8a6c9d..43b7bb163 100644 --- a/deps/oblib/src/lib/time/ob_tsc_timestamp.h +++ b/deps/oblib/src/lib/time/ob_tsc_timestamp.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_TSC_TIMESTAMP_H_ diff --git a/deps/oblib/src/lib/timezone/ob_oracle_format_models.cpp b/deps/oblib/src/lib/timezone/ob_oracle_format_models.cpp index ab7e8e3d7..5296401ae 100644 --- a/deps/oblib/src/lib/timezone/ob_oracle_format_models.cpp +++ b/deps/oblib/src/lib/timezone/ob_oracle_format_models.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_TIME @@ -395,8 +399,7 @@ int ObDFMUtil::parse_one_elem(ObDFMParseCtx &ctx, ObDFMElem &elem, const bool su return ret; } - -//用于dfm_ele的打印,应该不需要修改,新flag不需要改,直接打印即可,因为不需要考虑大小写。 +// Used for printing dfm_ele, should not need modification, new flags do not need to be changed, just print directly, because case does not need to be considered. int ObDFMUtil::special_mode_sprintf(char *buf, const int64_t buf_len, int64_t &pos, const ObTimeConstStr &str, const ObDFMElem::UpperCaseMode mode, int64_t padding) { int ret = OB_SUCCESS; @@ -446,8 +449,7 @@ int ObDFMUtil::special_mode_sprintf(char *buf, const int64_t buf_len, int64_t &p return ret; } - -//检查语义,新flag不需要修改,无冲突 +// Check semantics, new flag does not need modification, no conflict int ObDFMUtil::check_semantic(const ObDFMElemArr &elements, ObFixedBitSet &flag_bitmap, uint64_t mode) { int ret = OB_SUCCESS; @@ -518,9 +520,7 @@ int ObDFMUtil::check_semantic(const ObDFMElemArr &elements, ObFixedBitSet(-(15 * MINS_PER_HOUR + 59) * SECS_PER_MIN) // -15:59 . #define ORACLE_OFFSET_MAX static_cast(15 * SECS_PER_HOUR) // +15:00 . #define ORACLE_OFFSET_MAX_HOUR 15 - -// str_to_offset失败时通常返回的错误码是OB_ERR_UNKNOWN_TIME_ZONE,上层调用的地方看到这个错误码后, -// 会把str当作是时区名,到time_zone_map中查找,比如'Asia/Shanghai' -// ret_more的作用是,上层在查找也失败后,mysql抛出的错误码是OB_ERR_UNKNOWN_TIME_ZONE,但是oracle不是 -// oracle可能抛出多种错误码,比如hour大于15时抛出OB_ERR_INVALID_TIME_ZONE_HOUR,minute大于59时 -// 抛出OB_ERR_INVALID_TIME_ZONE_MINUTE。 -// ret_more把这个错误码记录并返回,上层在查找time_zone_map失败后,根据模式判断是否用ret_more覆盖ret +// str_to_offset fails to return the error code OB_ERR_UNKNOWN_TIME_ZONE, upper-level calling places see this error code after, +// will treat str as a time zone name, look it up in time_zone_map, for example 'Asia/Shanghai' +// The role of ret_more is, when the upper layer fails to find it as well, the error code thrown by mysql is OB_ERR_UNKNOWN_TIME_ZONE, but oracle is not +// Oracle may throw multiple error codes, for example, OB_ERR_INVALID_TIME_ZONE_HOUR when hour is greater than 15, minute greater than 59 when +// Throw OB_ERR_INVALID_TIME_ZONE_MINUTE. +// ret_more records this error code and returns it, the upper layer determines whether to use ret_more to override ret after failing to find time_zone_map based on the mode int ObTimeConverter::str_to_offset(const ObString &str, int32_t &value, int &ret_more, const bool is_oracle_mode, const bool need_check_valid/* false */) { @@ -1737,12 +1740,12 @@ int ObTimeConverter::str_to_offset(const ObString &str, int32_t &value, int &ret LOG_WARN("failed to get offset", K(ret), K(str)); } else if (!('+' == sign || '-' == sign) || 0 == hour.len_ || 0 == minute.len_ - // oracle对小数部分和末尾非法字符的处理是直接忽略,因此这里加了模式判断,oracle模式接受none.len_ > 0 + // oracle handles the fractional part and trailing illegal characters by ignoring them directly, therefore a pattern check is added here, oracle mode accepts none.len_ > 0 || !is_single_colon(colon) || (none.len_ > 0 && use_strict_format)) { ret = OB_ERR_UNKNOWN_TIME_ZONE; } else if (! need_check_valid) { - // 某些场景中不需要检查合法性,比如session反序列化; load timezone 系统变量的值到session上, - // 只需要在设置系统变量时做检查即可。这些情况要额外处理的原因是如果做检查,无法获取真正的兼容模式。 + // In some scenarios, legality check is not required, for example, session deserialization; load the value of the timezone system variable into the session, + // Only need to check when setting system variables. These cases need to be handled separately because if a check is done, the true compatibility mode cannot be obtained. value = static_cast(((hour.value_ * MINS_PER_HOUR) + minute.value_) * SECS_PER_MIN); if ('-' == sign) { value = -value; @@ -1753,7 +1756,7 @@ int ObTimeConverter::str_to_offset(const ObString &str, int32_t &value, int &ret LOG_WARN("check minute leading precision failed", K(ret), K(minute)); } else if (OB_UNLIKELY(minute.value_ >= MINS_PER_HOUR || minute.value_ < 0)) { ret = OB_ERR_UNKNOWN_TIME_ZONE; - // 在hour和minute都超出范围的情况下,oracle报的是hour越界错误 + // In the case where both hour and minute are out of range, Oracle reports an hour out-of-bounds error ret_more = is_oracle_mode ? (hour.value_ > ORACLE_OFFSET_MAX_HOUR ? OB_ERR_INVALID_TIME_ZONE_HOUR : OB_ERR_INVALID_TIME_ZONE_MINUTE) @@ -1766,7 +1769,7 @@ int ObTimeConverter::str_to_offset(const ObString &str, int32_t &value, int &ret if (is_oracle_mode ) { if (OB_UNLIKELY(!(ORACLE_OFFSET_MIN <= value && value <= ORACLE_OFFSET_MAX))) { - // 在hour和minute都超出范围的情况下,oracle报的是hour越界错误 + // In the case where both hour and minute are out of range, Oracle reports an hour out-of-bounds error ret_more = hour.value_ > ORACLE_OFFSET_MAX_HOUR ? OB_ERR_INVALID_TIME_ZONE_HOUR : OB_ERR_INVALID_TIME_ZONE_MINUTE; ret = OB_ERR_UNKNOWN_TIME_ZONE; @@ -2320,8 +2323,7 @@ int ObTimeConverter::str_to_digit_with_date(const ObString &str, ObTimeDigits *d } return ret; } - -//dayofmonth函数需要容忍月、日为0的错误 +//dayofmonth function needs to tolerate errors where month and day are 0 int ObTimeConverter::str_to_ob_time_with_date(const ObString &str, ObTime &ob_time, int16_t *scale, const ObDateSqlMode date_sql_mode, const bool &need_truncate) @@ -3749,12 +3751,11 @@ int ObTimeConverter::str_to_ob_time_by_dfm_elems(const ObString &str, int32_t temp_tzh_value = -1; //positive value is legal int32_t temp_tzm_value = -1; //positive value is legal int32_t temp_tz_factor = 0; - - // cvrt_ctx.tz_info_的类型如果为ObTimeZoneInfo,说明timezone以offset的形式保存; - // cvrt_ctx.tz_info_的类型如果是ObTimeZoneInfoPos, 说明timezone以tz_name的形式保存; - // 根据cvrt_ctx.tz_info_的类型为tz_hour+tz_min 或 tz_id+tran_type_id 赋值 - // 作为dfm_elems中不包含时区相关的flag时,ob_time中时区相关变量的缺省值. - // TZ相关的flag包括TZH(hour), TZM(minute), TZR(region), TZD(daylight) + // cvrt_ctx.tz_info_ type is ObTimeZoneInfo, which means timezone is saved in offset form; + // cvrt_ctx.tz_info_ type is ObTimeZoneInfoPos if timezone is saved in tz_name form; + // Assign value to tz_hour+tz_min or tz_id+tran_type_id based on the type of cvrt_ctx.tz_info_ + // As the flag when dfm_elems does not include timezone-related information, the default value for timezone-related variables in ob_time. + // TZ-related flags include TZH(hour), TZM(minute), TZR(region), TZD(daylight) int32_t tz_hour = 0; //will be negetive when time zone offset < 0 int32_t tz_min = 0; //will be negetive when time zone offset < 0 int32_t session_tz_id = 0; @@ -3835,7 +3836,7 @@ int ObTimeConverter::str_to_ob_time_by_dfm_elems(const ObString &str, //The # of skipped non-blank chars is according to format_str first_non_space_sep_char = ctx.is_parse_finish() ? INT64_MAX : ctx.cur_ch_[0]; if (ObDFMFlag::X == elem.elem_flag_) { - //特殊情况, 不考虑X前面的非空白分隔符 + // Special case, do not consider non-whitespace delimiters before X part_sep_len = 0; } else { part_sep_len = ObDFMUtil::skip_separate_chars(ctx, format_sep_len); @@ -3976,9 +3977,9 @@ int ObTimeConverter::str_to_ob_time_by_dfm_elems(const ObString &str, // SQL> alter session set time_zone='Asia/Shanghai'; // SQL> select cast('01-SEP-20 11.11.11' as timestamp with time zone) from dual; // 01-SEP-20 11.11.11 AM +08:00 - // 只要format中设置TZH,无论string中是否真的包含TZH,最终的结果都应该显示offset; - // 如果sessiontimezone设置的是tz_name需要转为offset。 - // 因此is_tz_name_valid_置为false的逻辑放在此处而不是成功match之后 + // As long as TZH is set in format, regardless of whether string actually contains TZH, the final result should display offset; + // If sessiontimezone is set to tz_name it needs to be converted to offset. + // Therefore the logic for setting is_tz_name_valid_ to false is placed here rather than after a successful match ob_time.is_tz_name_valid_ = false; int32_t value = 0; int32_t local_tz_factor = 1; @@ -4036,7 +4037,7 @@ int ObTimeConverter::str_to_ob_time_by_dfm_elems(const ObString &str, ObString digits_timezone; parsed_elem_len = ObDFMUtil::UNKNOWN_LENGTH_OF_ELEMENT; if (OB_LIKELY(! ctx.is_parse_finish())) { - // 只要string中tz不是仅仅是'+'或'-'这一个字符,那么转换结果应该是offset,而不是tz_id/name + // As long as tz in string is not just '+' or '-' this one character, then the conversion result should be offset, rather than tz_id/name ob_time.is_tz_name_valid_ = false; } if (OB_UNLIKELY(ctx.is_parse_finish())) { @@ -4048,7 +4049,7 @@ int ObTimeConverter::str_to_ob_time_by_dfm_elems(const ObString &str, const char *local_sep = ObDFMUtil::find_first_separator(local_ctx); if (OB_ISNULL(local_sep)) { - // string中timezone offset可以不含分隔符,仅包含hour部分 + // string timezone offset can contain no separator, only the hour part } else { int64_t hour_expected_len = local_sep - digits_timezone.ptr(); int64_t local_parsed_len = 0; @@ -4064,7 +4065,7 @@ int ObTimeConverter::str_to_ob_time_by_dfm_elems(const ObString &str, ret = OB_INVALID_DATE_VALUE; //invalid time zone } else if (FALSE_IT(local_ctx.update(hour_expected_len + 1))) { } else if (OB_UNLIKELY(local_ctx.is_parse_finish())) { - //format 为TZR时,允许string中的tz形式为hour:, 分隔符后为空等价于hour:00 + // When format is TZR, allows tz form in string as hour:, with an empty delimiter equivalent to hour:00 has_digit_tz_in_TZR = true; tz_hour = tmp_tz_hour; tz_min = tmp_tz_min; @@ -4116,7 +4117,7 @@ int ObTimeConverter::str_to_ob_time_by_dfm_elems(const ObString &str, } else { MEMCPY(ob_time.tzd_abbr_, tzd_str.ptr(), tzd_str.length()); ob_time.tzd_abbr_[tzd_str.length()] = '\0'; - //ob_time.is_tz_name_valid_ = true; 只有TZD不能决定是否按照时区名解析, 这个权利是TZR的 + //ob_time.is_tz_name_valid_ = true; Only TZR can decide whether to parse according to the timezone name, this right belongs to TZR } } break; @@ -4143,8 +4144,8 @@ int ObTimeConverter::str_to_ob_time_by_dfm_elems(const ObString &str, tmp_ob_time.parts_[DT_YEAR], tmp_ob_time.parts_[DT_YEAR], true /* overwrite */))) { - // 此处要覆盖,to_date('2', 'YY')把DT_YEAR赋值为2002,这里与之不冲突的julian day转换后的 - // 年份为0002, 根据oracle行为,结果的年份为0002 + // Here to be covered, to_date('2', 'YY') sets DT_YEAR to 2002, here the Julian day conversion does not conflict with it + // Year is 0002, according to Oracle behavior, the year of the result is 0002 LOG_WARN("set ob_time_year conflict", K(ret)); } else { yday_temp_value = tmp_ob_time.parts_[DT_YDAY]; @@ -4355,7 +4356,7 @@ int ObTimeConverter::str_to_ob_time_by_dfm_elems(const ObString &str, } } if (OB_UNLIKELY(!ctx.is_valid())) { - //year=0 后面验证会报错 + //year=0 the validation will report an error later } else if (OB_FAIL(ObDFMUtil::match_int_value(ctx, expected_elem_len, parsed_elem_len, years, sign))) { LOG_WARN("failed to match int value", K(ret)); } @@ -4378,7 +4379,7 @@ int ObTimeConverter::str_to_ob_time_by_dfm_elems(const ObString &str, case ObDFMFlag::X: { if (OB_UNLIKELY('.' != ctx.cur_ch_[0])) { ignore_fs_flag = true; - //revert 就当X没有出现过 + //revert treat X as if it never appeared ctx.revert(part_blank1_len + part_sep_len + part_blank2_len); } else { parsed_elem_len = 1; @@ -4512,8 +4513,7 @@ int ObTimeConverter::str_to_ob_time_by_dfm_elems(const ObString &str, return ret; } - -// oracle模式打印timestamp前,对obtime parts做检查 +// oracle mode print timestamp before, check obtime parts bool ObTimeConverter::valid_oracle_year(const ObTime &ob_time) { int ret = true; @@ -4580,7 +4580,7 @@ int ObTimeConverter::ob_time_to_str_by_dfm_elems(const ObTime &ob_time, int32_t iso_week = 0; int32_t iso_year_delta = 0; bool is_iso_week_calced = false; - //为了避免iso week的重复计算 + // To avoid duplicate calculation of iso week auto calc_iso_week = [&iso_week, &iso_year_delta, &is_iso_week_calced, &ob_time] (void) { if (!is_iso_week_calced) { @@ -5282,7 +5282,7 @@ int check_and_get_tz_info(ObTime &ob_time, int ret = OB_SUCCESS; ObTZInfoMap *tz_info_map = NULL; if (OB_UNLIKELY(ob_time.is_tz_name_valid_)) {//use string literal tz_inifo - //原则上tz_info_均应该正确赋值,但是当前代码中有一些向datetime的转换,直接传递了值为NULL的tz_info_ + //In principle, tz_info_ should all be correctly assigned, but there are some conversions to datetime in the current code that directly pass NULL values for tz_info_ if (NULL == cvrt_ctx.tz_info_) { if (HAS_TYPE_ORACLE(ob_time.mode_)) { ret = OB_INVALID_ARGUMENT; @@ -5502,8 +5502,7 @@ int32_t ObTimeConverter::ob_time_to_week(const ObTime &ob_time, ObDTMode mode, i } //////////////////////////////// // below are other utility functions: - -//dayofmonth函数需要容忍月、日为0的错误 +//dayofmonth function needs to tolerate errors where month and day are 0 int ObTimeConverter::validate_datetime(ObTime &ob_time, const ObDateSqlMode date_sql_mode) { const int32_t *parts = ob_time.parts_; @@ -5705,9 +5704,8 @@ int ObTimeConverter::set_ob_time_part_may_conflict(ObTime &ob_time, int64_t &con return ret; } - -// DT_YEAR的赋值没有用上面的接口,原因是year的冲突检查具有特殊性。 -// 具体原因: +// The assignment of DT_YEAR does not use the above interface because the conflict check for year has special characteristics. +// Specific reason: int ObTimeConverter::set_ob_time_year_may_conflict(ObTime &ob_time, int32_t &julian_year_value, int32_t check_year, int32_t set_year, bool overwrite) diff --git a/deps/oblib/src/lib/timezone/ob_time_convert.h b/deps/oblib/src/lib/timezone/ob_time_convert.h index 4e9f5aa5f..57ee6ad12 100644 --- a/deps/oblib/src/lib/timezone/ob_time_convert.h +++ b/deps/oblib/src/lib/timezone/ob_time_convert.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_TIMEZONE_OB_TIME_CONVERT_ @@ -143,7 +147,7 @@ extern const int64_t USECS_PER_MIN; #define DATE_MIN_LENGTH 10 #define DAYNAME_MAX_LENGTH 9 //Wednesday is longest #define MONTHNAME_MAX_LENGTH 9 //September is longest -//max timestamp最大值为253402272000 12位 +//max timestamp maximum value is 253402272000 12 digits #define TIMESTAMP_VALUE_LENGTH 12 #define SEC_TO_USEC(secs) ((secs) * USECS_PER_SEC) #define USEC_TO_SEC(usec) ((usec) / USECS_PER_SEC) @@ -816,9 +820,9 @@ enum ObNLSFormatEnum { /** * @brief The ObDataTypeCastParams struct - * 传递用于SQL解析的session环境变量, - * 特别是用于oracle模式 - * 包括时区/时间格式/字符集等信息 + * pass the session environment variables used for SQL parsing, + * especially for oracle mode + * including timezone/time format/character set etc. information */ class ObDataTypeCastParams @@ -989,7 +993,7 @@ OB_INLINE void ObTimeConverter::days_to_year_ydays(DateType days, YearType &year /// @fn get month and dt_mday from dt_yday and year, ZERO_DATE NOT allowed to run in this function /// @brief Instead of comparing 12 months one by one, -/// here divide 32 first to get an appproximate value, +/// here divide 32 first to get an approximate value, /// since there are only 12 months, the cumulative error does not exceed 1. /// @param [in] year the year corresponding to the given date. /// @param [in] dt_yday the day of the year to the given date, say xxxx-1-1 is 1, xxxx-1-2 is 2. diff --git a/deps/oblib/src/lib/timezone/ob_time_format.h b/deps/oblib/src/lib/timezone/ob_time_format.h index e333ea7d2..886ea9dd8 100644 --- a/deps/oblib/src/lib/timezone/ob_time_format.h +++ b/deps/oblib/src/lib/timezone/ob_time_format.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_FILE_TIME_FORMAT diff --git a/deps/oblib/src/lib/timezone/ob_timezone_info.cpp b/deps/oblib/src/lib/timezone/ob_timezone_info.cpp index 581b44758..1fe88d116 100644 --- a/deps/oblib/src/lib/timezone/ob_timezone_info.cpp +++ b/deps/oblib/src/lib/timezone/ob_timezone_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_TIME @@ -39985,7 +39989,7 @@ int ObTimeZoneInfoWrap::set_error_on_overlap_time(bool is_error) { int ret = OB_SUCCESS; error_on_overlap_time_ = is_error; - if (OB_UNLIKELY(tz_info_ != NULL)) {//在系统初次load_system_variable时,tz_info可能为负值 + if (OB_UNLIKELY(tz_info_ != NULL)) {//When the system first loads_system_variable, tz_info may be negative} tz_info_->set_error_on_overlap_time(is_error); } return ret; diff --git a/deps/oblib/src/lib/timezone/ob_timezone_info.h b/deps/oblib/src/lib/timezone/ob_timezone_info.h index 7b888946e..a0b8b5e2e 100644 --- a/deps/oblib/src/lib/timezone/ob_timezone_info.h +++ b/deps/oblib/src/lib/timezone/ob_timezone_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_TIMEZONE_INFO_ @@ -185,11 +189,10 @@ class ObOTimestampData UnionTZCtx time_ctx_; //time ctx, such as version, tail_ns, tz_id... int64_t time_us_; //full time with usec, same as timestamp }__attribute__ ((packed)); - -// 老版本的ObOTimestampData,原来是time_us_在前,time_ctx_在后。 -// 对于ObTimestampNanoType类型,time_ctx_只有前两个字节有效,因此crc64_v2中直接计算前10个字节的checksum。 -// 实现新引擎时做了一点优化,将ObOTimestampData中两个成员换了位置,导致crc64_v2计算出的结果与老版本不兼容, -// 存储层巡检时报错。 添加ObOTimestampDataOld类,用于计算与老版本兼容的checksum值。 +// The old version of ObOTimestampData, originally time_us_ was first, time_ctx_ was after. +// For ObTimestampNanoType type, only the first two bytes of time_ctx_ are valid, therefore crc64_v2 directly calculates the checksum of the first 10 bytes. +// When implementing the new engine, I made some optimizations by swapping the positions of two members in ObOTimestampData, which led to the crc64_v2 calculation producing results incompatible with the old version, +// Storage layer inspection error. Add ObOTimestampDataOld class, used for calculating checksum value compatible with the old version. struct ObOTimestampDataOld { int64_t time_us_; int32_t time_ctx_; @@ -439,7 +442,7 @@ class ObTZRevertTypeInfo : public ObTZTransitionTypeInfo DISALLOW_COPY_AND_ASSIGN(ObTZRevertTypeInfo); public: TypeInfoClass type_class_; - //当type_class_为overlap时,下成员记录另一份type info + // When type_class_ is overlap, the following member records another type info ObTZTransitionStruct extra_info_; }; @@ -589,12 +592,12 @@ class ObTimeZoneInfoPos : public ObTimeZoneInfo, public ObTZIDHashValue int add_tran_type_info(const ObTZTransitionTypeInfo &type_info); int set_default_tran_type(const ObTZTransitionTypeInfo &tran_type); inline const ObTZTransitionTypeInfo &get_default_trans_type() const { return default_type_; } - // 这里用了一个 trick 来做“多版本” - // 有2个槽位,一个是当前槽位,一个是未来新 timezone 信息槽位 - // 当有新的 timezone 信息从内部表读入后,会写入未来新 timezone 槽位, - // 然后通过 curr_idx_++ 操作,将未来新 timezone 槽位升级为“当前槽位” + // Here we used a trick to do "multi-version" + // There are 2 slots, one is the current slot, the other is the future new timezone information slot + // When new timezone information is read from the internal table, it will be written to the future new timezone slot, + // Then through the curr_idx_++ operation, upgrade the future new timezone slot to "current slot" // - // 每个槽位里,记录了 tz_id 时区下所有 timezone offset 信息(夏令时) + // Each slot records all timezone offset information (daylight saving time) for the tz_id timezone inline int32_t get_curr_idx() const { return curr_idx_; } inline int32_t get_next_idx() const { return curr_idx_ + 1; } inline void inc_curr_idx() { ++curr_idx_; } diff --git a/deps/oblib/src/lib/timezone/ob_timezone_util.cpp b/deps/oblib/src/lib/timezone/ob_timezone_util.cpp index 831ac7872..1c63ced8c 100644 --- a/deps/oblib/src/lib/timezone/ob_timezone_util.cpp +++ b/deps/oblib/src/lib/timezone/ob_timezone_util.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/allocator/ob_malloc.h" diff --git a/deps/oblib/src/lib/timezone/ob_timezone_util.h b/deps/oblib/src/lib/timezone/ob_timezone_util.h index fc51cd14e..e729c7c3f 100644 --- a/deps/oblib/src/lib/timezone/ob_timezone_util.h +++ b/deps/oblib/src/lib/timezone/ob_timezone_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIB_FILE_TIMEZONE_UTIL diff --git a/deps/oblib/src/lib/trace/ob_seq_event_recorder.h b/deps/oblib/src/lib/trace/ob_seq_event_recorder.h index 9bac583c0..650c03c60 100644 --- a/deps/oblib/src/lib/trace/ob_seq_event_recorder.h +++ b/deps/oblib/src/lib/trace/ob_seq_event_recorder.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_SEQ_EVENT_RECORDER_H diff --git a/deps/oblib/src/lib/trace/ob_trace.cpp b/deps/oblib/src/lib/trace/ob_trace.cpp index c56f06c76..dd72a47f6 100644 --- a/deps/oblib/src/lib/trace/ob_trace.cpp +++ b/deps/oblib/src/lib/trace/ob_trace.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_trace.h" @@ -47,67 +51,6 @@ thread_local ObTrace* ObTrace::save_buffer = nullptr; void flush_trace() { - ObTrace& trace = *OBTRACE; - common::ObDList& current_span = trace.current_span_; - if (trace.is_inited() && !current_span.is_empty()) { - ObSpanCtx* span = current_span.get_first(); - ObSpanCtx* next = nullptr; - while (current_span.get_header() != span) { - ObSpanCtx* next = span->get_next(); - if (nullptr != span->tags_ || 0 != span->end_ts_) { - int64_t pos = 0; - thread_local char buf[MAX_TRACE_LOG_SIZE]; - int ret = OB_SUCCESS; - ObTagCtxBase* tag = span->tags_; - bool first = true; - char tagstr[] = "\"tags\":["; - INIT_SPAN(span); - while (OB_SUCC(ret) && OB_NOT_NULL(tag)) { - if (pos + sizeof(tagstr) + 1 >= MAX_TRACE_LOG_SIZE) { - ret = OB_BUF_NOT_ENOUGH; - } else { - buf[pos++] = ','; - if (first) { - strncpy(buf + pos, tagstr, MAX_TRACE_LOG_SIZE - pos); - pos += sizeof(tagstr) - 1; - first = false; - } - ret = tag->tostring(buf, MAX_TRACE_LOG_SIZE, pos); - tag = tag->next_; - } - } - if (0 != pos) { - if (pos + 1 < MAX_TRACE_LOG_SIZE) { - buf[pos++] = ']'; - buf[pos++] = 0; - } else { - buf[MAX_TRACE_LOG_SIZE - 2] = ']'; - buf[MAX_TRACE_LOG_SIZE - 1] = 0; - } - } - INIT_SPAN(span->source_span_); - _FLT_LOG(INFO, - TRACE_PATTERN "%s}", - UUID_TOSTRING(trace.get_trace_id()), - __span_type_mapper[span->span_type_], - UUID_TOSTRING(span->span_id_), - span->start_ts_, - span->end_ts_, - UUID_TOSTRING(OB_ISNULL(span->source_span_) ? OBTRACE->get_root_span_id() : span->source_span_->span_id_), - span->is_follow_ ? "true" : "false", - buf); - buf[0] = '\0'; - IGNORE_RETURN sql::handle_span_record(sql::get_flt_span_manager(), buf, pos, span); - if (0 != span->end_ts_) { - current_span.remove(span); - trace.freed_span_.add_first(span); - } - span->tags_ = nullptr; - } - span = next; - } - trace.offset_ = trace.buffer_size_ / 2; - } } uint64_t UUID::gen_rand() { @@ -364,15 +307,6 @@ ObTrace::ObTrace(int64_t buffer_size) void ObTrace::init(UUID trace_id, UUID root_span_id, uint8_t policy) { - #ifndef NDEBUG - if (check_magic()) { - check_leak_span(); - } - #endif - reset(); - trace_id_ = trace_id; - root_span_id_ = root_span_id; - policy_ = policy; } UUID ObTrace::begin() diff --git a/deps/oblib/src/lib/trace/ob_trace.h b/deps/oblib/src/lib/trace/ob_trace.h index 3b908e37b..6419bee3c 100644 --- a/deps/oblib/src/lib/trace/ob_trace.h +++ b/deps/oblib/src/lib/trace/ob_trace.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TRACE_H @@ -244,9 +248,6 @@ struct ObTrace ObTrace(int64_t buffer_size); void init(FltTransCtx &flt_ctx) { - root_span_id_ = flt_ctx.span_id_; - trace_id_ = flt_ctx.trace_id_; - policy_ = flt_ctx.policy_; } void init(UUID trace_id, UUID root_span_id, uint8_t policy = 0); bool is_inited() { return check_magic() && trace_id_.is_inited(); } diff --git a/deps/oblib/src/lib/trace/ob_trace_def.h b/deps/oblib/src/lib/trace/ob_trace_def.h index 80c4bec92..9ad0e552d 100644 --- a/deps/oblib/src/lib/trace/ob_trace_def.h +++ b/deps/oblib/src/lib/trace/ob_trace_def.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef FLT_DEF_SPAN diff --git a/deps/oblib/src/lib/trace/ob_trace_event.cpp b/deps/oblib/src/lib/trace/ob_trace_event.cpp index fddea0ac9..fc8ad5cae 100644 --- a/deps/oblib/src/lib/trace/ob_trace_event.cpp +++ b/deps/oblib/src/lib/trace/ob_trace_event.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_trace_event.h" diff --git a/deps/oblib/src/lib/trace/ob_trace_event.h b/deps/oblib/src/lib/trace/ob_trace_event.h index 791b832d8..a47e73d47 100644 --- a/deps/oblib/src/lib/trace/ob_trace_event.h +++ b/deps/oblib/src/lib/trace/ob_trace_event.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TRACE_EVENT_H diff --git a/deps/oblib/src/lib/udt/ob_array_binary.cpp b/deps/oblib/src/lib/udt/ob_array_binary.cpp index 0a0953e6f..ce92fb265 100644 --- a/deps/oblib/src/lib/udt/ob_array_binary.cpp +++ b/deps/oblib/src/lib/udt/ob_array_binary.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -839,4 +843,4 @@ int ObArrayBinary::intersect(ObIAllocator &alloc, ObIArrayType **arr, uint32_t a } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/udt/ob_array_binary.h b/deps/oblib/src/lib/udt/ob_array_binary.h index a884bf218..d89a6a453 100644 --- a/deps/oblib/src/lib/udt/ob_array_binary.h +++ b/deps/oblib/src/lib/udt/ob_array_binary.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_ARRAY_BINARY_ diff --git a/deps/oblib/src/lib/udt/ob_array_fixed_size.h b/deps/oblib/src/lib/udt/ob_array_fixed_size.h index 1aff1e581..fa46622c5 100644 --- a/deps/oblib/src/lib/udt/ob_array_fixed_size.h +++ b/deps/oblib/src/lib/udt/ob_array_fixed_size.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_ARRAY_FIXED_SIZE_ diff --git a/deps/oblib/src/lib/udt/ob_array_fixed_size.ipp b/deps/oblib/src/lib/udt/ob_array_fixed_size.ipp index a8b837250..f18ceb058 100644 --- a/deps/oblib/src/lib/udt/ob_array_fixed_size.ipp +++ b/deps/oblib/src/lib/udt/ob_array_fixed_size.ipp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_ARRAY_FIXED_SIZE_IPP_ diff --git a/deps/oblib/src/lib/udt/ob_array_nested.cpp b/deps/oblib/src/lib/udt/ob_array_nested.cpp index fb01d401c..9cd82f135 100644 --- a/deps/oblib/src/lib/udt/ob_array_nested.cpp +++ b/deps/oblib/src/lib/udt/ob_array_nested.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -926,4 +930,4 @@ int ObArrayNested::intersect(ObIAllocator &alloc, ObIArrayType **arr, uint32_t a #undef CONSTRUCT_FIXED_ARRAY_OBJ } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/udt/ob_array_nested.h b/deps/oblib/src/lib/udt/ob_array_nested.h index 614cae427..4151a5322 100644 --- a/deps/oblib/src/lib/udt/ob_array_nested.h +++ b/deps/oblib/src/lib/udt/ob_array_nested.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_ARRAY_NESTED_ diff --git a/deps/oblib/src/lib/udt/ob_array_type.cpp b/deps/oblib/src/lib/udt/ob_array_type.cpp index abfcff86a..3156f0eeb 100644 --- a/deps/oblib/src/lib/udt/ob_array_type.cpp +++ b/deps/oblib/src/lib/udt/ob_array_type.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -249,4 +253,4 @@ int ObArrayTypeObjFactory::construct_basic_elem(common::ObIAllocator &alloc, con #undef CONSTRUCT_FIXED_ARRAY_OBJ } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/udt/ob_array_type.h b/deps/oblib/src/lib/udt/ob_array_type.h index c3bc533c7..49069661f 100644 --- a/deps/oblib/src/lib/udt/ob_array_type.h +++ b/deps/oblib/src/lib/udt/ob_array_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_ARRAY_TYPE_ diff --git a/deps/oblib/src/lib/udt/ob_array_utils.cpp b/deps/oblib/src/lib/udt/ob_array_utils.cpp index 8231fc6cb..435f5d052 100644 --- a/deps/oblib/src/lib/udt/ob_array_utils.cpp +++ b/deps/oblib/src/lib/udt/ob_array_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -135,4 +139,4 @@ int ObArrayUtil::append(ObIArrayType &array, const ObObjType elem_type, const Ob } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/udt/ob_array_utils.h b/deps/oblib/src/lib/udt/ob_array_utils.h index 59a1ce60b..014e5d5e9 100644 --- a/deps/oblib/src/lib/udt/ob_array_utils.h +++ b/deps/oblib/src/lib/udt/ob_array_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_ARRAY_UTILS_ @@ -187,4 +191,4 @@ public : } // namespace common } // namespace oceanbase -#endif // OCEANBASE_OB_ARRAY_UTILS_ \ No newline at end of file +#endif // OCEANBASE_OB_ARRAY_UTILS_ diff --git a/deps/oblib/src/lib/udt/ob_collection_type.cpp b/deps/oblib/src/lib/udt/ob_collection_type.cpp index e151554df..7f0a95a84 100644 --- a/deps/oblib/src/lib/udt/ob_collection_type.cpp +++ b/deps/oblib/src/lib/udt/ob_collection_type.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -710,7 +714,7 @@ int ObSqlCollectionInfo::parse_element_info(std::string type_info, ObCollectionT uint8_t idx = 0; while (OB_SUCC(ret) && std::regex_search(type_info, matches, pattern)) { std::string type_name = matches[0]; - type_info = matches.suffix().str(); // 更新 text 为剩余未匹配的部分 + type_info = matches.suffix().str(); // update text to the remaining unmatched part if (is_root && isNumber(type_name)) { // vector element is float basic_meta_info->basic_meta_.meta_.set_float(); @@ -896,4 +900,4 @@ int ObSqlCollectionInfo::get_map_attr_def_string(ObIAllocator &allocator, ObStri } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/udt/ob_collection_type.h b/deps/oblib/src/lib/udt/ob_collection_type.h index 3158172d1..6c8cad05d 100644 --- a/deps/oblib/src/lib/udt/ob_collection_type.h +++ b/deps/oblib/src/lib/udt/ob_collection_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_SQL_COLLECTION_TYPE_ diff --git a/deps/oblib/src/lib/udt/ob_map_type.cpp b/deps/oblib/src/lib/udt/ob_map_type.cpp index bc9007e8c..38dc18c17 100644 --- a/deps/oblib/src/lib/udt/ob_map_type.cpp +++ b/deps/oblib/src/lib/udt/ob_map_type.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -384,4 +388,4 @@ int ObMapType::distinct(ObIAllocator &alloc, ObIArrayType *&output) const } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/udt/ob_map_type.h b/deps/oblib/src/lib/udt/ob_map_type.h index c2f80ec4b..aea64c6f2 100644 --- a/deps/oblib/src/lib/udt/ob_map_type.h +++ b/deps/oblib/src/lib/udt/ob_map_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_MAP_ diff --git a/deps/oblib/src/lib/udt/ob_udt_type.cpp b/deps/oblib/src/lib/udt/ob_udt_type.cpp index 2277e7e5b..fb03395be 100644 --- a/deps/oblib/src/lib/udt/ob_udt_type.cpp +++ b/deps/oblib/src/lib/udt/ob_udt_type.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -344,4 +348,4 @@ OB_DEF_SERIALIZE_SIZE(ObSqlUDTMeta) } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/udt/ob_udt_type.h b/deps/oblib/src/lib/udt/ob_udt_type.h index 7d2b95e25..c44275822 100644 --- a/deps/oblib/src/lib/udt/ob_udt_type.h +++ b/deps/oblib/src/lib/udt/ob_udt_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_SQL_UDT_TYPE_ diff --git a/deps/oblib/src/lib/udt/ob_vector_type.cpp b/deps/oblib/src/lib/udt/ob_vector_type.cpp index 024a99e15..83de24dfa 100644 --- a/deps/oblib/src/lib/udt/ob_vector_type.cpp +++ b/deps/oblib/src/lib/udt/ob_vector_type.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -219,4 +223,4 @@ int ObVectorU8Data::elem_at(uint32_t idx, ObObj &elem_obj) const } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/udt/ob_vector_type.h b/deps/oblib/src/lib/udt/ob_vector_type.h index 953104f8c..3baa76bfb 100644 --- a/deps/oblib/src/lib/udt/ob_vector_type.h +++ b/deps/oblib/src/lib/udt/ob_vector_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_VECTOR_TYPE_ @@ -692,4 +696,4 @@ int ObVectorData::intersect(ObIAllocator &alloc, ObIArrayType **arr, uint32_t } } -#endif // OCEANBASE_OB_VECTOR_TYPE_ \ No newline at end of file +#endif // OCEANBASE_OB_VECTOR_TYPE_ diff --git a/deps/oblib/src/lib/utility/ob_backtrace.cpp b/deps/oblib/src/lib/utility/ob_backtrace.cpp index f7e385100..55d688866 100644 --- a/deps/oblib/src/lib/utility/ob_backtrace.cpp +++ b/deps/oblib/src/lib/utility/ob_backtrace.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/utility/ob_backtrace.h b/deps/oblib/src/lib/utility/ob_backtrace.h index 55a8e04e3..898e7285c 100644 --- a/deps/oblib/src/lib/utility/ob_backtrace.h +++ b/deps/oblib/src/lib/utility/ob_backtrace.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_BACKTRACE_H_ diff --git a/deps/oblib/src/lib/utility/ob_bits_utils.h b/deps/oblib/src/lib/utility/ob_bits_utils.h index 52befb76a..ae87b5c0e 100644 --- a/deps/oblib/src/lib/utility/ob_bits_utils.h +++ b/deps/oblib/src/lib/utility/ob_bits_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_BITS_UTILS_H diff --git a/deps/oblib/src/lib/utility/ob_defer.h b/deps/oblib/src/lib/utility/ob_defer.h index 55c879db1..5410ae746 100644 --- a/deps/oblib/src/lib/utility/ob_defer.h +++ b/deps/oblib/src/lib/utility/ob_defer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_DEFER_H_ diff --git a/deps/oblib/src/lib/utility/ob_edit_distance.h b/deps/oblib/src/lib/utility/ob_edit_distance.h index e915c7fd6..fa43307f0 100644 --- a/deps/oblib/src/lib/utility/ob_edit_distance.h +++ b/deps/oblib/src/lib/utility/ob_edit_distance.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_EDIT_DISTANCE_H_ @@ -56,4 +60,4 @@ class ObEditDistance }; } // end namespace common } // end namespace oceanbase -#endif //OCEANBASE_COMMON_OB_EDIT_DISTANCE_H_ \ No newline at end of file +#endif //OCEANBASE_COMMON_OB_EDIT_DISTANCE_H_ diff --git a/deps/oblib/src/lib/utility/ob_fast_convert.cpp b/deps/oblib/src/lib/utility/ob_fast_convert.cpp index 4ec2fb4ac..439ac7375 100644 --- a/deps/oblib/src/lib/utility/ob_fast_convert.cpp +++ b/deps/oblib/src/lib/utility/ob_fast_convert.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/utility/ob_fast_convert.h b/deps/oblib/src/lib/utility/ob_fast_convert.h index cde8d9f57..4ba52d530 100644 --- a/deps/oblib/src/lib/utility/ob_fast_convert.h +++ b/deps/oblib/src/lib/utility/ob_fast_convert.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_FAST_FORMAT_H_ diff --git a/deps/oblib/src/lib/utility/ob_hang_fatal_error.cpp b/deps/oblib/src/lib/utility/ob_hang_fatal_error.cpp index 8946d792b..9803f0e39 100644 --- a/deps/oblib/src/lib/utility/ob_hang_fatal_error.cpp +++ b/deps/oblib/src/lib/utility/ob_hang_fatal_error.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/utility/ob_hang_fatal_error.h" diff --git a/deps/oblib/src/lib/utility/ob_hang_fatal_error.h b/deps/oblib/src/lib/utility/ob_hang_fatal_error.h index 07cefc4a2..370accb74 100644 --- a/deps/oblib/src/lib/utility/ob_hang_fatal_error.h +++ b/deps/oblib/src/lib/utility/ob_hang_fatal_error.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_LIB_UTILITY_OB_HANG_FATAL_ERROR_H_ diff --git a/deps/oblib/src/lib/utility/ob_hyperloglog.cpp b/deps/oblib/src/lib/utility/ob_hyperloglog.cpp index 09b44e89f..49825a52f 100644 --- a/deps/oblib/src/lib/utility/ob_hyperloglog.cpp +++ b/deps/oblib/src/lib/utility/ob_hyperloglog.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/utility/ob_hyperloglog.h b/deps/oblib/src/lib/utility/ob_hyperloglog.h index c8c9dd4a4..98319c9b1 100644 --- a/deps/oblib/src/lib/utility/ob_hyperloglog.h +++ b/deps/oblib/src/lib/utility/ob_hyperloglog.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_OB_HYPERLOGLOG_H_ @@ -194,7 +198,7 @@ inline void ObHyperLogLogCalculator::set(uint64_t hash_value) COMMON_LOG(DEBUG, "unexpected status: hash value is invalid", K(n_leading_zero), K(bucket_index), K(n_bucket_), K(hash_value)); } else if (n_leading_zero > static_cast(buckets_[bucket_index])) { - // 理论上pmax不会超过65. + // Theoretically, pmax will not exceed 65. buckets_[bucket_index] = n_leading_zero; COMMON_LOG(DEBUG, "hll add value", K(n_leading_zero), K(bucket_index)); } else if (n_leading_zero >= MAX_HASH_VALUE_LENGTH) { @@ -218,7 +222,7 @@ inline void ObHyperLogLogCalculator::sets(uint64_t *hash_vals, int64_t count) COMMON_LOG(DEBUG, "unexpected status: hash value is invalid", K(n_leading_zero), K(bucket_index), K(n_bucket_), K(hash_value)); } else if (n_leading_zero > static_cast(buckets_[bucket_index])) { - // 理论上pmax不会超过65. + // Theoretically, pmax will not exceed 65. buckets_[bucket_index] = n_leading_zero; COMMON_LOG(DEBUG, "hll add value", K(n_leading_zero), K(bucket_index)); } else if (n_leading_zero >= MAX_HASH_VALUE_LENGTH) { @@ -265,4 +269,4 @@ inline uint64_t ObHyperLogLogCalculator::estimate() const } // end namespace common } // end namespace oceanbase -#endif //OCEANBASE_COMMON_OB_EDIT_DISTANCE_H_ \ No newline at end of file +#endif //OCEANBASE_COMMON_OB_EDIT_DISTANCE_H_ diff --git a/deps/oblib/src/lib/utility/ob_macro_utils.h b/deps/oblib/src/lib/utility/ob_macro_utils.h index 74b42cc4e..e1ace8644 100644 --- a/deps/oblib/src/lib/utility/ob_macro_utils.h +++ b/deps/oblib/src/lib/utility/ob_macro_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_MACRO_UTILS_H_ diff --git a/deps/oblib/src/lib/utility/ob_preload.h b/deps/oblib/src/lib/utility/ob_preload.h index cecaf78e3..efbb08da9 100644 --- a/deps/oblib/src/lib/utility/ob_preload.h +++ b/deps/oblib/src/lib/utility/ob_preload.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_LIB_UTILITY_OB_PRELOAD_H_ diff --git a/deps/oblib/src/lib/utility/ob_print_kv.h b/deps/oblib/src/lib/utility/ob_print_kv.h index 6d500366f..f95e7ae25 100644 --- a/deps/oblib/src/lib/utility/ob_print_kv.h +++ b/deps/oblib/src/lib/utility/ob_print_kv.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LIB_UTILITY_OB_PRINT_KV_ @@ -309,4 +313,4 @@ DEFINE_PRINT_KV(64) } // end namespce common } // end namespace oceanbase -#endif /* LIB_UTILITY_OB_PRINT_KV_ */ \ No newline at end of file +#endif /* LIB_UTILITY_OB_PRINT_KV_ */ diff --git a/deps/oblib/src/lib/utility/ob_print_utils.cpp b/deps/oblib/src/lib/utility/ob_print_utils.cpp index 4a50f1360..29a187cb9 100644 --- a/deps/oblib/src/lib/utility/ob_print_utils.cpp +++ b/deps/oblib/src/lib/utility/ob_print_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/utility/ob_print_utils.h b/deps/oblib/src/lib/utility/ob_print_utils.h index 18f9f5053..eefe65aff 100644 --- a/deps/oblib/src/lib/utility/ob_print_utils.h +++ b/deps/oblib/src/lib/utility/ob_print_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LIB_UTILITY_OB_PRINT_UTILS_ diff --git a/deps/oblib/src/lib/utility/ob_proto_trans_util.cpp b/deps/oblib/src/lib/utility/ob_proto_trans_util.cpp index 53b8a3201..552c868e4 100644 --- a/deps/oblib/src/lib/utility/ob_proto_trans_util.cpp +++ b/deps/oblib/src/lib/utility/ob_proto_trans_util.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_UTIL diff --git a/deps/oblib/src/lib/utility/ob_proto_trans_util.h b/deps/oblib/src/lib/utility/ob_proto_trans_util.h index f45848f4e..192fca3ea 100644 --- a/deps/oblib/src/lib/utility/ob_proto_trans_util.h +++ b/deps/oblib/src/lib/utility/ob_proto_trans_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_PROTO_TRANS_UTILL_H_ diff --git a/deps/oblib/src/lib/utility/ob_query_rate_limiter.h b/deps/oblib/src/lib/utility/ob_query_rate_limiter.h index 55e9e7253..3c9314c01 100644 --- a/deps/oblib/src/lib/utility/ob_query_rate_limiter.h +++ b/deps/oblib/src/lib/utility/ob_query_rate_limiter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_QUERY_RATE_LIMITER_H diff --git a/deps/oblib/src/lib/utility/ob_rate_limiter.h b/deps/oblib/src/lib/utility/ob_rate_limiter.h index a787f8696..aed9557c8 100644 --- a/deps/oblib/src/lib/utility/ob_rate_limiter.h +++ b/deps/oblib/src/lib/utility/ob_rate_limiter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_RATE_LIMITER_H diff --git a/deps/oblib/src/lib/utility/ob_rpc_authentication_utility.cpp b/deps/oblib/src/lib/utility/ob_rpc_authentication_utility.cpp index 4aec1814c..e42ce1ccf 100644 --- a/deps/oblib/src/lib/utility/ob_rpc_authentication_utility.cpp +++ b/deps/oblib/src/lib/utility/ob_rpc_authentication_utility.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB #include "rpc/obrpc/ob_rpc_packet.h" diff --git a/deps/oblib/src/lib/utility/ob_serialization_helper.cpp b/deps/oblib/src/lib/utility/ob_serialization_helper.cpp index 20bd4f9f0..16cf5d1c0 100644 --- a/deps/oblib/src/lib/utility/ob_serialization_helper.cpp +++ b/deps/oblib/src/lib/utility/ob_serialization_helper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/utility/ob_serialization_helper.h" diff --git a/deps/oblib/src/lib/utility/ob_serialization_helper.h b/deps/oblib/src/lib/utility/ob_serialization_helper.h index c3608c9ff..8df432072 100644 --- a/deps/oblib/src/lib/utility/ob_serialization_helper.h +++ b/deps/oblib/src/lib/utility/ob_serialization_helper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_SERIALIZATION_HELPER_H diff --git a/deps/oblib/src/lib/utility/ob_sort.h b/deps/oblib/src/lib/utility/ob_sort.h index 33e326e6f..3b7955901 100644 --- a/deps/oblib/src/lib/utility/ob_sort.h +++ b/deps/oblib/src/lib/utility/ob_sort.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SORT_WRAPPER_H_ diff --git a/deps/oblib/src/lib/utility/ob_template_utils.h b/deps/oblib/src/lib/utility/ob_template_utils.h index 20edc843c..b3bdd75f8 100644 --- a/deps/oblib/src/lib/utility/ob_template_utils.h +++ b/deps/oblib/src/lib/utility/ob_template_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LIB_UTILITY_OB_TEMPLATE_UTILS_ diff --git a/deps/oblib/src/lib/utility/ob_test_util.h b/deps/oblib/src/lib/utility/ob_test_util.h index 2c63b4f29..33157589a 100644 --- a/deps/oblib/src/lib/utility/ob_test_util.h +++ b/deps/oblib/src/lib/utility/ob_test_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_TEST_UTIL_ diff --git a/deps/oblib/src/lib/utility/ob_tracepoint.cpp b/deps/oblib/src/lib/utility/ob_tracepoint.cpp index b70e4d169..68511dae7 100644 --- a/deps/oblib/src/lib/utility/ob_tracepoint.cpp +++ b/deps/oblib/src/lib/utility/ob_tracepoint.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/utility/ob_tracepoint.h" diff --git a/deps/oblib/src/lib/utility/ob_tracepoint.h b/deps/oblib/src/lib/utility/ob_tracepoint.h index 04f8bd42e..8b2fb821e 100644 --- a/deps/oblib/src/lib/utility/ob_tracepoint.h +++ b/deps/oblib/src/lib/utility/ob_tracepoint.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef NDEBUG diff --git a/deps/oblib/src/lib/utility/ob_tracepoint_def.h b/deps/oblib/src/lib/utility/ob_tracepoint_def.h index 555c5176b..79dd8852e 100644 --- a/deps/oblib/src/lib/utility/ob_tracepoint_def.h +++ b/deps/oblib/src/lib/utility/ob_tracepoint_def.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef GLOBAL_ERRSIM_POINT_DEF @@ -206,7 +210,7 @@ GLOBAL_ERRSIM_POINT_DEF(197, EN_BACKUP_COMPLEMENT_LOG_TASK_FAILED, ""); GLOBAL_ERRSIM_POINT_DEF(198, EN_BACKUP_USER_META_TASK_FAILED, ""); GLOBAL_ERRSIM_POINT_DEF(199, EN_BACKUP_PREPARE_TASK_FAILED, ""); GLOBAL_ERRSIM_POINT_DEF(200, EN_BACKUP_CHECK_TABLET_CONTINUITY_FAILED, ""); -// 下面请从201开始 +// Below please start from 201 GLOBAL_ERRSIM_POINT_DEF(201, EN_CHECK_STANDBY_CLUSTER_SCHEMA_CONDITION, ""); GLOBAL_ERRSIM_POINT_DEF(202, EN_ALLOCATE_LOB_BUF_FAILED, ""); GLOBAL_ERRSIM_POINT_DEF(203, EN_ALLOCATE_DESERIALIZE_LOB_BUF_FAILED, ""); @@ -224,7 +228,7 @@ GLOBAL_ERRSIM_POINT_DEF(214, EN_WRITE_CONFIG_FILE_FAILED, ""); GLOBAL_ERRSIM_POINT_DEF(215, EN_INVALID_ADDR_WEAK_READ_FAILED, ""); GLOBAL_ERRSIM_POINT_DEF(216, EN_STACK_OVERFLOW_CHECK_EXPR_STACK_SIZE, "Discarded"); GLOBAL_ERRSIM_POINT_DEF(217, EN_ENABLE_PDML_ALL_FEATURE, ""); -// slog checkpoint错误模拟占坑 218-230 +// slog checkpoint error simulation placeholder 218-230 GLOBAL_ERRSIM_POINT_DEF(218, EN_SLOG_CKPT_ERROR, ""); GLOBAL_ERRSIM_POINT_DEF(219, EN_FAST_RECOVERY_AFTER_ALLOC_FILE, ""); GLOBAL_ERRSIM_POINT_DEF(220, EN_FAST_MIGRATE_ADD_MEMBER_FAIL, ""); diff --git a/deps/oblib/src/lib/utility/ob_unify_serialize.cpp b/deps/oblib/src/lib/utility/ob_unify_serialize.cpp index 71ccad316..8d5ce2270 100644 --- a/deps/oblib/src/lib/utility/ob_unify_serialize.cpp +++ b/deps/oblib/src/lib/utility/ob_unify_serialize.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef ENABLE_SERIALIZATION_CHECK @@ -46,4 +50,4 @@ void finish_check_serialization() } // namespace lib } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/utility/ob_unify_serialize.h b/deps/oblib/src/lib/utility/ob_unify_serialize.h index 948aa2b2b..159ac7962 100644 --- a/deps/oblib/src/lib/utility/ob_unify_serialize.h +++ b/deps/oblib/src/lib/utility/ob_unify_serialize.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_LIB_UTILITY_OB_UNIFY_SERIALIZE_H_ diff --git a/deps/oblib/src/lib/utility/ob_utility.cpp b/deps/oblib/src/lib/utility/ob_utility.cpp index 74baeb7d9..c59da9e20 100644 --- a/deps/oblib/src/lib/utility/ob_utility.cpp +++ b/deps/oblib/src/lib/utility/ob_utility.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_utility.h" diff --git a/deps/oblib/src/lib/utility/ob_utility.h b/deps/oblib/src/lib/utility/ob_utility.h index c6703ce39..c1da37716 100644 --- a/deps/oblib/src/lib/utility/ob_utility.h +++ b/deps/oblib/src/lib/utility/ob_utility.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_UTILITY_H_ diff --git a/deps/oblib/src/lib/utility/serialization.h b/deps/oblib/src/lib/utility/serialization.h index 05c71f617..5d216be72 100644 --- a/deps/oblib/src/lib/utility/serialization.h +++ b/deps/oblib/src/lib/utility/serialization.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_SERIALIZATION_H_ diff --git a/deps/oblib/src/lib/utility/utility.cpp b/deps/oblib/src/lib/utility/utility.cpp index 4c726b0a5..4912bd374 100644 --- a/deps/oblib/src/lib/utility/utility.cpp +++ b/deps/oblib/src/lib/utility/utility.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -1182,7 +1186,7 @@ static int use_daemon() return ret; } -int start_daemon(const char *pidfile) +int start_daemon(const char *pidfile, bool skip_daemon) { int ret = OB_SUCCESS; @@ -1195,7 +1199,7 @@ int start_daemon(const char *pidfile) } // start daemon - if (OB_SUCC(ret) && OB_FAIL(use_daemon())) { + if (OB_SUCC(ret) && !skip_daemon && OB_FAIL(use_daemon())) { LOG_ERROR("create daemon process fail", K(ret)); } diff --git a/deps/oblib/src/lib/utility/utility.h b/deps/oblib/src/lib/utility/utility.h index b451c7020..8755f3df1 100644 --- a/deps/oblib/src/lib/utility/utility.h +++ b/deps/oblib/src/lib/utility/utility.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_UTILITY_H_ @@ -723,7 +727,7 @@ inline int ob_cstrcopy(char *dest, int64_t dest_buflen, const ObString &src_str) const char* get_default_if(); -int start_daemon(const char *pidfile); +int start_daemon(const char *pidfile, bool skip_daemon = false); int ob_alloc_printf(ObString &result, ObIAllocator &alloc, const char* fmt, va_list ap); int ob_alloc_printf(ObString &result, ObIAllocator &alloc, const char* fmt, ...) __attribute__((format(printf, 3, 4))); @@ -1331,23 +1335,24 @@ int ob_atoull(const char *str, uint64_t &res); int ob_strtoll(const char *str, char *&endptr, int64_t &res); int ob_strtoull(const char *str, char *&endptr, uint64_t &res); -/* 功能:根据localtime计算公式实现快速计算的方法, 替代系统函数localtime_r. - 参数: - in: const time_t *unix_sec, 当前的时间戳(单位秒), 输入值 - out: struct tm *result, 当前时间戳对应的可读时间localtime, 输出值 - 返回值: - 无 +/* + Function: Implement a fast calculation method based on the localtime formula to replace the system function localtime_r. + Parameters: + in: const time_t *unix_sec, current timestamp (unit: seconds), input value + out: struct tm *result, readable local time corresponding to the current timestamp, output value + Return value: + None */ struct tm *ob_localtime(const time_t *unix_sec, struct tm *result); -/* 功能:根据日志时间戳特点实现最快速计算localtime. 实现逻辑: 首先检查这次输入时间戳是否和上一次相同(秒单位相同, 绝大部分连续日志秒单位都是相同的), 如果相同则直接使用上一次计算的localtime即可. 如果不相同, 就使用快速时间戳计算方法ob_localtime计算localtime. - 参数: - in/out: time_t &cached_unix_sec, 缓存的上一次时间戳(秒单位) - in/out: struct tm &cached_localtime, 缓存的上一次时间戳对应的可读时间localtime - in: const time_t &input_unix_sec, 当前的时间戳(单位秒), 输入值 - out: struct tm *output_localtime, 当前时间戳对应的可读时间localtime, 输出值 - 返回值: - 无 +/* Function: Implement the fastest calculation of localtime based on the characteristics of log timestamps. Implementation logic: First check if the timestamp of this input is the same as the last one (second unit is the same, most consecutive logs have the same second unit). If they are the same, directly use the previously calculated localtime. If not, use the fast timestamp calculation method ob_localtime to calculate the localtime. + Parameters: + in/out: time_t &cached_unix_sec, cached timestamp from the last time (in seconds unit) + in/out: struct tm &cached_localtime, cached localtime corresponding to the last timestamp + in: const time_t &input_unix_sec, current timestamp (in seconds), input value + out: struct tm *output_localtime, localtime corresponding to the current timestamp, output value + Return value: + None */ void ob_fast_localtime(time_t &cached_unix_sec, struct tm &cached_localtime, const time_t &input_unix_sec, struct tm *output_localtime); diff --git a/deps/oblib/src/lib/vector/ob_vector_util.cpp b/deps/oblib/src/lib/vector/ob_vector_util.cpp index c0b105700..a8dfdca7a 100644 --- a/deps/oblib/src/lib/vector/ob_vector_util.cpp +++ b/deps/oblib/src/lib/vector/ob_vector_util.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -115,6 +119,21 @@ int create_index(obvsag::VectorIndexPtr& index_handler, int index_type, #endif } +int create_index(obvsag::VectorIndexPtr &index_handler, int index_type, const char *dtype, const char *metric, + bool use_reorder, float doc_prune_ratio, int window_size, void *allocator, int extra_info_size /* 0 */) +{ + INIT_SUCC(ret); +#ifdef OB_BUILD_CDC_DISABLE_VSAG + return ret; +#else + obvsag::set_block_size_limit(2*1024*1024); + LOG_INFO("vector index create params: ", K(index_type), KCSTRING(dtype), KCSTRING(metric), K(use_reorder), K(doc_prune_ratio), K(window_size), KP(allocator), K(extra_info_size)); + return obvsag::create_index(index_handler, static_cast(index_type), + dtype, metric, use_reorder, doc_prune_ratio, window_size, + allocator, extra_info_size); +#endif +} + int build_index(obvsag::VectorIndexPtr index_handler, float* vector_list, int64_t* ids, int dim, int size, char* extra_info /*= nullptr*/) { INIT_SUCC(ret); @@ -126,6 +145,17 @@ int build_index(obvsag::VectorIndexPtr index_handler, float* vector_list, int64_ } +int build_index(obvsag::VectorIndexPtr &index_handler, uint32_t *lens, uint32_t *dims, float *vals, int64_t *ids, + int size, char *extra_infos /*= nullptr*/) +{ + INIT_SUCC(ret); +#ifdef OB_BUILD_CDC_DISABLE_VSAG + return ret; +#else + return obvsag::build_index(index_handler, lens, dims, vals, ids, size, extra_infos); +#endif +} + int add_index(obvsag::VectorIndexPtr index_handler, float* vector_list, int64_t* ids, int dim, char *extra_info, int size) { INIT_SUCC(ret); @@ -136,6 +166,17 @@ int add_index(obvsag::VectorIndexPtr index_handler, float* vector_list, int64_t* #endif } +int add_index(obvsag::VectorIndexPtr &index_handler, uint32_t *lens, uint32_t *dims, float *vals, int64_t *ids, int size, + char *extra_infos) +{ + INIT_SUCC(ret); +#ifdef OB_BUILD_CDC_DISABLE_VSAG + return ret; +#else + return obvsag::add_index(index_handler, lens, dims, vals, ids, size, extra_infos); +#endif +} + int get_index_number(obvsag::VectorIndexPtr index_handler, int64_t &size) { INIT_SUCC(ret); @@ -170,6 +211,20 @@ int cal_distance_by_id(obvsag::VectorIndexPtr index_handler, #endif } +int cal_distance_by_id(obvsag::VectorIndexPtr index_handler, + uint32_t len, uint32_t *dims, float *vals, + const int64_t *ids, + int64_t count, + const float *&distances) +{ + INIT_SUCC(ret); +#ifdef OB_BUILD_CDC_DISABLE_VSAG + return ret; +#else + return obvsag::cal_distance_by_id(index_handler, len, dims, vals, ids, count, distances); +#endif +} + int get_vid_bound(obvsag::VectorIndexPtr index_handler, int64_t &min_vid, int64_t &max_vid) { INIT_SUCC(ret); @@ -195,7 +250,8 @@ return ret; int knn_search(obvsag::VectorIndexPtr index_handler, float* query_vector,int dim, int64_t topk, const float*& result_dist, const int64_t*& result_ids, const char *&extra_info, int64_t &result_size, int ef_search, - void* invalid, bool reverse_filter, bool is_extra_info_filter, float valid_ratio, void *allocator, bool need_extra_info) + void* invalid, bool reverse_filter, bool is_extra_info_filter, float valid_ratio, void *allocator, bool need_extra_info, + float distance_threshold) { INIT_SUCC(ret); #ifdef OB_BUILD_CDC_DISABLE_VSAG @@ -205,7 +261,7 @@ int knn_search(obvsag::VectorIndexPtr index_handler, float* query_vector,int dim result_dist, result_ids, result_size, ef_search, need_extra_info, extra_info, invalid, reverse_filter, is_extra_info_filter, - allocator, valid_ratio); + allocator, valid_ratio, distance_threshold); #endif } @@ -226,6 +282,23 @@ int knn_search(obvsag::VectorIndexPtr index_handler, float* query_vector,int dim #endif } +int knn_search(obvsag::VectorIndexPtr index_handler, uint32_t len, uint32_t *dims, float *vals, int64_t topk, + const float *&result_dist, const int64_t *&result_ids, const char *&extra_info, int64_t &result_size, float query_prune_ratio, int64_t n_candidate, + void *invalid, bool reverse_filter, + bool is_extra_info_filter, float valid_ratio, void *allocator, bool need_extra_info) +{ + INIT_SUCC(ret); +#ifdef OB_BUILD_CDC_DISABLE_VSAG + return ret; +#else + return obvsag::knn_search(index_handler, len, dims, vals, topk, + result_dist, result_ids, extra_info, result_size, + query_prune_ratio, n_candidate, + invalid, reverse_filter, is_extra_info_filter, + valid_ratio, allocator, need_extra_info); +#endif +} + int fserialize(obvsag::VectorIndexPtr index_handler, std::ostream& out_stream) { INIT_SUCC(ret); diff --git a/deps/oblib/src/lib/vector/ob_vector_util.h b/deps/oblib/src/lib/vector/ob_vector_util.h index faa85c58f..91c48b9fb 100644 --- a/deps/oblib/src/lib/vector/ob_vector_util.h +++ b/deps/oblib/src/lib/vector/ob_vector_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_VECTOR_UTIL_H @@ -58,10 +62,19 @@ int create_index(obvsag::VectorIndexPtr& index_handler, int index_type, int16_t refine_type = 0, int16_t bq_bits_query = 32, bool bq_use_fht = false); +int create_index(obvsag::VectorIndexPtr &index_handler, int index_type, const char *dtype, const char *metric, + bool use_reorder, float doc_prune_ratio, int window_size, void *allocator = NULL, int extra_info_size = 0); + int build_index(obvsag::VectorIndexPtr index_handler, float* vector_list, int64_t* ids, int dim, int size, char *extra_info = nullptr); +int build_index(obvsag::VectorIndexPtr &index_handler, uint32_t *lens, uint32_t *dims, float *vals, int64_t *ids, + int size, char *extra_infos = nullptr); + int add_index(obvsag::VectorIndexPtr index_handler,float* vector_list, int64_t* ids, int dim, char *extra_info, int size); +int add_index(obvsag::VectorIndexPtr &index_handler, uint32_t *lens, uint32_t *dims, float *vals, int64_t *ids, int size, + char *extra_infos = nullptr); + int get_index_number(obvsag::VectorIndexPtr index_handler, int64_t &size); int get_index_type(obvsag::VectorIndexPtr index_handler); @@ -70,6 +83,11 @@ int cal_distance_by_id(obvsag::VectorIndexPtr index_handler, const int64_t *ids, int64_t count, const float *&distances); +int cal_distance_by_id(obvsag::VectorIndexPtr index_handler, + uint32_t len, uint32_t *dims, float *vals, + const int64_t *ids, + int64_t count, + const float *&distances); int get_extra_info_by_ids(obvsag::VectorIndexPtr& index_handler, const int64_t* ids, int64_t count, @@ -90,7 +108,8 @@ int knn_search(obvsag::VectorIndexPtr index_handler, bool is_extra_info_filter = false, float valid_ratio = 1.0, void *allocator = nullptr, - bool need_extra_info = false); + bool need_extra_info = false, + float distance_threshold = FLT_MAX); int knn_search(obvsag::VectorIndexPtr index_handler, float *query_vector, @@ -110,6 +129,11 @@ int knn_search(obvsag::VectorIndexPtr index_handler, void *&iter_filter, bool is_last_search = false); +int knn_search(obvsag::VectorIndexPtr index_handler, uint32_t len, uint32_t *dims, float *vals, int64_t topk, + const float *&result_dist, const int64_t *&result_ids, const char *&extra_info, int64_t &result_size, float query_prune_ratio, int64_t n_candidate, + void *invalid = nullptr, bool reverse_filter = false, + bool is_extra_info_filter = false, float valid_ratio = 1.0, void *allocator = nullptr, bool need_extra_info = false); + int fserialize(obvsag::VectorIndexPtr index_handler, std::ostream& out_stream); int fdeserialize(obvsag::VectorIndexPtr& index_handler, std::istream& in_stream); diff --git a/deps/oblib/src/lib/vector/ob_vsag_adaptor.cpp b/deps/oblib/src/lib/vector/ob_vsag_adaptor.cpp index 0e8f228cd..a0473b73b 100644 --- a/deps/oblib/src/lib/vector/ob_vsag_adaptor.cpp +++ b/deps/oblib/src/lib/vector/ob_vsag_adaptor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -23,6 +27,7 @@ #include "vsag/factory.h" #include "lib/utility/ob_print_utils.h" #include "lib/oblog/ob_log.h" +#include "lib/worker.h" #ifdef OB_BUILD_CDC_DISABLE_VSAG @@ -85,6 +90,23 @@ class HnswIndexHandler { extra_info_size_(extra_info_size), refine_type_(refine_type), bq_bits_query_(bq_bits_query), bq_use_fht_(bq_use_fht) {} + HnswIndexHandler(bool is_create, bool is_build, bool use_static, const char *dtype, const char *metric, + IndexType index_type, std::shared_ptr index, vsag::Allocator *allocator, uint64_t extra_info_size, + bool use_reorder, float doc_prune_ratio, int window_size) + : is_created_(is_create), + is_build_(is_build), + use_static_(use_static), + dtype_(dtype), + metric_(metric), + index_type_(index_type), + index_(index), + allocator_(allocator), + extra_info_size_(extra_info_size), + use_reorder_(use_reorder), + doc_prune_ratio_(doc_prune_ratio), + window_size_(window_size) + {} + ~HnswIndexHandler() { index_ = nullptr; LOG_INFO("[OBVSAG] after deconstruction, hnsw index", KP(allocator_), K(index_.use_count()), K(lbt())); @@ -94,6 +116,8 @@ class HnswIndexHandler { int add_index(const vsag::DatasetPtr &incremental); int cal_distance_by_id(const float *vector, const int64_t *ids, int64_t count, const float *&dist); + int cal_distance_by_id(uint32_t len, uint32_t *dims, float *vals, + const int64_t *ids, int64_t count, const float *&dist); int get_extra_info_by_ids(const int64_t *ids, int64_t count, char *extra_infos); int get_vid_bound(int64_t &min_vid, int64_t &max_vid); @@ -103,7 +127,7 @@ class HnswIndexHandler { const int64_t *&ids, int64_t &result_size, float valid_ratio, int index_type, FilterInterface *bitmap, bool reverse_filter, bool need_extra_info, const char *&extra_infos, - void *allocator); + void *allocator, float distance_threshold = FLT_MAX); int knn_search(const vsag::DatasetPtr &query, int64_t topk, const std::string ¶meters, const float *&dist, const int64_t *&ids, int64_t &result_size, float valid_ratio, @@ -125,6 +149,9 @@ class HnswIndexHandler { inline int16_t get_refine_type() const { return refine_type_; } inline int16_t get_bq_bits_query() const { return bq_bits_query_; } inline bool get_bq_use_fht() const { return bq_use_fht_; }; + inline bool get_use_reorder() const { return use_reorder_; } + inline float get_doc_prune_ratio() const { return doc_prune_ratio_; } + inline int get_window_size() const { return window_size_; } private: bool is_created_; @@ -143,6 +170,9 @@ class HnswIndexHandler { int16_t refine_type_; int16_t bq_bits_query_; bool bq_use_fht_; + bool use_reorder_; + float doc_prune_ratio_; + int window_size_; }; int HnswIndexHandler::build_index(const vsag::DatasetPtr &base) @@ -174,6 +204,36 @@ int HnswIndexHandler::add_index(const vsag::DatasetPtr &incremental) return ret; } +int HnswIndexHandler::cal_distance_by_id(uint32_t len, uint32_t *dims, float *vals, + const int64_t *ids, int64_t count, + const float *&dist) +{ + int ret = OB_SUCCESS; + vsag::SparseVector sparse; + sparse.len_ = len; + sparse.ids_ = dims; + sparse.vals_ = vals; + DatasetPtr query = vsag::Dataset::Make(); + query->NumElements(1)->SparseVectors(&sparse)->Owner(false); + float *dist_tmp = (float*)allocator_->Allocate(count * sizeof(float)); + if (OB_ISNULL(dist_tmp)) { + ret = OB_ALLOCATE_MEMORY_FAILED; + LOG_WARN("failed to alloc memory for cal_distance", K(ret), K(count)); + } + // TODO(ningxin.ning): support CalcDistanceById in sparse vector + for (int i = 0; i < count && OB_SUCC(ret); ++i) { + // tl::expected result = index_->CalcDistanceById(query, ids[i]); + // if (result.has_value()) { + // dist_tmp[i] = result.value(); + // } else { + // ret = vsag_errcode2ob(result.error().type); + // } + dist_tmp[i] = 0.1; + } + dist = dist_tmp; + return ret; +} + int HnswIndexHandler::cal_distance_by_id(const float *vector, const int64_t *ids, int64_t count, const float *&dist) @@ -222,7 +282,19 @@ int HnswIndexHandler::get_vid_bound(int64_t &min_vid, int64_t &max_vid) uint64_t HnswIndexHandler::estimate_memory(const uint64_t row_count, const bool is_build) { - uint64_t size = index_->EstimateMemory(row_count); + + uint64_t size = 0; + if (IPIVF_TYPE == index_type_) { + // TODO(ningxin.ning): use vsag EstimateMemory + size += 2 * sizeof(int64_t) * row_count; + // nonzero dim = 100 + size += 100 * row_count * sizeof(float) * 2; + if (use_reorder_) { + size *= 2; + } + } else { + size = index_->EstimateMemory(row_count); + } if (HNSW_BQ_TYPE == index_type_ && is_build) { if (QuantizationType::SQ8 == refine_type_) { size += (row_count * dim_ * sizeof(uint8_t)); @@ -239,7 +311,8 @@ int HnswIndexHandler::knn_search(const vsag::DatasetPtr &query, int64_t topk, int64_t &result_size, float valid_ratio, int index_type, FilterInterface *bitmap, bool reverse_filter, bool need_extra_info, - const char *&extra_infos, void *allocator) + const char *&extra_infos, void *allocator, + float distance_threshold) { int ret = OB_SUCCESS; std::function vid_filter = [bitmap, reverse_filter](int64_t id) -> bool { @@ -260,12 +333,17 @@ int HnswIndexHandler::knn_search(const vsag::DatasetPtr &query, int64_t topk, std::shared_ptr vsag_filter = std::make_shared(valid_ratio, vid_filter, exinfo_filter); vsag::Allocator *vsag_allocator = nullptr; if (allocator != nullptr) vsag_allocator = static_cast(allocator); - vsag::SearchParam search_param(false, parameters, + tl::expected, vsag::Error> result; + if (index_type_ == IPIVF_TYPE) { + result = index_->KnnSearch(query, topk, parameters, bitmap == nullptr ? nullptr : vsag_filter); + } else { + vsag::SearchParam search_param(false, parameters, bitmap == nullptr ? nullptr : vsag_filter, vsag_allocator); - tl::expected, vsag::Error> result = index_->KnnSearch(query, topk, search_param); + result = index_->KnnSearch(query, topk, search_param); + } if (result.has_value()) { - // result的生命周期 + // the lifecycle of result result.value()->Owner(false); ids = result.value()->GetIds(); dist = result.value()->GetDistances(); @@ -398,6 +476,10 @@ const char* get_index_type_str(uint8_t create_type) res = "hgraph"; break; } + case IPIVF_TYPE: { + res = "sindi"; + break; + } } return res; } @@ -472,6 +554,7 @@ int construct_vsag_create_param( } int64_t pos = 0; int64_t buff_size = 0; + const bool use_old_serial_format = true; if (OB_FAIL(databuff_printf(result_param_str, buf_len, pos, "{\"dim\":%d", int(dim)))) { LOG_WARN("failed to fill result_param_str", K(ret), K(dim)); @@ -488,6 +571,10 @@ int construct_vsag_create_param( ",\"extra_info_size\": %d", extra_info_size))) { LOG_WARN("failed to fill result_param_str", K(ret), K(extra_info_size)); + } else if (OB_FAIL(databuff_printf(result_param_str, buf_len, pos, + ",\"use_old_serial_format\":%s", + (use_old_serial_format ? "true": "false")))) { + LOG_WARN("failed to fill result_param_str", K(ret), K(extra_info_size)); } else if (OB_FAIL(databuff_printf(result_param_str, buf_len, pos, ",\"%s\":{", index_type_str))) { @@ -552,6 +639,48 @@ int construct_vsag_create_param( return ret; } +int construct_vsag_sindi_create_param(uint8_t create_type, const char *dtype, const char *metric, + void *allocator, int extra_info_size, bool use_reorder, float doc_prune_ratio, int window_size, + char *result_param_str) +{ + int ret = OB_SUCCESS; + const char *index_type_str = "index_param"; + const int64_t buf_len = 1024; + + int64_t pos = 0; + int64_t buff_size = 0; + // TODO(ningxin.ning): adapt vsag serial with seek + const bool deserialize_without_footer = true; + if (OB_FAIL(databuff_printf(result_param_str, buf_len, pos, "{\"dtype\":\"%s\"", dtype))) { + LOG_WARN("failed to fill result_param_str", K(ret), K(dtype)); + } else if (OB_FAIL(databuff_printf(result_param_str, buf_len, pos, ",\"metric_type\":\"%s\"", metric))) { + LOG_WARN("failed to fill result_param_str", K(ret), K(metric)); + } else if (OB_FAIL(databuff_printf(result_param_str, buf_len, pos, ",\"dim\": 1024"))) { + LOG_WARN("failed to fill result_param_str", K(ret)); + } else if (extra_info_size > 0 && + OB_FAIL(databuff_printf(result_param_str, buf_len, pos, ",\"extra_info_size\": %d", extra_info_size))) { + } else if (OB_FAIL(databuff_printf(result_param_str, buf_len, pos, ",\"%s\":{", index_type_str))) { + LOG_WARN("failed to fill result_param_str", K(ret), K(index_type_str)); + } else if (OB_FAIL(databuff_printf( + result_param_str, buf_len, pos, "\"use_reorder\":%s", use_reorder ? "true" : "false"))) { + LOG_WARN("failed to fill result_param_str", K(ret), K(use_reorder)); + } else if (OB_FAIL(databuff_printf(result_param_str, buf_len, pos, ",\"doc_prune_ratio\":%f", doc_prune_ratio))) { + LOG_WARN("failed to fill result_param_str", K(ret), K(doc_prune_ratio)); + } else if (OB_FAIL(databuff_printf(result_param_str, buf_len, pos, ",\"window_size\":%d", window_size))) { + LOG_WARN("failed to fill result_param_str", K(ret), K(window_size)); + } else if (OB_FAIL(databuff_printf(result_param_str, buf_len, pos, + ",\"deserialize_without_footer\":%s", + (deserialize_without_footer ? "true": "false")))) { + LOG_WARN("failed to fill result_param_str", K(ret), K(extra_info_size)); + } else if (OB_FAIL(databuff_printf(result_param_str, buf_len, pos, "}}"))) { + LOG_WARN("failed to fill result_param_str", K(ret)); + } + if (OB_SUCC(ret)) { + LOG_INFO("build param", K(create_type), KCSTRING(result_param_str), K(lbt())); + } + return ret; +} + /** eg: hnsw : {"hnsw": {"ef_search": ef_search, "skip_ratio": 0.7}} @@ -600,6 +729,36 @@ int construct_vsag_search_param(uint8_t create_type, return ret; } +int construct_vsag_sindi_search_param(float query_prune_ratio, uint64_t n_candidate, + char *result_param_str) +{ + int ret = OB_SUCCESS; + const char *index_type_str = "sindi"; + int64_t pos = 0; + int64_t buff_size = 0; + int64_t buf_len = 1024; + if (OB_FAIL(databuff_printf(result_param_str, + buf_len, + pos, + "{\"%s\":{", index_type_str))) { + LOG_WARN("failed to fill result_param_str", K(ret), K(index_type_str)); + } else if (OB_FAIL(databuff_printf(result_param_str, + buf_len, + pos, + "\"query_prune_ratio\":%f", query_prune_ratio))) { + LOG_WARN("failed to fill result_param_str", K(ret), K(index_type_str)); + } else if (OB_FAIL(databuff_printf(result_param_str, + buf_len, + pos, + ",\"n_candidate\":%lu}}", n_candidate))) { + LOG_WARN("failed to fill result_param_str", K(ret), K(index_type_str)); + } + if (OB_SUCC(ret)) { + LOG_TRACE("search param", KCSTRING(result_param_str), K(lbt())); + } + return ret; +} + int create_index(VectorIndexPtr &index_handler, IndexType index_type, const char *dtype, const char *metric, int dim, int max_degree, @@ -659,6 +818,69 @@ int create_index(VectorIndexPtr &index_handler, return ret; } +int create_index(VectorIndexPtr &index_handler, IndexType index_type, const char *dtype, const char *metric, + bool use_reorder, float doc_prune_ratio, int window_size, void *allocator, int extra_info_size /* = 0*/) +{ + int ret = OB_SUCCESS; + if (dtype == nullptr || metric == nullptr) { + ret = OB_INVALID_ARGUMENT; + LOG_WARN("[OBVSAG] null pointer", KP(dtype), KP(metric)); + } else { + vsag::Allocator *vsag_allocator = nullptr; + if (allocator == nullptr) { + vsag_allocator = nullptr; + LOG_INFO("[OBVSAG] allocator is null , use default_allocator", K(index_type), K(lbt())); + } else { + vsag_allocator = static_cast(allocator); + LOG_INFO("[OBVSAG] use caller allocator ", K(index_type), K(lbt())); + } + + const char *index_type_str = get_index_type_str(index_type); + char result_param_str[1024] = {0}; + if (OB_FAIL(construct_vsag_sindi_create_param(uint8_t(index_type), + dtype, + metric, + allocator, + extra_info_size, + use_reorder, + doc_prune_ratio, + window_size, + result_param_str))) { + LOG_WARN("construct_vsag_create_param fail", K(ret), K(index_type)); + } else { + const std::string input_json_str(result_param_str); + tl::expected, Error> index = + vsag::Factory::CreateIndex(index_type_str, input_json_str, vsag_allocator); + if (index.has_value()) { + std::shared_ptr hnsw; + hnsw = index.value(); + HnswIndexHandler *hnsw_index = new HnswIndexHandler(true, + false, + false, + dtype, + metric, + index_type, + hnsw, + vsag_allocator, + extra_info_size, + use_reorder, + doc_prune_ratio, + window_size); + if (OB_ISNULL(hnsw_index)) { + ret = OB_ALLOCATE_MEMORY_FAILED; + LOG_WARN("new HnswIndexHandler fail", K(ret), K(index_type)); + } else { + index_handler = static_cast(hnsw_index); + } + } else { + ret = vsag_errcode2ob(index.error().type); + LOG_WARN("[OBVSAG] create index error happend", K(ret), KCSTRING(result_param_str), K(index.error().type)); + } + } + } + return ret; +} + int build_index(VectorIndexPtr &index_handler, float *vector_list, int64_t *ids, int dim, int size, char *extra_infos /* = nullptr*/) { @@ -684,6 +906,37 @@ int build_index(VectorIndexPtr &index_handler, float *vector_list, return ret; } +int build_index(VectorIndexPtr &index_handler, uint32_t *lens, uint32_t *dims, float *vals, int64_t *ids, int size, + char *extra_info /* = nullptr*/) +{ + int ret = OB_SUCCESS; + if (index_handler == nullptr || lens == nullptr || dims == nullptr || vals == nullptr || ids == nullptr) { + ret = OB_INVALID_ARGUMENT; + LOG_WARN("[OBVSAG] null pointer addr", KP(index_handler), KP(lens), KP(dims), KP(vals), KP(vals), KP(ids)); + } else { + uint32_t *cur_dims_ptr = dims; + float *cur_vals_ptr = vals; + std::vector sparse_vectors(size); + for (int i = 0; i < size; i++) { + sparse_vectors[i].len_ = lens[i]; + sparse_vectors[i].ids_ = cur_dims_ptr; + sparse_vectors[i].vals_ = cur_vals_ptr; + cur_dims_ptr += lens[i]; + cur_vals_ptr += lens[i]; + } + HnswIndexHandler *handler = static_cast(index_handler); + DatasetPtr dataset = vsag::Dataset::Make(); + dataset->NumElements(size)->Ids(ids)->SparseVectors(sparse_vectors.data())->Owner(false); + if (extra_info != nullptr) { + dataset->ExtraInfos(extra_info); + } + if (OB_FAIL(handler->build_index(dataset))) { + LOG_WARN("[OBVSAG] build index error happend", K(ret)); + } + } + return ret; +} + int add_index(VectorIndexPtr &index_handler, float *vector, int64_t *ids, int dim, int size, char *extra_info /* = nullptr*/) @@ -711,6 +964,55 @@ int add_index(VectorIndexPtr &index_handler, float *vector, return ret; } +int add_index(VectorIndexPtr &index_handler, uint32_t *lens, uint32_t *dims, float *vals, int64_t *ids, int size, + char *extra_info /* = nullptr*/) +{ + int ret = OB_SUCCESS; + if (index_handler == nullptr || lens == nullptr || dims == nullptr || vals == nullptr || ids == nullptr) { + ret = OB_INVALID_ARGUMENT; + LOG_WARN("[OBVSAG] null pointer addr", KP(index_handler), KP(lens), KP(dims), KP(vals), KP(vals), KP(ids)); + } else { + uint32_t *cur_dims_ptr = dims; + float *cur_vals_ptr = vals; + std::vector sparse_vectors(size); + for (int i = 0; i < size; i++) { + sparse_vectors[i].len_ = lens[i]; + sparse_vectors[i].ids_ = cur_dims_ptr; + sparse_vectors[i].vals_ = cur_vals_ptr; + cur_dims_ptr += lens[i]; + cur_vals_ptr += lens[i]; + } + const uint32_t MAX_DIM_LIMIT = 500000; + uint32_t max_dim = 0; + for (int i = 0; i < size && OB_SUCC(ret); i++) { + uint32_t length = sparse_vectors[i].len_; + for (int j = 0; j < length && OB_SUCC(ret); j++) { + max_dim = MAX(max_dim, sparse_vectors[i].ids_[j]); + if (OB_UNLIKELY(max_dim > MAX_DIM_LIMIT)) { + ret = OB_NOT_SUPPORTED; + LOG_WARN("sparse vector dimension greater than 500000 is not supported.", K(ret), K(max_dim)); + LOG_USER_ERROR(OB_NOT_SUPPORTED, "sparse vector dimension greater than 500000 is"); + } + } + } + if (OB_FAIL(ret)) { + // do nothing + } else { + HnswIndexHandler *hnsw = static_cast(index_handler); + // add index + DatasetPtr incremental = vsag::Dataset::Make(); + incremental->NumElements(size)->Ids(ids)->SparseVectors(sparse_vectors.data())->Owner(false); + if (extra_info != nullptr) { + incremental->ExtraInfos(extra_info); + } + if (OB_FAIL(hnsw->add_index(incremental))) { + LOG_WARN("[OBVSAG] add index error happend", K(ret)); + } + } + } + return ret; +} + int get_index_type(VectorIndexPtr &index_handler) { HnswIndexHandler *hnsw = static_cast(index_handler); @@ -747,6 +1049,22 @@ int cal_distance_by_id(VectorIndexPtr &index_handler, return ret; } +int cal_distance_by_id(VectorIndexPtr &index_handler, uint32_t len, uint32_t *dims, float *vals, const int64_t *ids, + int64_t count, const float *&distances) +{ + int ret = OB_SUCCESS; + if (index_handler == nullptr) { + ret = OB_INVALID_ARGUMENT; + LOG_WARN("[OBVSAG] null pointer addr", K(index_handler)); + } else { + HnswIndexHandler *hnsw = static_cast(index_handler); + if (OB_FAIL(hnsw->cal_distance_by_id(len, dims, vals, ids, count, distances))) { + LOG_WARN("[OBVSAG] knn search error happend", K(ret)); + } + } + return ret; +} + int get_vid_bound(VectorIndexPtr &index_handler, int64_t &min_vid, int64_t &max_vid) { @@ -756,8 +1074,15 @@ int get_vid_bound(VectorIndexPtr &index_handler, LOG_WARN("[OBVSAG] null pointer addr", KP(index_handler)); } else { HnswIndexHandler *hnsw = static_cast(index_handler); - if (OB_FAIL(hnsw->get_vid_bound(min_vid, max_vid))) { - LOG_WARN("[OBVSAG] get vid bound error happend", K(ret)); + const IndexType index_type = static_cast(hnsw->get_index_type()); + if (index_type == IPIVF_TYPE) { + // TODO(ningxin.ning): support get_vid_bound for ipivf + min_vid = 0; + max_vid = 0; + } else { + if (OB_FAIL(hnsw->get_vid_bound(min_vid, max_vid))) { + LOG_WARN("[OBVSAG] get vid bound error happend", K(ret)); + } } } return ret; @@ -767,7 +1092,8 @@ int knn_search(VectorIndexPtr &index_handler, float *query_vector, int dim, int64_t topk, const float *&dist, const int64_t *&ids, int64_t &result_size, int ef_search, bool need_extra_info, const char *&extra_infos, void *invalid, bool reverse_filter, - bool use_extra_info_filter, void *allocator, float valid_ratio) + bool use_extra_info_filter, void *allocator, float valid_ratio, + float distance_threshold) { int ret = OB_SUCCESS; if (index_handler == nullptr || query_vector == nullptr) { @@ -785,8 +1111,8 @@ int knn_search(VectorIndexPtr &index_handler, float *query_vector, DatasetPtr query = vsag::Dataset::Make(); query->NumElements(1)->Dim(dim)->Float32Vectors(query_vector)->Owner(false); if (OB_FAIL(hnsw->knn_search(query, topk, input_json_string, dist, ids, - result_size, valid_ratio, index_type, bitmap, - reverse_filter, need_extra_info, extra_infos, allocator))) { + result_size, valid_ratio, index_type, bitmap, + reverse_filter, need_extra_info, extra_infos, allocator, distance_threshold))) { LOG_WARN("[OBVSAG] knn search error happend", K(ret), K(index_type), KCSTRING(result_param_str)); } } @@ -827,6 +1153,40 @@ int knn_search(VectorIndexPtr &index_handler, float *query_vector, return ret; } +int knn_search(obvsag::VectorIndexPtr &index_handler, uint32_t len, uint32_t *dims, float *vals, int64_t topk, + const float *&result_dist, const int64_t *&result_ids, const char *&extra_infos, int64_t &result_size, + float query_prune_ratio, int64_t n_candidate, void *invalid, bool reverse_filter, + bool is_extra_info_filter, float valid_ratio, void *allocator, bool need_extra_info) +{ + int ret = OB_SUCCESS; + if (index_handler == nullptr || dims == nullptr || vals == nullptr) { + ret = OB_INVALID_ARGUMENT; + LOG_WARN("[OBVSAG] null pointer addr", K(index_handler), K(dims), K(vals)); + } else { + FilterInterface *bitmap = static_cast(invalid); + HnswIndexHandler *hnsw = static_cast(index_handler); + const IndexType index_type = static_cast(hnsw->get_index_type()); + char result_param_str[1024]= {0}; + if (OB_FAIL(construct_vsag_sindi_search_param(query_prune_ratio, n_candidate, result_param_str))) { + LOG_WARN("[OBVSAG] construct_vsag_search_param fail", K(ret), K(index_type), K(n_candidate)); + } else { + const std::string input_json_string(result_param_str); + vsag::SparseVector sparse; + sparse.len_ = len; + sparse.ids_ = dims; + sparse.vals_ = vals; + DatasetPtr query = vsag::Dataset::Make(); + query->NumElements(1)->SparseVectors(&sparse)->Owner(false); + if (OB_FAIL(hnsw->knn_search(query, topk, input_json_string, result_dist, result_ids, + result_size, valid_ratio, index_type, bitmap, + reverse_filter, need_extra_info, extra_infos, allocator))) { + LOG_WARN("[OBVSAG] knn search error happend", K(ret), K(index_type), KCSTRING(result_param_str)); + } + } + } + return ret; +} + int fserialize(VectorIndexPtr &index_handler, std::ostream &out_stream) { int ret = OB_SUCCESS; @@ -869,12 +1229,32 @@ int fdeserialize(VectorIndexPtr &index_handler, int16_t refine_type = hnsw->get_refine_type(); int16_t bq_bits_query = hnsw->get_bq_bits_query(); bool bq_use_fht = hnsw->get_bq_use_fht(); + bool use_reorder = hnsw->get_use_reorder(); + float doc_prune_ratio = hnsw->get_doc_prune_ratio(); + int window_size = hnsw->get_window_size(); + char result_param_str[1024] = {0}; - if (OB_FAIL(construct_vsag_create_param( + if ((IndexType)index_type == IndexType::IPIVF_TYPE) { + if (OB_FAIL(construct_vsag_sindi_create_param(uint8_t(index_type), + dtype, + metric, + hnsw->get_allocator(), + extra_info_size, + use_reorder, + doc_prune_ratio, + window_size, + result_param_str))) { + LOG_WARN("construct_vsag_create_param fail", K(ret), K(index_type)); + } + } else { + if (OB_FAIL(construct_vsag_create_param( uint8_t(index_type), dtype, metric, dim, max_degree, ef_construction, ef_search, hnsw->get_allocator(), extra_info_size, refine_type, bq_bits_query, bq_use_fht, result_param_str))) { - LOG_WARN("construct_vsag_create_param fail", K(ret), K(index_type)); + LOG_WARN("construct_vsag_create_param fail", K(ret), K(index_type)); + } + } + if (OB_FAIL(ret)) { } else { const std::string input_json_str(result_param_str); tl::expected, Error> index = vsag::Factory::CreateIndex(index_type_str, input_json_str, hnsw->get_allocator()); @@ -949,4 +1329,4 @@ uint64_t estimate_memory(VectorIndexPtr &index_handler, const uint64_t row_count } // namespace obvsag } // namespace common } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/src/lib/vector/ob_vsag_adaptor.h b/deps/oblib/src/lib/vector/ob_vsag_adaptor.h index 428ce0e60..7d0de8c3b 100644 --- a/deps/oblib/src/lib/vector/ob_vsag_adaptor.h +++ b/deps/oblib/src/lib/vector/ob_vsag_adaptor.h @@ -1,19 +1,24 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_VSAG_ADAPTOR_H #define OB_VSAG_ADAPTOR_H #include +#include #include namespace oceanbase { @@ -32,6 +37,8 @@ enum IndexType { // IVF_PQ_TYPE, HNSW_BQ_TYPE = 5, HGRAPH_TYPE = 6, + // SPIV_TYPE, + IPIVF_TYPE = 8, MAX_INDEX_TYPE }; @@ -89,11 +96,19 @@ int create_index(VectorIndexPtr& index_handler, IndexType index_type, int max_degree, int ef_construction, int ef_search, void* allocator = nullptr, int extra_info_size = 0, int16_t refine_type = 0, int16_t bq_bits_query = 32, bool bq_use_fht = false); +int create_index(VectorIndexPtr &index_handler, IndexType index_type, const char *dtype, const char *metric, + bool use_reorder, float doc_prune_ratio, int window_size, void *allocator, int extra_info_size = 0); int build_index(VectorIndexPtr& index_handler, float* vector_list, int64_t* ids, int dim, int size, char *extra_infos = nullptr); +int build_index(VectorIndexPtr &index_handler, uint32_t *lens, uint32_t *dims, float *vals, int64_t *ids, int size, + char *extra_info = nullptr); int add_index(VectorIndexPtr& index_handler, float* vector, int64_t* ids, int dim, int size, char *extra_info = nullptr); +int add_index(VectorIndexPtr &index_handler, uint32_t *lens, uint32_t *dims, float *vals, int64_t *ids, int size, + char *extra_info = nullptr); int get_index_number(VectorIndexPtr& index_handler, int64_t &size); int get_index_type(VectorIndexPtr& index_handler); int cal_distance_by_id(VectorIndexPtr& index_handler, const float* vector, const int64_t* ids, int64_t count, const float *&distances); +int cal_distance_by_id(VectorIndexPtr& index_handler, uint32_t len, uint32_t *dims, float *vals, const int64_t *ids, + int64_t count, const float *&distances); int get_vid_bound(VectorIndexPtr& index_handler, int64_t &min_vid, int64_t &max_vid); int knn_search(VectorIndexPtr& index_handler,float* query_vector, int dim, int64_t topk, const float*& dist, const int64_t*& ids, int64_t &result_size, int ef_search, @@ -104,7 +119,12 @@ int knn_search(VectorIndexPtr& index_handler,float* query_vector, int dim, int64 const float*& dist, const int64_t*& ids, int64_t &result_size, int ef_search, bool need_extra_info, const char*& extra_infos, void* invalid = nullptr, bool reverse_filter = false, - bool use_extra_info_filter = false, void *allocator = nullptr, float valid_ratio = 1); + bool use_extra_info_filter = false, void *allocator = nullptr, float valid_ratio = 1, float distance_threshold = FLT_MAX); +int knn_search(obvsag::VectorIndexPtr &index_handler, uint32_t len, uint32_t *dims, float *vals, int64_t topk, + const float *&result_dist, const int64_t *&result_ids, const char *&extra_infos, int64_t &result_size, + float query_prune_ratio, int64_t n_candidate, void *invalid = nullptr, bool reverse_filter = false, + bool is_extra_info_filter = false, float valid_ratio = 1.0, void *allocator = nullptr, + bool need_extra_info = false); int serialize(VectorIndexPtr& index_handler, const std::string dir); int deserialize_bin(VectorIndexPtr& index_handler, const std::string dir); int fserialize(VectorIndexPtr& index_handler, std::ostream& out_stream); @@ -121,4 +141,4 @@ int get_extra_info_by_ids(VectorIndexPtr& index_handler, } // namespace common } // namespace oceanbase -#endif /* OB_VECTOR_UTIL_H */ \ No newline at end of file +#endif /* OB_VECTOR_UTIL_H */ diff --git a/deps/oblib/src/lib/vtoa/ob_vtoa_util.cpp b/deps/oblib/src/lib/vtoa/ob_vtoa_util.cpp index c3f9678c8..35562ece7 100644 --- a/deps/oblib/src/lib/vtoa/ob_vtoa_util.cpp +++ b/deps/oblib/src/lib/vtoa/ob_vtoa_util.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -115,4 +119,4 @@ int ObVTOAUtility::get_virtual_addr(const int connfd, bool &is_slb, int64_t &vid } } // namespace lib -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/vtoa/ob_vtoa_util.h b/deps/oblib/src/lib/vtoa/ob_vtoa_util.h index 16d3e922e..89b6a2e12 100644 --- a/deps/oblib/src/lib/vtoa/ob_vtoa_util.h +++ b/deps/oblib/src/lib/vtoa/ob_vtoa_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_VTOA_UTIL_H @@ -40,4 +44,4 @@ class ObVTOAUtility } // namespace lib } // namespace oceanbase -#endif // OB_VTOA_UTIL_H \ No newline at end of file +#endif // OB_VTOA_UTIL_H diff --git a/deps/oblib/src/lib/wait_event/ob_inner_sql_wait_type.h b/deps/oblib/src/lib/wait_event/ob_inner_sql_wait_type.h index ca6df44c7..20f4997f0 100644 --- a/deps/oblib/src/lib/wait_event/ob_inner_sql_wait_type.h +++ b/deps/oblib/src/lib/wait_event/ob_inner_sql_wait_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef DEF_INNER_SQL_WAIT DEF_INNER_SQL_WAIT(NULL_INNER_SQL, 0) @@ -45,7 +49,6 @@ DEF_INNER_SQL_WAIT(LOG_GET_LS_PRIMARY_ZONE_INFO, 50005) DEF_INNER_SQL_WAIT(LOG_GET_TENANT_RECOVERY_STAT, 50006) //*************** end of log *************** - //*************** start of observer *************** DEF_INNER_SQL_WAIT(OMT_FETCH_ALL_SRS, 60001) //*************** end of observer *************** @@ -55,17 +58,16 @@ DEF_INNER_SQL_WAIT(SQL_DYNAMIC_SAMPLING_ESTIMATE_ROWCOUNT, 70001) //*************** end of sql *************** //*************** start of location *************** -DEF_INNER_SQL_WAIT(RENEW_TABLET_LOCATION, 80001) // 获取location -DEF_INNER_SQL_WAIT(GET_TABLET_LOCATION, 80002) // 刷新location +DEF_INNER_SQL_WAIT(RENEW_TABLET_LOCATION, 80001) // get location +DEF_INNER_SQL_WAIT(GET_TABLET_LOCATION, 80002) // refresh location //*************** end of location *************** //*************** start of schema *************** -DEF_INNER_SQL_WAIT(WAIT_REFRESH_SCHEMA, 90001) // 同步等待schema刷新到指定版本 -DEF_INNER_SQL_WAIT(ASYNC_REFRESH_SCHEMA, 90002) // 刷新schema任务 -DEF_INNER_SQL_WAIT(REFRESH_SCHEMA, 90003) // 后台刷新schema任务 +DEF_INNER_SQL_WAIT(WAIT_REFRESH_SCHEMA, 90001) // synchronous wait for schema refresh to specified version +DEF_INNER_SQL_WAIT(ASYNC_REFRESH_SCHEMA, 90002) // schema refresh task +DEF_INNER_SQL_WAIT(REFRESH_SCHEMA, 90003) // background schema refresh task //*************** end of schema *************** - #endif // DEF_INNER_SQL_WAIT #ifndef _OB_INNER_SQL_WAIT_TYPE_H_ diff --git a/deps/oblib/src/lib/wait_event/ob_wait_class.cpp b/deps/oblib/src/lib/wait_event/ob_wait_class.cpp index 914b13c1b..972c871f1 100644 --- a/deps/oblib/src/lib/wait_event/ob_wait_class.cpp +++ b/deps/oblib/src/lib/wait_event/ob_wait_class.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/wait_event/ob_wait_class.h" diff --git a/deps/oblib/src/lib/wait_event/ob_wait_class.h b/deps/oblib/src/lib/wait_event/ob_wait_class.h index 3c500c0ee..dfdd57d13 100644 --- a/deps/oblib/src/lib/wait_event/ob_wait_class.h +++ b/deps/oblib/src/lib/wait_event/ob_wait_class.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef WAIT_CLASS_DEF diff --git a/deps/oblib/src/lib/wait_event/ob_wait_event.cpp b/deps/oblib/src/lib/wait_event/ob_wait_event.cpp index 9fca90e02..d23627d9c 100644 --- a/deps/oblib/src/lib/wait_event/ob_wait_event.cpp +++ b/deps/oblib/src/lib/wait_event/ob_wait_event.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/stat/ob_latch_define.h" diff --git a/deps/oblib/src/lib/wait_event/ob_wait_event.h b/deps/oblib/src/lib/wait_event/ob_wait_event.h index 552a8995a..c2aaa321e 100644 --- a/deps/oblib/src/lib/wait_event/ob_wait_event.h +++ b/deps/oblib/src/lib/wait_event/ob_wait_event.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef WAIT_EVENT_DEF diff --git a/deps/oblib/src/lib/wide_integer/ob_wide_integer.cpp b/deps/oblib/src/lib/wide_integer/ob_wide_integer.cpp index df5b7c990..b0cf05a6b 100644 --- a/deps/oblib/src/lib/wide_integer/ob_wide_integer.cpp +++ b/deps/oblib/src/lib/wide_integer/ob_wide_integer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/deps/oblib/src/lib/wide_integer/ob_wide_integer.h b/deps/oblib/src/lib/wide_integer/ob_wide_integer.h index 2ef9da9cd..309f9e03b 100644 --- a/deps/oblib/src/lib/wide_integer/ob_wide_integer.h +++ b/deps/oblib/src/lib/wide_integer/ob_wide_integer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_WIDE_INTEGER_H_ diff --git a/deps/oblib/src/lib/wide_integer/ob_wide_integer_cmp_funcs.cpp b/deps/oblib/src/lib/wide_integer/ob_wide_integer_cmp_funcs.cpp index 0dddda13a..2c3dc193d 100644 --- a/deps/oblib/src/lib/wide_integer/ob_wide_integer_cmp_funcs.cpp +++ b/deps/oblib/src/lib/wide_integer/ob_wide_integer_cmp_funcs.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/object/ob_object.h" diff --git a/deps/oblib/src/lib/wide_integer/ob_wide_integer_cmp_funcs.h b/deps/oblib/src/lib/wide_integer/ob_wide_integer_cmp_funcs.h index 3704a7013..c31908479 100644 --- a/deps/oblib/src/lib/wide_integer/ob_wide_integer_cmp_funcs.h +++ b/deps/oblib/src/lib/wide_integer/ob_wide_integer_cmp_funcs.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_WIDE_INTEGER_CMP_FUNCS_ @@ -55,7 +59,7 @@ class ObDecimalIntCmpSet }; // TODO: unittest -// decimal int 比较,scale必须先提升到一样 +// decimal int comparison, scale must be raised to the same level first // helper functions template int compare(const T &lhs, const P &rhs, int &result) @@ -97,4 +101,4 @@ bool abs_equal(const T &lhs, const P &rhs) } // end namespace wide } // end namespace common } // end namespace oceanbase -#endif // !OB_WIDE_INTEGER_CMP_FUNCS_ \ No newline at end of file +#endif // !OB_WIDE_INTEGER_CMP_FUNCS_ diff --git a/deps/oblib/src/lib/wide_integer/ob_wide_integer_helper.h b/deps/oblib/src/lib/wide_integer/ob_wide_integer_helper.h index b1b5bc923..06668f8b0 100644 --- a/deps/oblib/src/lib/wide_integer/ob_wide_integer_helper.h +++ b/deps/oblib/src/lib/wide_integer/ob_wide_integer_helper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_WIDE_INTEGER_HELPER_H_ diff --git a/deps/oblib/src/lib/wide_integer/ob_wide_integer_impl.h b/deps/oblib/src/lib/wide_integer/ob_wide_integer_impl.h index e85fde457..535947022 100644 --- a/deps/oblib/src/lib/wide_integer/ob_wide_integer_impl.h +++ b/deps/oblib/src/lib/wide_integer/ob_wide_integer_impl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_WIDE_INTEGER_IMPL_H_ diff --git a/deps/oblib/src/lib/wide_integer/ob_wide_integer_str_funcs.cpp b/deps/oblib/src/lib/wide_integer/ob_wide_integer_str_funcs.cpp index ce81f0d55..79a637f0b 100644 --- a/deps/oblib/src/lib/wide_integer/ob_wide_integer_str_funcs.cpp +++ b/deps/oblib/src/lib/wide_integer/ob_wide_integer_str_funcs.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/wide_integer/ob_wide_integer.h" diff --git a/deps/oblib/src/lib/wide_integer/ob_wide_integer_str_funcs.h b/deps/oblib/src/lib/wide_integer/ob_wide_integer_str_funcs.h index 22c3c7fd6..2694c9bdc 100644 --- a/deps/oblib/src/lib/wide_integer/ob_wide_integer_str_funcs.h +++ b/deps/oblib/src/lib/wide_integer/ob_wide_integer_str_funcs.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_WIDE_INTEGER_STR_FUNCS_H_ diff --git a/deps/oblib/src/lib/worker.cpp b/deps/oblib/src/lib/worker.cpp index c19d399e4..05ee47ada 100644 --- a/deps/oblib/src/lib/worker.cpp +++ b/deps/oblib/src/lib/worker.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/worker.h b/deps/oblib/src/lib/worker.h index 2a2d07024..b9cf6b994 100644 --- a/deps/oblib/src/lib/worker.h +++ b/deps/oblib/src/lib/worker.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_LIB_WORKER_H_ @@ -140,9 +144,9 @@ class Worker common::ObDLinkNode worker_node_; void *group_; protected: - // 线程运行时内存从此分配器分配 - // 初始tenant_id=500, 在处理request时,tenant_id被更新成request的租户id - // 可单独指定ctx_id, 此ctx_id保持不变 + // Thread runtime memory is allocated from this allocator + // Initial tenant_id=500, in processing request, tenant_id is updated to the tenant id of the request + // You can specify ctx_id individually, this ctx_id remains unchanged ObIAllocator *allocator_; int64_t st_current_priority_; sql::ObSQLSessionInfo *session_; @@ -187,7 +191,7 @@ inline Worker &Worker::self() inline ObIAllocator &Worker::get_allocator() { - // 预期只在处理请求过程中调用 + // Expected to be called only during request processing abort_unless(allocator_ != nullptr); return *allocator_; } diff --git a/deps/oblib/src/lib/xml/ob_binary_aggregate.cpp b/deps/oblib/src/lib/xml/ob_binary_aggregate.cpp index 57ef76485..58ce7b281 100644 --- a/deps/oblib/src/lib/xml/ob_binary_aggregate.cpp +++ b/deps/oblib/src/lib/xml/ob_binary_aggregate.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the json and xml binary aggregate. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_ENG @@ -916,4 +919,4 @@ void ObBinAggSerializer::do_xml_sort() }; // namespace common -}; // namespace oceanbase \ No newline at end of file +}; // namespace oceanbase diff --git a/deps/oblib/src/lib/xml/ob_binary_aggregate.h b/deps/oblib/src/lib/xml/ob_binary_aggregate.h index c76dbc833..0e95051e0 100644 --- a/deps/oblib/src/lib/xml/ob_binary_aggregate.h +++ b/deps/oblib/src/lib/xml/ob_binary_aggregate.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the json and xml binary aggregate. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_BINARY_AGGREGATE @@ -173,4 +176,4 @@ class ObBinAggSerializer { }; // namespace oceanbase -#endif // OCEANBASE_SQL_OB_BINARY_AGGREGATE \ No newline at end of file +#endif // OCEANBASE_SQL_OB_BINARY_AGGREGATE diff --git a/deps/oblib/src/lib/xml/ob_libxml2_sax_handler.cpp b/deps/oblib/src/lib/xml/ob_libxml2_sax_handler.cpp index 943a1fbad..f0a0cb08f 100644 --- a/deps/oblib/src/lib/xml/ob_libxml2_sax_handler.cpp +++ b/deps/oblib/src/lib/xml/ob_libxml2_sax_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/xml/ob_libxml2_sax_handler.h b/deps/oblib/src/lib/xml/ob_libxml2_sax_handler.h index 14cf3e669..b6855c49e 100644 --- a/deps/oblib/src/lib/xml/ob_libxml2_sax_handler.h +++ b/deps/oblib/src/lib/xml/ob_libxml2_sax_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LIBXML2_SAX_HANDLER_H_ #define OCEANBASE_LIBXML2_SAX_HANDLER_H_ @@ -44,4 +48,4 @@ struct ObLibXml2SaxHandler }; } // namespace common } // namespace oceanbase -#endif //OCEANBASE_LIBXML2_SAX_HANDLER_H_ \ No newline at end of file +#endif //OCEANBASE_LIBXML2_SAX_HANDLER_H_ diff --git a/deps/oblib/src/lib/xml/ob_mul_mode_reader.cpp b/deps/oblib/src/lib/xml/ob_mul_mode_reader.cpp index 7fb9bd396..caba99292 100644 --- a/deps/oblib/src/lib/xml/ob_mul_mode_reader.cpp +++ b/deps/oblib/src/lib/xml/ob_mul_mode_reader.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface implement for multi mode reader abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_ENG #include "ob_mul_mode_reader.h" diff --git a/deps/oblib/src/lib/xml/ob_mul_mode_reader.h b/deps/oblib/src/lib/xml/ob_mul_mode_reader.h index c9118acf8..b09e512e9 100644 --- a/deps/oblib/src/lib/xml/ob_mul_mode_reader.h +++ b/deps/oblib/src/lib/xml/ob_mul_mode_reader.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface define for multi mode reader abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_MULTI_MODE_READER diff --git a/deps/oblib/src/lib/xml/ob_multi_mode_bin.cpp b/deps/oblib/src/lib/xml/ob_multi_mode_bin.cpp index d983bb9ea..4df5cc4b1 100644 --- a/deps/oblib/src/lib/xml/ob_multi_mode_bin.cpp +++ b/deps/oblib/src/lib/xml/ob_multi_mode_bin.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implement for the xml & json type data basic interface abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -517,4 +520,4 @@ int ObMulModeBinMerge::append_header_to_res(ObBinMergeCtx& ctx, ObIMulModeBase& } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/xml/ob_multi_mode_bin.h b/deps/oblib/src/lib/xml/ob_multi_mode_bin.h index 9fececb60..b1590cf42 100644 --- a/deps/oblib/src/lib/xml/ob_multi_mode_bin.h +++ b/deps/oblib/src/lib/xml/ob_multi_mode_bin.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface support for the xml & json basic interface abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_MUL_MODE_BIN_BASE @@ -104,9 +107,9 @@ typedef struct ObMulModeBinHeader { reserved_(0) {} uint8_t type_; // node type for current node - uint8_t kv_entry_size_type_ : 2; // the size describe var size of key_entry,val_entry + uint8_t kv_entry_size_type_ : 2; // the size describe var size of key_entry, val_entry uint8_t count_size_type_ : 2; // the size describe var size of element count - uint8_t obj_size_type_ : 2; // the size describe var size of key_entry,val_entry + uint8_t obj_size_type_ : 2; // the size describe var size of key_entry, val_entry uint8_t is_continuous_ : 1; // memory of current node and subtree is continous uint8_t reserved_ : 1; // reserved bit char used_size_[]; // var size @@ -379,4 +382,4 @@ class ObMulModeBinMerge { } // namespace common } // namespace oceanbase -#endif // OCEANBASE_MUL_MODE_BIN_BASE \ No newline at end of file +#endif // OCEANBASE_MUL_MODE_BIN_BASE diff --git a/deps/oblib/src/lib/xml/ob_multi_mode_interface.cpp b/deps/oblib/src/lib/xml/ob_multi_mode_interface.cpp index 4f5010e63..694c4aea8 100644 --- a/deps/oblib/src/lib/xml/ob_multi_mode_interface.cpp +++ b/deps/oblib/src/lib/xml/ob_multi_mode_interface.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains parts interface implement for the multi mode type data abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/xml/ob_multi_mode_interface.h b/deps/oblib/src/lib/xml/ob_multi_mode_interface.h index f29323b56..028929967 100644 --- a/deps/oblib/src/lib/xml/ob_multi_mode_interface.h +++ b/deps/oblib/src/lib/xml/ob_multi_mode_interface.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface define for the multi mode type data abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_MULTI_MODE_INTERFACE @@ -500,7 +503,7 @@ class ObIMulModeBase { */ virtual int update(ObIMulModeBase* old_node, ObIMulModeBase* new_node) = 0; - // serialize as text string,json xml both require + // serialize as text string, json xml both require // format_flag: use 32 bit to indicate the print format, the specific meaning of each bit decided by each data type virtual int print(ObStringBuffer& x_buf, uint32_t format_flag, uint64_t depth = 0, uint64_t size = 0, ObCollationType charset = CS_TYPE_INVALID); diff --git a/deps/oblib/src/lib/xml/ob_path_parser.cpp b/deps/oblib/src/lib/xml/ob_path_parser.cpp index a92615293..92e2412a8 100644 --- a/deps/oblib/src/lib/xml/ob_path_parser.cpp +++ b/deps/oblib/src/lib/xml/ob_path_parser.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the XML path abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_RESV @@ -1022,7 +1025,7 @@ int ObPathParser::parse_primary_expr_node(ObPathArgType patharg_type) { INIT_SUCC(ret); ObXPathUtil::skip_whitespace(expression_, index_); - // 记得index + n + // Remember index + n bool is_cmp = false; if (index_ < len_) { if (expression_[index_] == ObPathItem::DOLLAR) { @@ -2233,4 +2236,4 @@ int ObPathParser::parse_filter_node(ObPathNode*& filter, ObPathArgType patharg_t } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/xml/ob_path_parser.h b/deps/oblib/src/lib/xml/ob_path_parser.h index bd770e6c2..a1d84b0ac 100644 --- a/deps/oblib/src/lib/xml/ob_path_parser.h +++ b/deps/oblib/src/lib/xml/ob_path_parser.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface support for the Xml Path abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_PATH_PARSER @@ -175,4 +178,4 @@ class ObPathParserUtil } } -#endif // OCEANBASE_SQL_OB_XPATH_PARSE \ No newline at end of file +#endif // OCEANBASE_SQL_OB_XPATH_PARSE diff --git a/deps/oblib/src/lib/xml/ob_tree_base.cpp b/deps/oblib/src/lib/xml/ob_tree_base.cpp index 8d1b231c7..66a85eca9 100644 --- a/deps/oblib/src/lib/xml/ob_tree_base.cpp +++ b/deps/oblib/src/lib/xml/ob_tree_base.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface implement for the tree base abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_ENG @@ -658,7 +661,7 @@ void ObLibContainerNode::sort() std::stable_sort(sorted_children_->begin(), sorted_children_->end(), cmp); } } - // 数据修改接口, 修改的是孩子 + // Data modification interface, modifying the child int ObLibContainerNode::append(ObLibTreeNodeBase* node) { INIT_SUCC(ret); diff --git a/deps/oblib/src/lib/xml/ob_tree_base.h b/deps/oblib/src/lib/xml/ob_tree_base.h index 57cfbd292..5c96f5bda 100644 --- a/deps/oblib/src/lib/xml/ob_tree_base.h +++ b/deps/oblib/src/lib/xml/ob_tree_base.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface define for the tree base abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_TREE_BASE @@ -70,12 +73,11 @@ class ObLibTreeNodeBase { int get_key(ObString& key); int insert_prev(ObLibTreeNodeBase* new_node); - - // 返回节点具体类型 - // 例如:json返回jsonInt,jsonDouble - // xml 返回xmlElment, XmlAttribute + // Return the specific type of the node + // For example: json returns jsonInt, jsonDouble + // xml returns xmlElment, XmlAttribute virtual int node_type() { return type_; } - // 数据修改接口, 修改的是孩子 + // Data modification interface, modifying the child virtual int append(ObLibTreeNodeBase* node) = 0; virtual int insert(int64_t pos, ObLibTreeNodeBase* node) = 0; virtual int remove(int64_t pos) = 0; @@ -95,7 +97,7 @@ class ObLibTreeNodeBase { ObNodeDataType type_; int32_t flags_; int32_t pos_; - /* 父节点,公共 */ + /* parent node, common */ ObLibTreeNodeBase* parent_; }; @@ -142,8 +144,7 @@ class ObLibContainerNode : public ObLibTreeNodeBase { virtual int64_t size() const; virtual int64_t count() const; - - // 数据修改接口, 修改的是孩子 + // Data modification interface, modifying the child int append(ObLibTreeNodeBase* node) override; int insert(int64_t pos, ObLibTreeNodeBase* node) override; int remove(int64_t pos) override; @@ -311,4 +312,4 @@ typedef ObLibContainerNode::IterRange IterRange; } } -#endif // OCEANBASE_SQL_OB_TREE_BASE \ No newline at end of file +#endif // OCEANBASE_SQL_OB_TREE_BASE diff --git a/deps/oblib/src/lib/xml/ob_xml_bin.cpp b/deps/oblib/src/lib/xml/ob_xml_bin.cpp index c0d5e6fec..a970d2987 100644 --- a/deps/oblib/src/lib/xml/ob_xml_bin.cpp +++ b/deps/oblib/src/lib/xml/ob_xml_bin.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implement for the xml bin abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_ENG #include "ob_xml_bin.h" diff --git a/deps/oblib/src/lib/xml/ob_xml_bin.h b/deps/oblib/src/lib/xml/ob_xml_bin.h index d13e63c5d..12a416634 100644 --- a/deps/oblib/src/lib/xml/ob_xml_bin.h +++ b/deps/oblib/src/lib/xml/ob_xml_bin.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface support for the xml bin abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_XML_BIN @@ -220,8 +223,7 @@ struct ObXmlDocBinHeader { uint16_t reserved_ : 9; }; }; - - // 如果is_prefix, is_standalone_, is_encoding_是0, 则不会序列化相应的成员 + // If is_prefix, is_standalone_, is_encoding_ is 0, then the corresponding members will not be serialized uint8_t version_len_; uint8_t encode_len_; uint16_t standalone_; @@ -961,4 +963,4 @@ class ObXmlBinMerge : public ObMulModeBinMerge { } // namespace common } // namespace oceanbase -#endif // OCEANBASE_SQL_OB_XML_BIN \ No newline at end of file +#endif // OCEANBASE_SQL_OB_XML_BIN diff --git a/deps/oblib/src/lib/xml/ob_xml_parser.cpp b/deps/oblib/src/lib/xml/ob_xml_parser.cpp index 8b3ec28ca..3b5198c7d 100644 --- a/deps/oblib/src/lib/xml/ob_xml_parser.cpp +++ b/deps/oblib/src/lib/xml/ob_xml_parser.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/src/lib/xml/ob_xml_parser.h b/deps/oblib/src/lib/xml/ob_xml_parser.h index 1c84ceb16..73f2ddb36 100644 --- a/deps/oblib/src/lib/xml/ob_xml_parser.h +++ b/deps/oblib/src/lib/xml/ob_xml_parser.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_XML_PARSER_H_ @@ -266,4 +270,4 @@ class ObXmlParserUtils { } // namespace common } // namespace oceanbase -#endif //OCEANBASE_XML_PARSER_H_ \ No newline at end of file +#endif //OCEANBASE_XML_PARSER_H_ diff --git a/deps/oblib/src/lib/xml/ob_xml_tree.cpp b/deps/oblib/src/lib/xml/ob_xml_tree.cpp index afa290027..c6756d8a8 100644 --- a/deps/oblib/src/lib/xml/ob_xml_tree.cpp +++ b/deps/oblib/src/lib/xml/ob_xml_tree.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface support for the xml tree abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB #include "ob_xml_tree.h" @@ -613,7 +616,7 @@ int ObXmlElement::remove_element(ObXmlNode* xnode) return ret; } -int ObXmlElement::compare(const ObString& key, int& res) // 0, 1,-1 +int ObXmlElement::compare(const ObString& key, int& res) // 0, 1, -1 { INIT_SUCC(ret); res = key.compare(tag_info_); diff --git a/deps/oblib/src/lib/xml/ob_xml_tree.h b/deps/oblib/src/lib/xml/ob_xml_tree.h index 54477ca26..61890aa06 100644 --- a/deps/oblib/src/lib/xml/ob_xml_tree.h +++ b/deps/oblib/src/lib/xml/ob_xml_tree.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface support for the xml tree abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_XML_TREE @@ -346,7 +349,7 @@ class ObXmlElement : public ObXmlNode uint16 flags_; struct { uint16_t standalone_ : 4; // : default 0, yes 1, no 2, other 3; - uint16_t has_xml_decl_: 1; // no 0, yes 1 + uint16_t has_xml_decl_: 1; // no 0, yes 1 uint16_t is_empty_: 1; // empty uint16_t is_unparse_: 1; // well format element uint16_t encoding_val_empty_: 1; // has encoding clause but encoding value is null @@ -511,7 +514,7 @@ class ObXmlText : public ObXmlNode { const ObString get_text() { return text_; } // get TEXT size_t get_length() { return length_; } // get length void set_text(const ObString text) {text_.assign_ptr(text.ptr(), text.length()); length_ = text.length();} // set text and length - void set_length(int length) { length_ = length; } // update length。 + void set_length(int length) { length_ = length; } // update length. bool is_space() { return is_space_; } void set_is_space(bool is_space) { is_space_ = is_space; } int64_t get_serialize_size(); diff --git a/deps/oblib/src/lib/xml/ob_xml_util.cpp b/deps/oblib/src/lib/xml/ob_xml_util.cpp index 65417ac61..925898868 100644 --- a/deps/oblib/src/lib/xml/ob_xml_util.cpp +++ b/deps/oblib/src/lib/xml/ob_xml_util.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface implement for the xml util abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_ENG @@ -460,7 +463,7 @@ int ObXmlUtil::to_string(ObIAllocator &allocator, double &in, char *&out) } else if (std::isinf(in) && in < 0) { res_buf.append("-Infinity"); } else { - // TODO 科学计数法是否需要考虑 待定 + // TODO Should scientific notation be considered? To be determined uint64_t out_len; const int64_t number_str_size = 256; double abs_value = fabs(in); diff --git a/deps/oblib/src/lib/xml/ob_xml_util.h b/deps/oblib/src/lib/xml/ob_xml_util.h index 2ae0cce7d..4483ed06b 100644 --- a/deps/oblib/src/lib/xml/ob_xml_util.h +++ b/deps/oblib/src/lib/xml/ob_xml_util.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface define for the xml util abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_XML_UTIL @@ -264,8 +267,7 @@ class ObXmlUtil { static int compare(ObString left, ObString right, ObFilterType op, bool &res); static int compare(bool left, bool right, ObFilterType op, bool &res); static int init_print_ns(ObIAllocator *allocator, ObIMulModeBase *src, ObNsSortedVector& ns_vec, ObNsSortedVector*& vec_point); - - // 调用的时候特殊处理OB_OP_NOT_ALLOW + // Call with special handling for OB_OP_NOT_ALLOW // calculate: + - * div % // logic compare: and/or diff --git a/deps/oblib/src/lib/xml/ob_xpath.cpp b/deps/oblib/src/lib/xml/ob_xpath.cpp index 18dd14445..657c50260 100644 --- a/deps/oblib/src/lib/xml/ob_xpath.cpp +++ b/deps/oblib/src/lib/xml/ob_xpath.cpp @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains implementation support for the XML path abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_RESV @@ -3160,4 +3163,4 @@ int ObPathUtil::alloc_node_content_info(ObIAllocator *allocator, ObArgNodeConten } } // namespace common -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/deps/oblib/src/lib/xml/ob_xpath.h b/deps/oblib/src/lib/xml/ob_xpath.h index 74b1789a9..7f89a9d10 100644 --- a/deps/oblib/src/lib/xml/ob_xpath.h +++ b/deps/oblib/src/lib/xml/ob_xpath.h @@ -1,14 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - * This file contains interface support for the XML Path abstraction. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_XPATH @@ -951,4 +954,4 @@ class ObPathExprIter } } -#endif // OCEANBASE_SQL_OB_XPATH \ No newline at end of file +#endif // OCEANBASE_SQL_OB_XPATH diff --git a/deps/oblib/src/rpc/easy/include/easy/easy_maccept.h b/deps/oblib/src/rpc/easy/include/easy/easy_maccept.h index d0c0b1c3c..d4f03ae56 100644 --- a/deps/oblib/src/rpc/easy/include/easy/easy_maccept.h +++ b/deps/oblib/src/rpc/easy/include/easy/easy_maccept.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __EASY_MACCEPT_H__ diff --git a/deps/oblib/src/rpc/easy/include/easy/easy_mod_stat.h b/deps/oblib/src/rpc/easy/include/easy/easy_mod_stat.h index a8b2f54d2..4981f5a40 100644 --- a/deps/oblib/src/rpc/easy/include/easy/easy_mod_stat.h +++ b/deps/oblib/src/rpc/easy/include/easy/easy_mod_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef __EASY_MOD_STAT__ diff --git a/deps/oblib/src/rpc/frame/ob_net_easy.cpp b/deps/oblib/src/rpc/frame/ob_net_easy.cpp index 33da30b10..2beb23fbd 100644 --- a/deps/oblib/src/rpc/frame/ob_net_easy.cpp +++ b/deps/oblib/src/rpc/frame/ob_net_easy.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_FRAME @@ -412,8 +416,7 @@ void easy_request_addbuf(easy_request_t *r, easy_buf_t *b) { easy_message_session_t *ms = r->ms; b->session = NULL; - - // 在超时的时间用到 + // Used at the timeout time if ((ms->type == EASY_TYPE_SESSION) || (ms->type == EASY_TYPE_KEEPALIVE_SESSION) || (ms->type == EASY_TYPE_RL_SESSION)) { @@ -429,8 +432,7 @@ void easy_request_addbuf(easy_request_t *r, easy_buf_t *b) easy_list_add_tail(&b->node, &ms->c->output); } - -// easy_pool_alloc_ex函数 +// easy_pool_alloc_ex function void *easy_pool_alloc_ex(easy_pool_t *pool, uint32_t size, int align) { uint8_t *m; @@ -461,7 +463,7 @@ void *easy_pool_alloc_ex(easy_pool_t *pool, uint32_t size, int align) } while (p); easy_cur_mod_stat = pool->mod_stat; - // 重新分配一块出来 + // Reallocate a block out if (p == NULL) { m = (uint8_t *)easy_pool_alloc_block(pool, size); } diff --git a/deps/oblib/src/rpc/frame/ob_net_easy.h b/deps/oblib/src/rpc/frame/ob_net_easy.h index 4a6970a3a..61b606bc2 100644 --- a/deps/oblib/src/rpc/frame/ob_net_easy.h +++ b/deps/oblib/src/rpc/frame/ob_net_easy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_RPC_FRAME_OB_NET_EASY_H_ diff --git a/deps/oblib/src/rpc/frame/ob_req_deliver.cpp b/deps/oblib/src/rpc/frame/ob_req_deliver.cpp index 6032c32e5..0a18e589d 100644 --- a/deps/oblib/src/rpc/frame/ob_req_deliver.cpp +++ b/deps/oblib/src/rpc/frame/ob_req_deliver.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_FRAME diff --git a/deps/oblib/src/rpc/frame/ob_req_deliver.h b/deps/oblib/src/rpc/frame/ob_req_deliver.h index 135ea168a..6f733fd91 100644 --- a/deps/oblib/src/rpc/frame/ob_req_deliver.h +++ b/deps/oblib/src/rpc/frame/ob_req_deliver.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_RPC_FRAME_OB_REQ_DELIVER_H_ diff --git a/deps/oblib/src/rpc/frame/ob_req_handler.cpp b/deps/oblib/src/rpc/frame/ob_req_handler.cpp index e02f8de39..17f0d1651 100644 --- a/deps/oblib/src/rpc/frame/ob_req_handler.cpp +++ b/deps/oblib/src/rpc/frame/ob_req_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_FRAME diff --git a/deps/oblib/src/rpc/frame/ob_req_handler.h b/deps/oblib/src/rpc/frame/ob_req_handler.h index a14f84589..960e9bd65 100644 --- a/deps/oblib/src/rpc/frame/ob_req_handler.h +++ b/deps/oblib/src/rpc/frame/ob_req_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_RPC_FRAME_OB_REQ_HANDLER_H_ diff --git a/deps/oblib/src/rpc/frame/ob_req_processor.cpp b/deps/oblib/src/rpc/frame/ob_req_processor.cpp index 718ede94f..5761c19ef 100644 --- a/deps/oblib/src/rpc/frame/ob_req_processor.cpp +++ b/deps/oblib/src/rpc/frame/ob_req_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_FRAME diff --git a/deps/oblib/src/rpc/frame/ob_req_processor.h b/deps/oblib/src/rpc/frame/ob_req_processor.h index b2c4a2e57..6ab422e4e 100644 --- a/deps/oblib/src/rpc/frame/ob_req_processor.h +++ b/deps/oblib/src/rpc/frame/ob_req_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_RPC_FRAME_OB_REQ_PROCESSOR_H_ diff --git a/deps/oblib/src/rpc/frame/ob_req_qhandler.cpp b/deps/oblib/src/rpc/frame/ob_req_qhandler.cpp index 7e0da7794..dc541ef90 100644 --- a/deps/oblib/src/rpc/frame/ob_req_qhandler.cpp +++ b/deps/oblib/src/rpc/frame/ob_req_qhandler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_FRAME diff --git a/deps/oblib/src/rpc/frame/ob_req_qhandler.h b/deps/oblib/src/rpc/frame/ob_req_qhandler.h index 9991a4073..921217eff 100644 --- a/deps/oblib/src/rpc/frame/ob_req_qhandler.h +++ b/deps/oblib/src/rpc/frame/ob_req_qhandler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_RPC_FRAME_OB_REQ_QHANDLER_H_ diff --git a/deps/oblib/src/rpc/frame/ob_req_queue_thread.cpp b/deps/oblib/src/rpc/frame/ob_req_queue_thread.cpp index 3304fcf4a..35a50cdf8 100644 --- a/deps/oblib/src/rpc/frame/ob_req_queue_thread.cpp +++ b/deps/oblib/src/rpc/frame/ob_req_queue_thread.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_FRAME diff --git a/deps/oblib/src/rpc/frame/ob_req_queue_thread.h b/deps/oblib/src/rpc/frame/ob_req_queue_thread.h index 41259cf89..aa04b574a 100644 --- a/deps/oblib/src/rpc/frame/ob_req_queue_thread.h +++ b/deps/oblib/src/rpc/frame/ob_req_queue_thread.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_RPC_FRAME_OB_REQ_QUEUE_THREAD_H_ diff --git a/deps/oblib/src/rpc/frame/ob_req_translator.cpp b/deps/oblib/src/rpc/frame/ob_req_translator.cpp index 8b5b83ab8..07a71763c 100644 --- a/deps/oblib/src/rpc/frame/ob_req_translator.cpp +++ b/deps/oblib/src/rpc/frame/ob_req_translator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC diff --git a/deps/oblib/src/rpc/frame/ob_req_translator.h b/deps/oblib/src/rpc/frame/ob_req_translator.h index f13efadd9..67d305d6e 100644 --- a/deps/oblib/src/rpc/frame/ob_req_translator.h +++ b/deps/oblib/src/rpc/frame/ob_req_translator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_RPC_FRAME_OB_REQ_TRANSLATOR_H_ diff --git a/deps/oblib/src/rpc/frame/ob_req_transport.cpp b/deps/oblib/src/rpc/frame/ob_req_transport.cpp index 044298570..d709317c5 100644 --- a/deps/oblib/src/rpc/frame/ob_req_transport.cpp +++ b/deps/oblib/src/rpc/frame/ob_req_transport.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_FRAME diff --git a/deps/oblib/src/rpc/frame/ob_req_transport.h b/deps/oblib/src/rpc/frame/ob_req_transport.h index 0316f03b7..cfc70673d 100644 --- a/deps/oblib/src/rpc/frame/ob_req_transport.h +++ b/deps/oblib/src/rpc/frame/ob_req_transport.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_RPC_FRAME_OB_REQ_TRANSPORT_H_ diff --git a/deps/oblib/src/rpc/frame/ob_sql_processor.cpp b/deps/oblib/src/rpc/frame/ob_sql_processor.cpp index f48c7a140..a6112fd8a 100644 --- a/deps/oblib/src/rpc/frame/ob_sql_processor.cpp +++ b/deps/oblib/src/rpc/frame/ob_sql_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_FRAME diff --git a/deps/oblib/src/rpc/frame/ob_sql_processor.h b/deps/oblib/src/rpc/frame/ob_sql_processor.h index 879a079a1..428602b7b 100644 --- a/deps/oblib/src/rpc/frame/ob_sql_processor.h +++ b/deps/oblib/src/rpc/frame/ob_sql_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_FRAME_OB_SQL_PROCESSOR_H_ diff --git a/deps/oblib/src/rpc/frame/obi_easy_packet_handler.h b/deps/oblib/src/rpc/frame/obi_easy_packet_handler.h index 1d4498258..9befa9a72 100644 --- a/deps/oblib/src/rpc/frame/obi_easy_packet_handler.h +++ b/deps/oblib/src/rpc/frame/obi_easy_packet_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_RPC_FRAME_OBI_EASY_PACKET_HANDLER_H_ diff --git a/deps/oblib/src/rpc/frame/obi_req_qhandler.h b/deps/oblib/src/rpc/frame/obi_req_qhandler.h index 3b7ffb564..a0d47f1d0 100644 --- a/deps/oblib/src/rpc/frame/obi_req_qhandler.h +++ b/deps/oblib/src/rpc/frame/obi_req_qhandler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_RPC_FRAME_OBI_REQ_QHANDLER_H_ diff --git a/deps/oblib/src/rpc/ob_lock_wait_node.cpp b/deps/oblib/src/rpc/ob_lock_wait_node.cpp index f5a48724b..550eecf88 100644 --- a/deps/oblib/src/rpc/ob_lock_wait_node.cpp +++ b/deps/oblib/src/rpc/ob_lock_wait_node.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_lock_wait_node.h" diff --git a/deps/oblib/src/rpc/ob_lock_wait_node.h b/deps/oblib/src/rpc/ob_lock_wait_node.h index 4cc316cb7..eec0d0a50 100644 --- a/deps/oblib/src/rpc/ob_lock_wait_node.h +++ b/deps/oblib/src/rpc/ob_lock_wait_node.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OB_LOCK_WAIT_NODE_ diff --git a/deps/oblib/src/rpc/ob_packet.h b/deps/oblib/src/rpc/ob_packet.h index dad2b5109..04b15223f 100644 --- a/deps/oblib/src/rpc/ob_packet.h +++ b/deps/oblib/src/rpc/ob_packet.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_RPC_OB_PACKET_H_ diff --git a/deps/oblib/src/rpc/ob_request.cpp b/deps/oblib/src/rpc/ob_request.cpp index c0913e00c..1a8f5dcac 100644 --- a/deps/oblib/src/rpc/ob_request.cpp +++ b/deps/oblib/src/rpc/ob_request.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "rpc/ob_request.h" diff --git a/deps/oblib/src/rpc/ob_request.h b/deps/oblib/src/rpc/ob_request.h index 1dba99d69..8040d6121 100644 --- a/deps/oblib/src/rpc/ob_request.h +++ b/deps/oblib/src/rpc/ob_request.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_RPC_OB_REQUEST_H_ diff --git a/deps/oblib/src/rpc/ob_reusable_mem.h b/deps/oblib/src/rpc/ob_reusable_mem.h index b95703912..1b1ca52ae 100644 --- a/deps/oblib/src/rpc/ob_reusable_mem.h +++ b/deps/oblib/src/rpc/ob_reusable_mem.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OB_REUSABLE_MEM_H_ diff --git a/deps/oblib/src/rpc/ob_rpc_define.h b/deps/oblib/src/rpc/ob_rpc_define.h index b2d1ec7e2..cce49385f 100644 --- a/deps/oblib/src/rpc/ob_rpc_define.h +++ b/deps/oblib/src/rpc/ob_rpc_define.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_RPC_OB_RPC_DEFINE_H_ diff --git a/deps/oblib/src/rpc/ob_rpc_request_operator.cpp b/deps/oblib/src/rpc/ob_rpc_request_operator.cpp index c2c878297..3fdbb90fc 100644 --- a/deps/oblib/src/rpc/ob_rpc_request_operator.cpp +++ b/deps/oblib/src/rpc/ob_rpc_request_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_rpc_request_operator.h" diff --git a/deps/oblib/src/rpc/ob_rpc_request_operator.h b/deps/oblib/src/rpc/ob_rpc_request_operator.h index 7ca92a952..9cb778fc0 100644 --- a/deps/oblib/src/rpc/ob_rpc_request_operator.h +++ b/deps/oblib/src/rpc/ob_rpc_request_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OB_RPC_REQUEST_OPERATOR_H_ diff --git a/deps/oblib/src/rpc/ob_sql_request_operator.cpp b/deps/oblib/src/rpc/ob_sql_request_operator.cpp index 8c22da746..d8924144f 100644 --- a/deps/oblib/src/rpc/ob_sql_request_operator.cpp +++ b/deps/oblib/src/rpc/ob_sql_request_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_sql_request_operator.h" diff --git a/deps/oblib/src/rpc/ob_sql_request_operator.h b/deps/oblib/src/rpc/ob_sql_request_operator.h index b6ed62046..5dd3282f4 100644 --- a/deps/oblib/src/rpc/ob_sql_request_operator.h +++ b/deps/oblib/src/rpc/ob_sql_request_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OB_SQL_REQUEST_OPERATOR_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_processor.cpp b/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_processor.cpp index 9bf9558c8..3f2e748ac 100644 --- a/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_processor.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_processor.h b/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_processor.h index 44af6a6ff..16f1bae65 100644 --- a/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_processor.h +++ b/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_2_0_PROTOCOL_PROCESSOR_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_struct.h b/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_struct.h index cc1a7b9fd..fce3e8257 100644 --- a/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_struct.h +++ b/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_2_0_PROTOCOL_STRUCT_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_utils.cpp b/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_utils.cpp index a8c1eae5f..d23b0dd14 100644 --- a/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_utils.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL @@ -490,8 +494,8 @@ inline int ObProto20Utils::fill_proto20_payload(ObProtoEncodeParam ¶m, bool LOG_ERROR("impossible", "read_avail", easy_buffer.read_avail_size(), "header len", proto20_context.header_len_, K(ret)); } else if (param.is_composed_ok_pkt_) { - // 遇到了err+ok,但是ok包过大且已经写入了err包的内容,这里不可以变为FILL_TAILER_STEP状态, - // 否则err和ok就不算在一个包里面了 + // Encountered err+ok, but ok is too large and its content has already been written to the err package, here it cannot be changed to FILL_TAILER_STEP state, + // Otherwise err and ok are not in the same package param.need_flush_ = true; // break, alloc more memory need_break = true; } else { diff --git a/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_utils.h b/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_utils.h index 1b897032b..40778aa56 100644 --- a/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_utils.h +++ b/deps/oblib/src/rpc/obmysql/ob_2_0_protocol_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_2_0_PROTOCOL_UTILS_ diff --git a/deps/oblib/src/rpc/obmysql/ob_easy_sql_request_operator.cpp b/deps/oblib/src/rpc/obmysql/ob_easy_sql_request_operator.cpp index bf8983c71..393865274 100644 --- a/deps/oblib/src/rpc/obmysql/ob_easy_sql_request_operator.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_easy_sql_request_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "rpc/obmysql/ob_easy_sql_request_operator.h" diff --git a/deps/oblib/src/rpc/obmysql/ob_easy_sql_request_operator.h b/deps/oblib/src/rpc/obmysql/ob_easy_sql_request_operator.h index 7f16244bb..efe5d4ea3 100644 --- a/deps/oblib/src/rpc/obmysql/ob_easy_sql_request_operator.h +++ b/deps/oblib/src/rpc/obmysql/ob_easy_sql_request_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OB_EASY_SQL_REQUEST_OPERATOR_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_i_cs_mem_pool.h b/deps/oblib/src/rpc/obmysql/ob_i_cs_mem_pool.h index 892e046c4..6b8e605fe 100644 --- a/deps/oblib/src/rpc/obmysql/ob_i_cs_mem_pool.h +++ b/deps/oblib/src/rpc/obmysql/ob_i_cs_mem_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBMYSQL_OB_I_CS_MEM_POOL_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_i_sm_conn_callback.h b/deps/oblib/src/rpc/obmysql/ob_i_sm_conn_callback.h index 8e3120582..9942dcd45 100644 --- a/deps/oblib/src/rpc/obmysql/ob_i_sm_conn_callback.h +++ b/deps/oblib/src/rpc/obmysql/ob_i_sm_conn_callback.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBMYSQL_OB_I_SM_CONN_CALLBACK_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_i_sql_sock_handler.h b/deps/oblib/src/rpc/obmysql/ob_i_sql_sock_handler.h index 0d234012e..96aee3d93 100644 --- a/deps/oblib/src/rpc/obmysql/ob_i_sql_sock_handler.h +++ b/deps/oblib/src/rpc/obmysql/ob_i_sql_sock_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBMYSQL_OB_I_SQL_SOCK_HANDLER_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_compress_protocol_processor.cpp b/deps/oblib/src/rpc/obmysql/ob_mysql_compress_protocol_processor.cpp index fbd6815cb..2537dfce2 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_compress_protocol_processor.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_compress_protocol_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_compress_protocol_processor.h b/deps/oblib/src/rpc/obmysql/ob_mysql_compress_protocol_processor.h index 814a1796b..6a6121c58 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_compress_protocol_processor.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_compress_protocol_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_MYSQL_COMPRESS_PROTOCOL_PROCESSOR_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_field.cpp b/deps/oblib/src/rpc/obmysql/ob_mysql_field.cpp index 222ce9ab1..14f04fa19 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_field.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_field.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL @@ -155,7 +159,7 @@ int ObMySQLField::serialize_pro41(char *buf, const int64_t len, int64_t &pos) co } } } - /* 针对COM_FIELD_LIST命令,必须将相关的default_values序列化进去,表明这是一个来自于COM_FIELD_LIST的回包 + /* For the COM_FIELD_LIST command, the related default_values must be serialized in to indicate that this is a response packet from COM_FIELD_LIST */ if (OB_SUCC(ret) && MYSQL_TYPE_NOT_DEFINED != default_value_ diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_field.h b/deps/oblib/src/rpc/obmysql/ob_mysql_field.h index 525b4f225..89eae629d 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_field.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_field.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_MYSQL_FIELD_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_global.h b/deps/oblib/src/rpc/obmysql/ob_mysql_global.h index 7b143a8ff..990068d52 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_global.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_global.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBMYSQL_OB_MYSQL_GLOBAL_ diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_packet.cpp b/deps/oblib/src/rpc/obmysql/ob_mysql_packet.cpp index 2555dc07a..735734cd1 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_packet.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_packet.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_packet.h b/deps/oblib/src/rpc/obmysql/ob_mysql_packet.h index 19ee1428d..80da957cd 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_packet.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_packet.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_MYSQL_PACKET_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_protocol_processor.cpp b/deps/oblib/src/rpc/obmysql/ob_mysql_protocol_processor.cpp index 4f5e2f70a..4d728ed8a 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_protocol_processor.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_protocol_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_protocol_processor.h b/deps/oblib/src/rpc/obmysql/ob_mysql_protocol_processor.h index 605cb5469..b0f205efe 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_protocol_processor.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_protocol_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_MYSQL_PROTOCOL_PROCESSOR_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.cpp b/deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.cpp index cea55762b..21c2e8597 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_mysql_request_utils.h" diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.h b/deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.h index aabe64185..8ba1c0f01 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_request_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_MYSQL_REQUEST diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_row.cpp b/deps/oblib/src/rpc/obmysql/ob_mysql_row.cpp index d2ef4c62b..56663d7a4 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_row.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_row.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_row.h b/deps/oblib/src/rpc/obmysql/ob_mysql_row.h index f70292cf2..ee53fb99c 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_row.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_row.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_MYSQL_ROW_H_ @@ -28,13 +32,13 @@ class ObMySQLRow public: /** - * 将该行数据序列化成MySQL认识的格式,输出位置:buf + pos,执行后pos指向buf中第一个free的位置。 + * Serialize this row of data into a format recognized by MySQL, output position: buf + pos, after execution pos points to the first free position in buf. * - * @param [in] buf 序列化以后输出的序列的空间 - * @param [in] len buf的长度 - * @param [out] pos 当前buf第一个free的位置 + * @param [in] buf The space for the serialized output sequence + * @param [in] len Length of buf + * @param [out] pos Current first free position in buf * - * @return 成功返回OB_SUCCESS, 失败返回oceanbase error code + * @return Returns OB_SUCCESS on success, returns oceanbase error code on failure */ int serialize(char *buf, const int64_t len, int64_t &pos) const; bool is_packed() const { return is_packed_; } diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_translator.cpp b/deps/oblib/src/rpc/obmysql/ob_mysql_translator.cpp index 0840c93c3..a87a442a7 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_translator.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_translator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_translator.h b/deps/oblib/src/rpc/obmysql/ob_mysql_translator.h index df810d165..0ee9d648b 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_translator.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_translator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_MYSQL_TRANSLATOR_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_util.cpp b/deps/oblib/src/rpc/obmysql/ob_mysql_util.cpp index cf9260174..b17c822e0 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_util.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_util.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL @@ -894,8 +898,7 @@ int ObMySQLUtil::double_cell_str(char *buf, const int64_t len, double val, ObMySQLUtil::prepend_zeros(buf + pos + 1, length, zero_cnt); length = zflength; } - - // 按照协议: 如果double的长度小于251字节,长度头只需要1个字节,否则长度头需要3个字节 + // According to the protocol: if the length of double is less than 251 bytes, only 1 byte is needed for the length header, otherwise, 3 bytes are needed for the length header if (length < 251) { ret = ObMySQLUtil::store_length(buf, len, length, pos); pos += length; diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_util.h b/deps/oblib/src/rpc/obmysql/ob_mysql_util.h index 8a0b236eb..e96fe1848 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_util.h +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_MYSQL_UTIL_H_ @@ -54,54 +58,54 @@ class ObMySQLUtil static void update_null_bitmap(char *&bitmap, int64_t field_index); /** - * 将长度写入到buf里面,可能占1,3,4,9个字节。 + * Write the length into buf, which may take 1, 3, 4, or 9 bytes. * - * @param [in] buf 要写入长度的buf - * @param [in] len buf的总字节数 - * @param [in] length 需要写入的长度的值 - * @param [in,out] pos buf已使用的字节数 + * @param [in] buf The buf to write the length into + * @param [in] len Total number of bytes in buf + * @param [in] length The value of the length to be written + * @param [in,out] pos Number of bytes already used in buf * * @return oceanbase error code */ static int store_length(char *buf, int64_t len, uint64_t length, int64_t &pos); /** - * 读取长度字段,配合 store_length() 使用 + * Read the length field, used in conjunction with store_length() * - * @param [in,out] pos 读取长度的位置,读取后更新pos - * @param [out] length 长度 + * @param [in,out] pos The position to read the length from, pos is updated after reading + * @param [out] length The length */ static int get_length(const char *&pos, uint64_t &length); /** - * 读取长度字段,配合 store_length() 使用 + * Read the length field, used in conjunction with store_length() * - * @param [in,out] pos 读取长度的位置,读取后更新pos - * @param [out] length 长度 - * @param [out] pos_inc_len pos增加的长度 + * @param [in,out] pos The position to read the length from, pos is updated after reading + * @param [out] length The length + * @param [out] pos_inc_len The length by which pos is incremented */ static int get_length(const char *&pos, uint64_t &length, uint64_t &pos_inc_len); /** - * 以length coded string格式存储数字时,需要占用的长度 + * The length required to store a number in length coded string format * - * @param [in] 数字 - * @return 存储时需要字节数 + * @param [in] number + * @return number of bytes required for storage */ static uint64_t get_number_store_len(const uint64_t num); /** - * 存一个 NULL 标志。 + * Store a NULL flag. * - * @param buf 写入的内存地址 - * @param len buf的总字节数 - * @param pos buf已写入的字节数 + * @param buf Memory address to write to + * @param len Total number of bytes in buf + * @param pos Number of bytes already written to buf */ static inline int store_null(char *buf, int64_t len, int64_t &pos); /** * @see store_str_v() - * 将一段以'\0'结尾的字符串str打包进入buf(length coded string格式) + * Pack a null-terminated string str into buf (length coded string format) * - * @param [in] buf 写入的内存地址 - * @param [in] len buf的总字节数 - * @param [in] str 需要打包的字符串 - * @param [in,out] pos buf已使用的字节数 + * @param [in] buf The memory address to write to + * @param [in] len Total number of bytes in buf + * @param [in] str The string to be packed + * @param [in,out] pos Number of bytes already used in buf * * @return OB_SUCCESS or oceanbase error code. * @@ -109,13 +113,13 @@ class ObMySQLUtil */ static int store_str(char *buf, int64_t len, const char *str, int64_t &pos); /** - * 将一段长度为length的字符串str打包进入buf(length coded string格式) + * Pack a string str of length length into buf (length coded string format) * - * @param [in] buf 写入的内存地址 - * @param [in] len buf的总字节数 - * @param [in] str 需要打包的字符串 - * @param [in] length str的长度 - * @param [in,out] pos buf已使用的字节数 + * @param [in] buf The memory address to write to + * @param [in] len Total number of bytes in buf + * @param [in] str The string to be packed + * @param [in] length Length of str + * @param [in,out] pos Number of bytes already used in buf * * @return OB_SUCCESS or oceanbase error code. * @@ -125,12 +129,12 @@ class ObMySQLUtil static int store_str_v(char *buf, int64_t len, const char *str, const uint64_t length, int64_t &pos); /** - * 将ObString结构的字符串str打包进入buf(length coded string格式) + * Pack the string str of ObString structure into buf (in length coded string format) * - * @param [in] buf 写入的内存地址 - * @param [in] len buf的总字节数 - * @param [in] str ObString结构的字符串 - * @param [in,out] pos buf已使用的字节数 + * @param [in] buf The memory address to write to + * @param [in] len Total number of bytes in buf + * @param [in] str String of ObString structure + * @param [in,out] pos Number of bytes already used in buf * * @return OB_SUCCESS or oceanbase error code. * @@ -141,35 +145,35 @@ class ObMySQLUtil static int store_obstr_with_pre_space(char *buf, int64_t len, ObString str, int64_t &pos); /** * @see store_str_vzt() - * 将一段以'\0'结尾的字符串str打包进入buf(zero terminated string格式) + * Pack a zero-terminated string str into buf (zero terminated string format) * - * @param [in] buf 写入的内存地址 - * @param [in] len buf的总字节数 - * @param [in] str 需要打包的字符串 - * @param [in,out] pos buf已使用的字节数 + * @param [in] buf The memory address to write to + * @param [in] len Total number of bytes in buf + * @param [in] str The string to be packed + * @param [in,out] pos Number of bytes already used in buf * * @return OB_SUCCESS or oceanbase error code. */ /** * @see store_str_vzt() - * 将一段以'\0'结尾的字符串str打包进入buf(none-zero terminated string格式) + * Pack a null-terminated string str into buf (none-zero terminated string format) * - * @param [in] buf 写入的内存地址 - * @param [in] len buf的总字节数 - * @param [in] str 需要打包的字符串 - * @param [in,out] pos buf已使用的字节数 + * @param [in] buf The memory address to write to + * @param [in] len Total number of bytes in buf + * @param [in] str The string to be packed + * @param [in,out] pos Number of bytes already used in buf * * @return OB_SUCCESS or oceanbase error code. */ /** * @see store_str_zt() - * 将一段长度为length的字符串str打包进入buf(zero terminated string格式) + * Pack a string str of length length into buf (zero terminated string format) * - * @param [in] buf 写入的内存地址 - * @param [in] len buf的总字节数 - * @param [in] str 需要打包的字符串 - * @param [in] length str的长度(不包括'\0') - * @param [in,out] pos buf已使用的字节数 + * @param [in] buf Memory address to write to + * @param [in] len Total number of bytes in buf + * @param [in] str String to be packed + * @param [in] length Length of str (excluding '\0') + * @param [in,out] pos Number of bytes already used in buf * * @return OB_SUCCESS or oceanbase error code. */ @@ -177,13 +181,13 @@ class ObMySQLUtil const uint64_t length, int64_t &pos); /** * @see store_str_zt() - * 将一段长度为length的字符串str打包进入buf(none-zero terminated string格式) + * Pack a string str of length length into buf (none-zero terminated string format) * - * @param [in] buf 写入的内存地址 - * @param [in] len buf的总字节数 - * @param [in] str 需要打包的字符串 - * @param [in] length str的长度(不包括'\0') - * @param [in,out] pos buf已使用的字节数 + * @param [in] buf The memory address to write to + * @param [in] len Total number of bytes in buf + * @param [in] str The string to be packed + * @param [in] length Length of str (excluding '\0') + * @param [in,out] pos Number of bytes already used in buf * * @return OB_SUCCESS or oceanbase error code. */ @@ -191,23 +195,23 @@ class ObMySQLUtil const char *str, int64_t length, int64_t &pos); /** * @see store_str_vzt() - * 将ObString结构的字符串str打包进入buf(zero terminated string格式) + * Pack the string str of ObString structure into buf (zero terminated string format) * - * @param [in] buf 写入的内存地址 - * @param [in] len buf的总字节数 - * @param [in] str ObString结构的字符串 - * @param [in,out] pos buf已使用的字节数 + * @param [in] buf The memory address to write to + * @param [in] len Total number of bytes of buf + * @param [in] str String of ObString structure + * @param [in,out] pos Number of bytes already used in buf * * @return OB_SUCCESS or oceanbase error code. */ static int store_obstr_zt(char *buf, int64_t len, ObString str, int64_t &pos); /** - * 将ObString结构的字符串str打包进入buf(none-zero terminated raw string格式) + * Pack the string str of ObString structure into buf (none-zero terminated raw string format) * - * @param [in] buf 写入的内存地址 - * @param [in] len buf的总字节数 - * @param [in] str ObString结构的字符串 - * @param [in,out] pos buf已使用的字节数 + * @param [in] buf The memory address to write to + * @param [in] len Total number of bytes of buf + * @param [in] str String of ObString structure + * @param [in,out] pos Number of bytes already used in buf * * @return OB_SUCCESS or oceanbase error code. */ @@ -251,35 +255,35 @@ class ObMySQLUtil /** - * 在buf[0...offset)处添0,原来的org_char_size字节数据往后移动offset字节 + * Add 0 at buf[0...offset), move the original org_char_size bytes of data backward by offset bytes */ static void prepend_zeros(char *buf, const int64_t org_char_size, int64_t offset); /** - * 序列化一个null类型的cell到buf + pos的位置。 + * Serialize a null type cell to the position of buf + pos. * - * @param [in] obj 需要序列化的cell - * @param [in] buf 输出的buf - * @param [in] len buf的大小 - * @param [in,out] pos 写入buf的位置 + * @param [in] obj The cell to be serialized + * @param [in] buf The output buffer + * @param [in] len The size of the buffer + * @param [in,out] pos The position to write to the buffer * @param [in] field index * - * @return 成功返回OB_SUCCESS, 失败返回oceanbase error code + * @return Returns OB_SUCCESS on success, returns oceanbase error code on failure */ static int null_cell_str(char *buf, const int64_t len, MYSQL_PROTOCOL_TYPE type, int64_t &pos, int64_t cell_index, char *bitmap); /** - * 序列化一个整型的cell到buf + pos的位置。 + * Serialize an integer cell to the position of buf + pos. * (ObBoolType, ObIntType) * - * @param [in] obj 需要序列化的cell - * @param [in] buf 输出的buf - * @param [in] len buf的大小 - * @param [in,out] pos 写入buf的位置 + * @param [in] obj The cell to be serialized + * @param [in] buf The output buffer + * @param [in] len The size of the buffer + * @param [in,out] pos The position to write to the buffer * - * @return 成功返回OB_SUCCESS, 失败返回oceanbase error code + * @return Returns OB_SUCCESS on success, returns oceanbase error code on failure */ static int int_cell_str(char *buf, const int64_t len, int64_t val, const ObObjType obj_type, @@ -287,29 +291,29 @@ class ObMySQLUtil MYSQL_PROTOCOL_TYPE type, int64_t &pos, bool zerofill, int32_t zflength); /** - * 序列化一个定点数型的cell到buf + pos的位置。 + * Serialize a fixed-point type cell to the position of buf + pos. * (ObDecimalType) * - * @param [in] obj 需要序列化的cell - * @param [in] buf 输出的buf - * @param [in] len buf的大小 - * @param [in,out] pos 写入buf的位置 + * @param [in] obj The cell to be serialized + * @param [in] buf The output buffer + * @param [in] len The size of the buffer + * @param [in,out] pos The position to write to the buffer * - * @return 成功返回OB_SUCCESS, 失败返回oceanbase error code + * @return Returns OB_SUCCESS on success, returns oceanbase error code on failure */ static int number_cell_str(char *buf, const int64_t len, const number::ObNumber &val, int64_t &pos, int16_t scale, bool zerofill, int32_t zflength); /** - * 序列化一个datetime型的cell到buf + pos的位置。 + * Serialize a datetime type cell to the position of buf + pos. * (ObDateTimeType, ObTimestampType) * - * @param [in] obj 需要序列化的cell - * @param [in] buf 输出的buf - * @param [in] len buf的大小 - * @param [in,out] pos 写入buf的位置 + * @param [in] obj The cell to be serialized + * @param [in] buf The output buffer + * @param [in] len The size of the buffer + * @param [in,out] pos The position to write to the buffer * - * @return 成功返回OB_SUCCESS, 失败返回oceanbase error code + * @return Returns OB_SUCCESS on success, returns oceanbase error code on failure */ static int datetime_cell_str(char *buf, const int64_t len, int64_t val, MYSQL_PROTOCOL_TYPE type, int64_t &pos, @@ -319,27 +323,27 @@ class ObMySQLUtil const ObTimeZoneInfo *tz_info, int16_t scale); /** - * 序列化一个obstring型的cell到buf + pos的位置。 + * Serialize an obstring type cell to the position of buf + pos. * (ObDateTimeType, ObTimestampType) * - * @param [in] obj 需要序列化的cell - * @param [in] buf 输出的buf - * @param [in] len buf的大小 - * @param [in,out] pos 写入buf的位置 + * @param [in] obj The cell to be serialized + * @param [in] buf The output buffer + * @param [in] len The size of buf + * @param [in,out] pos The position to write to buf * - * @return 成功返回OB_SUCCESS, 失败返回oceanbase error code + * @return Returns OB_SUCCESS on success, returns oceanbase error code on failure */ /** - * 序列化一个otimestamp型的cell到buf + pos的位置。 + * Serialize an otimestamp type cell to the position of buf + pos. * (ObDateTimeType, ObTimestampType) * - * @param [in] obj 需要序列化的cell - * @param [in] buf 输出的buf - * @param [in] len buf的大小 - * @param [in,out] pos 写入buf的位置 + * @param [in] obj The cell to be serialized + * @param [in] buf The output buffer + * @param [in] len The size of the buffer + * @param [in,out] pos The position to write to the buffer * - * @return 成功返回OB_SUCCESS, 失败返回oceanbase error code + * @return Returns OB_SUCCESS on success, returns oceanbase error code on failure */ static int otimestamp_cell_str(char *buf, const int64_t len, const ObOTimestampData &ot_data, MYSQL_PROTOCOL_TYPE type, int64_t &pos, @@ -348,69 +352,69 @@ class ObMySQLUtil const ObOTimestampData &ot_data, MYSQL_PROTOCOL_TYPE type, int64_t &pos, const ObDataTypeCastParams &dtc_params, const int16_t scale, const ObObjType obj_type); /** - * 序列化一个date型的cell到buf + pos的位置。 + * Serialize a date-type cell to the position of buf + pos. * (ObDateType) * - * @param [in] obj 需要序列化的cell - * @param [in] buf 输出的buf - * @param [in] len buf的大小 - * @param [in,out] pos 写入buf的位置 + * @param [in] obj The cell to be serialized + * @param [in] buf The output buffer + * @param [in] len The size of the buffer + * @param [in,out] pos The position to write to the buffer * - * @return 成功返回OB_SUCCESS, 失败返回oceanbase error code + * @return Returns OB_SUCCESS on success, or an oceanbase error code on failure */ static int date_cell_str(char *buf, const int64_t len, int32_t val, MYSQL_PROTOCOL_TYPE type, int64_t &pos); static int mdate_cell_str(char *buf, const int64_t len, ObMySQLDate val, MYSQL_PROTOCOL_TYPE type, int64_t &pos); /** - * 序列化一个time型的cell到buf + pos的位置。 + * Serialize a time-type cell to the position of buf + pos. * (ObTimeType) * - * @param [in] obj 需要序列化的cell - * @param [in] buf 输出的buf - * @param [in] len buf的大小 - * @param [in,out] pos 写入buf的位置 + * @param [in] obj The cell to be serialized + * @param [in] buf The output buffer + * @param [in] len The size of the buffer + * @param [in,out] pos The position to write to the buffer * - * @return 成功返回OB_SUCCESS, 失败返回oceanbase error code + * @return Returns OB_SUCCESS on success, returns oceanbase error code on failure */ static int time_cell_str(char *buf, const int64_t len, int64_t val, MYSQL_PROTOCOL_TYPE type, int64_t &pos, int16_t scale); /** - * 序列化一个year型的cell到buf + pos的位置。 + * Serialize a year-type cell to the position of buf + pos. * (ObYearType) * - * @param [in] obj 需要序列化的cell - * @param [in] buf 输出的buf - * @param [in] len buf的大小 - * @param [in,out] pos 写入buf的位置 + * @param [in] obj The cell to be serialized + * @param [in] buf The output buffer + * @param [in] len The size of the buffer + * @param [in,out] pos The position to write to the buffer * - * @return 成功返回OB_SUCCESS, 失败返回oceanbase error code + * @return Returns OB_SUCCESS on success, or an oceanbase error code on failure */ static int year_cell_str(char *buf, const int64_t len, uint8_t val, MYSQL_PROTOCOL_TYPE type, int64_t &pos); /** - * 序列化一个字符串类型的cell到buf + pos的位置。 + * Serialize a string type cell to the position of buf + pos. * (ObVarcharType) * - * @param [in] obj 需要序列化的cell - * @param [in] buf 输出的buf - * @param [in] len buf的大小 - * @param [in,out] pos 写入buf的位置 + * @param [in] obj The cell to be serialized + * @param [in] buf The output buffer + * @param [in] len The size of the buffer + * @param [in,out] pos The position to write to the buffer * - * @return 成功返回OB_SUCCESS, 失败返回oceanbase error code + * @return Returns OB_SUCCESS on success, returns oceanbase error code on failure */ static int varchar_cell_str(char *buf, int64_t len, const ObString &val, const bool is_oracle_raw, int64_t &pos); /** - * 序列化一个浮点数型的cell到buf + pos的位置。 + * Serialize a floating-point type cell to the position of buf + pos. * (ObFloatType, ObDoubleType) * - * @param [in] obj 需要序列化的cell - * @param [in] buf 输出的buf - * @param [in] len buf的大小 - * @param [in,out] pos 写入buf的位置 + * @param [in] obj The cell to be serialized + * @param [in] buf The output buffer + * @param [in] len The size of the buffer + * @param [in,out] pos The position to write to the buffer * - * @return 成功返回OB_SUCCESS, 失败返回oceanbase error code + * @return Returns OB_SUCCESS on success, returns oceanbase error code on failure */ static int float_cell_str(char *buf, const int64_t len, float val, MYSQL_PROTOCOL_TYPE type, int64_t &pos, int16_t scale, diff --git a/deps/oblib/src/rpc/obmysql/ob_packet_record.cpp b/deps/oblib/src/rpc/obmysql/ob_packet_record.cpp index 18575ef7a..9e857cc04 100644 --- a/deps/oblib/src/rpc/obmysql/ob_packet_record.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_packet_record.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/ob_packet_record.h b/deps/oblib/src/rpc/obmysql/ob_packet_record.h index 6a022239e..22e305249 100644 --- a/deps/oblib/src/rpc/obmysql/ob_packet_record.h +++ b/deps/oblib/src/rpc/obmysql/ob_packet_record.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_MYSQL_OB_PACKET_RECORD_H_ @@ -25,8 +29,8 @@ namespace obmysql struct ResRecordFlags { uint8_t is_send_: 1; // 0-send, 1-receive - uint8_t processed_: 1; // 请求处理结束,发送包后将会标记该位。 - uint8_t reservered_: 8; // 其余位用于特殊标记 + uint8_t processed_: 1; // Request processing finished, this bit will be marked after sending the packet. + uint8_t reservered_: 8; // The remaining bits are used for special markers }; struct Obp20Header { @@ -65,9 +69,9 @@ struct Obp20Header { struct ObpMysqHeader { union { uint32_t len_; - uint32_t pkt_num_; // 表示row packet/feild packet的数量。 + uint32_t pkt_num_; // indicates the number of row packets/field packets. } mysql_header_; - uint32_t rec_; // 表示目前收到多少byte的mysql包。 + uint32_t rec_; // indicates how many bytes of the mysql packet have been received. uint32_t com_len_; // compress head len uint8_t seq_; uint8_t type_; diff --git a/deps/oblib/src/rpc/obmysql/ob_poc_sql_request_operator.cpp b/deps/oblib/src/rpc/obmysql/ob_poc_sql_request_operator.cpp index 1c8223614..64cd31b25 100644 --- a/deps/oblib/src/rpc/obmysql/ob_poc_sql_request_operator.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_poc_sql_request_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "rpc/obmysql/ob_poc_sql_request_operator.h" diff --git a/deps/oblib/src/rpc/obmysql/ob_poc_sql_request_operator.h b/deps/oblib/src/rpc/obmysql/ob_poc_sql_request_operator.h index 59b240bd8..f3a60f053 100644 --- a/deps/oblib/src/rpc/obmysql/ob_poc_sql_request_operator.h +++ b/deps/oblib/src/rpc/obmysql/ob_poc_sql_request_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OB_POC_SQL_REQUEST_OPERATOR_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_sql_nio.cpp b/deps/oblib/src/rpc/obmysql/ob_sql_nio.cpp index 1abe30801..033d59b42 100644 --- a/deps/oblib/src/rpc/obmysql/ob_sql_nio.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_sql_nio.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL @@ -859,7 +863,7 @@ class ObSqlNioImpl strncpy(unix_socket_path_, unix_socket_path, sizeof(unix_socket_path_) - 1); if ((unix_lfd_ = listen_create_unix(unix_socket_path_, need_monopolize)) < 0) { LOG_WARN("unix socket listen create fail", K(unix_socket_path_), K(errno)); - // Unix socket失败不影响TCP socket,所以不返回错误 + // Unix socket failure does not affect TCP socket, so no error is returned } else if (0 != epoll_regist(epfd_, unix_lfd_, epflag, NULL)) { LOG_WARN("regist unix listen fd fail", K(unix_lfd_)); close(unix_lfd_); diff --git a/deps/oblib/src/rpc/obmysql/ob_sql_nio.h b/deps/oblib/src/rpc/obmysql/ob_sql_nio.h index d0f1ee0df..0ce8e3141 100644 --- a/deps/oblib/src/rpc/obmysql/ob_sql_nio.h +++ b/deps/oblib/src/rpc/obmysql/ob_sql_nio.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBMYSQL_OB_SQL_NIO_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_sql_nio_server.cpp b/deps/oblib/src/rpc/obmysql/ob_sql_nio_server.cpp index 0ad19bf2d..c2086f990 100644 --- a/deps/oblib/src/rpc/obmysql/ob_sql_nio_server.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_sql_nio_server.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/ob_sql_nio_server.h b/deps/oblib/src/rpc/obmysql/ob_sql_nio_server.h index e9eec7f2b..e68e2cee2 100644 --- a/deps/oblib/src/rpc/obmysql/ob_sql_nio_server.h +++ b/deps/oblib/src/rpc/obmysql/ob_sql_nio_server.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBMYSQL_OB_SQL_NIO_SERVER_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_sql_sock_handler.cpp b/deps/oblib/src/rpc/obmysql/ob_sql_sock_handler.cpp index ff5ab8688..f70efb3b5 100644 --- a/deps/oblib/src/rpc/obmysql/ob_sql_sock_handler.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_sql_sock_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/ob_sql_sock_handler.h b/deps/oblib/src/rpc/obmysql/ob_sql_sock_handler.h index b473ef352..9fd529b2e 100644 --- a/deps/oblib/src/rpc/obmysql/ob_sql_sock_handler.h +++ b/deps/oblib/src/rpc/obmysql/ob_sql_sock_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBMYSQL_OB_SQL_SOCK_HANDLER_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_sql_sock_processor.cpp b/deps/oblib/src/rpc/obmysql/ob_sql_sock_processor.cpp index 4fee60c2e..e1aa22831 100644 --- a/deps/oblib/src/rpc/obmysql/ob_sql_sock_processor.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_sql_sock_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/ob_sql_sock_processor.h b/deps/oblib/src/rpc/obmysql/ob_sql_sock_processor.h index b1dc2e3c0..5623f8375 100644 --- a/deps/oblib/src/rpc/obmysql/ob_sql_sock_processor.h +++ b/deps/oblib/src/rpc/obmysql/ob_sql_sock_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBMYSQL_OB_SQL_SOCK_PROCESSOR_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_sql_sock_session.cpp b/deps/oblib/src/rpc/obmysql/ob_sql_sock_session.cpp index 7d70c75cf..e632f40b7 100644 --- a/deps/oblib/src/rpc/obmysql/ob_sql_sock_session.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_sql_sock_session.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/ob_sql_sock_session.h b/deps/oblib/src/rpc/obmysql/ob_sql_sock_session.h index fccaf3a04..2b4a0df8a 100644 --- a/deps/oblib/src/rpc/obmysql/ob_sql_sock_session.h +++ b/deps/oblib/src/rpc/obmysql/ob_sql_sock_session.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBMYSQL_OB_SQL_SOCK_SESSION_H_ diff --git a/deps/oblib/src/rpc/obmysql/ob_virtual_cs_protocol_processor.cpp b/deps/oblib/src/rpc/obmysql/ob_virtual_cs_protocol_processor.cpp index 11486486c..9cad009a6 100644 --- a/deps/oblib/src/rpc/obmysql/ob_virtual_cs_protocol_processor.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_virtual_cs_protocol_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/ob_virtual_cs_protocol_processor.h b/deps/oblib/src/rpc/obmysql/ob_virtual_cs_protocol_processor.h index 676d10504..51e31f29f 100644 --- a/deps/oblib/src/rpc/obmysql/ob_virtual_cs_protocol_processor.h +++ b/deps/oblib/src/rpc/obmysql/ob_virtual_cs_protocol_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_VIRTUAL_CS_PROTOCOL_PROCESSOR_H_ diff --git a/deps/oblib/src/rpc/obmysql/obp20_extra_info.cpp b/deps/oblib/src/rpc/obmysql/obp20_extra_info.cpp index 7b267ffad..6b2978ed9 100644 --- a/deps/oblib/src/rpc/obmysql/obp20_extra_info.cpp +++ b/deps/oblib/src/rpc/obmysql/obp20_extra_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB_UTIL diff --git a/deps/oblib/src/rpc/obmysql/obp20_extra_info.h b/deps/oblib/src/rpc/obmysql/obp20_extra_info.h index 563c5d976..7b63e76e6 100644 --- a/deps/oblib/src/rpc/obmysql/obp20_extra_info.h +++ b/deps/oblib/src/rpc/obmysql/obp20_extra_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef OBP20_EXTRA_INFO_DEF diff --git a/deps/oblib/src/rpc/obmysql/obsm_struct.h b/deps/oblib/src/rpc/obmysql/obsm_struct.h index 3a09a4acf..2e75164d4 100644 --- a/deps/oblib/src/rpc/obmysql/obsm_struct.h +++ b/deps/oblib/src/rpc/obmysql/obsm_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBSM_STRUCT_H_ @@ -212,12 +216,12 @@ struct ObSMConnection uint32_t sessid_; uint32_t version_; uint64_t proxy_sessid_; - int64_t sess_create_time_; //proxy连接模式下, 记录client->proxy的sess连接时间 + int64_t sess_create_time_; // proxy connection mode, record the session connection time from client to proxy uint64_t tenant_id_; uint64_t resource_group_id_; obmysql::ObProxyCapabilityFlags proxy_cap_flags_; - //在ObSMHandler::on_connect阶段会发生某些错误,这些错误信息需要返回给客户端; - //而在on_connect中无法给客户端返回准确错误信息,因此记录到这里,在ObMPConnect::Process中处理 + // Errors may occur during the ObSMHandler::on_connect stage, and these error messages need to be returned to the client; + // And in on_connect, accurate error information cannot be returned to the client, therefore it is recorded here, and processed in ObMPConnect::Process int ret_; omt::ObTenant *tenant_; char tenant_name_buf_[OB_MAX_TENANT_NAME_LENGTH + 1]; diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_auth_switch.cpp b/deps/oblib/src/rpc/obmysql/packet/ompk_auth_switch.cpp index 9eadfafec..390e6b4a8 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_auth_switch.cpp +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_auth_switch.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_auth_switch.h b/deps/oblib/src/rpc/obmysql/packet/ompk_auth_switch.h index dfa06e568..bee457ecb 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_auth_switch.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_auth_switch.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OMPK_AUTH_SWITCH_H_ diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_change_user.cpp b/deps/oblib/src/rpc/obmysql/packet/ompk_change_user.cpp index ac87a66e5..dc3486724 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_change_user.cpp +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_change_user.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_change_user.h b/deps/oblib/src/rpc/obmysql/packet/ompk_change_user.h index 22fecba25..c16bd253b 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_change_user.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_change_user.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBMYSQL_OMPK_CHANGE_USER_H_ diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_eof.cpp b/deps/oblib/src/rpc/obmysql/packet/ompk_eof.cpp index 455b0d022..8efbd5430 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_eof.cpp +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_eof.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_eof.h b/deps/oblib/src/rpc/obmysql/packet/ompk_eof.h index d00fff541..2a0f013cc 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_eof.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_eof.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OMPK_EOF_H_ diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_error.cpp b/deps/oblib/src/rpc/obmysql/packet/ompk_error.cpp index 0103a61df..de299d02b 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_error.cpp +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_error.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_error.h b/deps/oblib/src/rpc/obmysql/packet/ompk_error.h index ef13eaec1..70decdeca 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_error.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_error.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OMPK_ERROR_H_ diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_field.cpp b/deps/oblib/src/rpc/obmysql/packet/ompk_field.cpp index 03fde2cb1..7ec3813f4 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_field.cpp +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_field.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "rpc/obmysql/packet/ompk_field.h" diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_field.h b/deps/oblib/src/rpc/obmysql/packet/ompk_field.h index be9a8692d..d447eeeeb 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_field.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_field.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OMPK_FIELD_H_ diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_handshake.cpp b/deps/oblib/src/rpc/obmysql/packet/ompk_handshake.cpp index 099f107a6..f80927c8f 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_handshake.cpp +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_handshake.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_handshake.h b/deps/oblib/src/rpc/obmysql/packet/ompk_handshake.h index b557a9555..a6ef2ca55 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_handshake.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_handshake.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OMPK_HANDSHAKE_H_ diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_handshake_response.cpp b/deps/oblib/src/rpc/obmysql/packet/ompk_handshake_response.cpp index c1742fb17..333c0cff2 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_handshake_response.cpp +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_handshake_response.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_handshake_response.h b/deps/oblib/src/rpc/obmysql/packet/ompk_handshake_response.h index 072452034..e23079422 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_handshake_response.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_handshake_response.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OMPK_HANDSHAKE_RESPONSE_H_ diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_local_infile.cpp b/deps/oblib/src/rpc/obmysql/packet/ompk_local_infile.cpp index 9cda074ff..6aab4809e 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_local_infile.cpp +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_local_infile.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_local_infile.h b/deps/oblib/src/rpc/obmysql/packet/ompk_local_infile.h index 440d70974..114fd7877 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_local_infile.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_local_infile.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OMPK_LOCAL_INFILE_H_ diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_ok.cpp b/deps/oblib/src/rpc/obmysql/packet/ompk_ok.cpp index bc3b45b2b..6e7b5be25 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_ok.cpp +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_ok.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_ok.h b/deps/oblib/src/rpc/obmysql/packet/ompk_ok.h index 564eba6b4..3b5ada3b3 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_ok.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_ok.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OMPK_OK_H_ diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_piece.cpp b/deps/oblib/src/rpc/obmysql/packet/ompk_piece.cpp index 1709c60f1..1354d97ca 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_piece.cpp +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_piece.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL @@ -64,4 +68,4 @@ int64_t OMPKPiece::get_serialize_size() const len += data_.size(); // data } return len; -} \ No newline at end of file +} diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_piece.h b/deps/oblib/src/rpc/obmysql/packet/ompk_piece.h index 137ebbba7..2883ee065 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_piece.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_piece.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBMYSQL_OMPK_PIECE_H_ diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_prepare.cpp b/deps/oblib/src/rpc/obmysql/packet/ompk_prepare.cpp index b732b6adf..2c5745eaf 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_prepare.cpp +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_prepare.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_prepare.h b/deps/oblib/src/rpc/obmysql/packet/ompk_prepare.h index 715c1e29f..732e7707c 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_prepare.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_prepare.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBMYSQL_OMPK_PREPARE_H_ diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_prexecute.cpp b/deps/oblib/src/rpc/obmysql/packet/ompk_prexecute.cpp index 5efd5505f..d7538e3bf 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_prexecute.cpp +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_prexecute.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_prexecute.h b/deps/oblib/src/rpc/obmysql/packet/ompk_prexecute.h index 1b2ddb541..0606274c5 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_prexecute.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_prexecute.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBMYSQL_OMPK_PREXECUTE_H_ diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_resheader.cpp b/deps/oblib/src/rpc/obmysql/packet/ompk_resheader.cpp index 1358ebe98..d664cba3e 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_resheader.cpp +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_resheader.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_resheader.h b/deps/oblib/src/rpc/obmysql/packet/ompk_resheader.h index c72d7eb2b..2805ea639 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_resheader.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_resheader.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OMPK_RESHEADER_H_ diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_row.cpp b/deps/oblib/src/rpc/obmysql/packet/ompk_row.cpp index e8f51367a..5772c25b7 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_row.cpp +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_row.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "rpc/obmysql/packet/ompk_row.h" diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_row.h b/deps/oblib/src/rpc/obmysql/packet/ompk_row.h index b42a64279..78c04baf0 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_row.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_row.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OMPK_ROW_H_ diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_ssl_request.cpp b/deps/oblib/src/rpc/obmysql/packet/ompk_ssl_request.cpp index ed264be2e..90189a494 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_ssl_request.cpp +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_ssl_request.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_ssl_request.h b/deps/oblib/src/rpc/obmysql/packet/ompk_ssl_request.h index d5752e669..0c22a61a2 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_ssl_request.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_ssl_request.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OMPK_SSL_REQUEST_H_ diff --git a/deps/oblib/src/rpc/obmysql/packet/ompk_string.h b/deps/oblib/src/rpc/obmysql/packet/ompk_string.h index c05531e9b..ca063d240 100644 --- a/deps/oblib/src/rpc/obmysql/packet/ompk_string.h +++ b/deps/oblib/src/rpc/obmysql/packet/ompk_string.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OMPK_STRING_H_ diff --git a/deps/oblib/src/rpc/obrpc/ob_easy_rpc_request_operator.cpp b/deps/oblib/src/rpc/obrpc/ob_easy_rpc_request_operator.cpp index 94e33257a..5f6c4947e 100644 --- a/deps/oblib/src/rpc/obrpc/ob_easy_rpc_request_operator.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_easy_rpc_request_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "rpc/obrpc/ob_easy_rpc_request_operator.h" diff --git a/deps/oblib/src/rpc/obrpc/ob_easy_rpc_request_operator.h b/deps/oblib/src/rpc/obrpc/ob_easy_rpc_request_operator.h index 28b441171..e3684804c 100644 --- a/deps/oblib/src/rpc/obrpc/ob_easy_rpc_request_operator.h +++ b/deps/oblib/src/rpc/obrpc/ob_easy_rpc_request_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OB_EASY_RPC_REQUEST_OPERATOR_H_ diff --git a/deps/oblib/src/rpc/obrpc/ob_irpc_extra_payload.h b/deps/oblib/src/rpc/obrpc/ob_irpc_extra_payload.h index 85dc43e0c..41b159269 100644 --- a/deps/oblib/src/rpc/obrpc/ob_irpc_extra_payload.h +++ b/deps/oblib/src/rpc/obrpc/ob_irpc_extra_payload.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBRPC_OB_IRPC_EXTRA_PAYLOAD_H_ diff --git a/deps/oblib/src/rpc/obrpc/ob_listener.cpp b/deps/oblib/src/rpc/obrpc/ob_listener.cpp index ca4038e83..ae92385d9 100644 --- a/deps/oblib/src/rpc/obrpc/ob_listener.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_listener.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "rpc/obrpc/ob_listener.h" diff --git a/deps/oblib/src/rpc/obrpc/ob_listener.h b/deps/oblib/src/rpc/obrpc/ob_listener.h index 9244ea717..db20e4203 100644 --- a/deps/oblib/src/rpc/obrpc/ob_listener.h +++ b/deps/oblib/src/rpc/obrpc/ob_listener.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBRPC_OB_LISTENER_H_ diff --git a/deps/oblib/src/rpc/obrpc/ob_local_procedure_call.cpp b/deps/oblib/src/rpc/obrpc/ob_local_procedure_call.cpp index 1d6eecfff..9d1d0f55d 100644 --- a/deps/oblib/src/rpc/obrpc/ob_local_procedure_call.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_local_procedure_call.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC diff --git a/deps/oblib/src/rpc/obrpc/ob_local_procedure_call.h b/deps/oblib/src/rpc/obrpc/ob_local_procedure_call.h index 12e7fd3d2..ee7f9e72a 100644 --- a/deps/oblib/src/rpc/obrpc/ob_local_procedure_call.h +++ b/deps/oblib/src/rpc/obrpc/ob_local_procedure_call.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOCAL_PROCEDURE_CALL_H_ #define OCEANBASE_LOCAL_PROCEDURE_CALL_H_ diff --git a/deps/oblib/src/rpc/obrpc/ob_net_client.cpp b/deps/oblib/src/rpc/obrpc/ob_net_client.cpp index 9d70ccf1e..6f63b6bd5 100644 --- a/deps/oblib/src/rpc/obrpc/ob_net_client.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_net_client.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC diff --git a/deps/oblib/src/rpc/obrpc/ob_net_client.h b/deps/oblib/src/rpc/obrpc/ob_net_client.h index 357e187b5..7982ea586 100644 --- a/deps/oblib/src/rpc/obrpc/ob_net_client.h +++ b/deps/oblib/src/rpc/obrpc/ob_net_client.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBRPC_OB_NET_CLIENT_ diff --git a/deps/oblib/src/rpc/obrpc/ob_net_keepalive.cpp b/deps/oblib/src/rpc/obrpc/ob_net_keepalive.cpp index 5cd39eda6..8adbc851b 100644 --- a/deps/oblib/src/rpc/obrpc/ob_net_keepalive.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_net_keepalive.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC diff --git a/deps/oblib/src/rpc/obrpc/ob_net_keepalive.h b/deps/oblib/src/rpc/obrpc/ob_net_keepalive.h index 822d3a2c5..bba568a49 100644 --- a/deps/oblib/src/rpc/obrpc/ob_net_keepalive.h +++ b/deps/oblib/src/rpc/obrpc/ob_net_keepalive.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBRPC_OB_RPC_KEEPALIVE_H_ diff --git a/deps/oblib/src/rpc/obrpc/ob_poc_rpc_proxy.cpp b/deps/oblib/src/rpc/obrpc/ob_poc_rpc_proxy.cpp index bfd2168b0..85bf5d7ff 100644 --- a/deps/oblib/src/rpc/obrpc/ob_poc_rpc_proxy.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_poc_rpc_proxy.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_poc_rpc_proxy.h" diff --git a/deps/oblib/src/rpc/obrpc/ob_poc_rpc_proxy.h b/deps/oblib/src/rpc/obrpc/ob_poc_rpc_proxy.h index 60363df07..bbcb63673 100644 --- a/deps/oblib/src/rpc/obrpc/ob_poc_rpc_proxy.h +++ b/deps/oblib/src/rpc/obrpc/ob_poc_rpc_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBRPC_OB_POC_RPC_PROXY_H_ diff --git a/deps/oblib/src/rpc/obrpc/ob_poc_rpc_request_operator.cpp b/deps/oblib/src/rpc/obrpc/ob_poc_rpc_request_operator.cpp index 6cefeda86..47ac9cd6e 100644 --- a/deps/oblib/src/rpc/obrpc/ob_poc_rpc_request_operator.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_poc_rpc_request_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "rpc/obrpc/ob_poc_rpc_request_operator.h" diff --git a/deps/oblib/src/rpc/obrpc/ob_poc_rpc_request_operator.h b/deps/oblib/src/rpc/obrpc/ob_poc_rpc_request_operator.h index ce04fe216..aa9f6786d 100644 --- a/deps/oblib/src/rpc/obrpc/ob_poc_rpc_request_operator.h +++ b/deps/oblib/src/rpc/obrpc/ob_poc_rpc_request_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBRPC_OB_POC_RPC_REQUEST_OPERATOR_H_ diff --git a/deps/oblib/src/rpc/obrpc/ob_poc_rpc_server.cpp b/deps/oblib/src/rpc/obrpc/ob_poc_rpc_server.cpp index cb92d6187..36f57b0b5 100644 --- a/deps/oblib/src/rpc/obrpc/ob_poc_rpc_server.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_poc_rpc_server.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "rpc/obrpc/ob_poc_rpc_server.h" diff --git a/deps/oblib/src/rpc/obrpc/ob_poc_rpc_server.h b/deps/oblib/src/rpc/obrpc/ob_poc_rpc_server.h index 229482d36..47e9147f6 100644 --- a/deps/oblib/src/rpc/obrpc/ob_poc_rpc_server.h +++ b/deps/oblib/src/rpc/obrpc/ob_poc_rpc_server.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBRPC_OB_POC_RPC_SERVER_H_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_compress_protocol_processor.cpp b/deps/oblib/src/rpc/obrpc/ob_rpc_compress_protocol_processor.cpp index 39ed7b470..3dc5f4d6f 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_compress_protocol_processor.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_compress_protocol_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_compress_protocol_processor.h b/deps/oblib/src/rpc/obrpc/ob_rpc_compress_protocol_processor.h index 07f8752d0..def745ff1 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_compress_protocol_processor.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_compress_protocol_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_RPC_COMPRESS_PROTOCOL_PROCESSOR_H_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_compress_struct.cpp b/deps/oblib/src/rpc/obrpc/ob_rpc_compress_struct.cpp index 95aeda134..da8def1b7 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_compress_struct.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_compress_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_compress_struct.h b/deps/oblib/src/rpc/obrpc/ob_rpc_compress_struct.h index 77af2746d..acee132d2 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_compress_struct.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_compress_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_RPC_COMPRESS_STRUCT_H_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_endec.cpp b/deps/oblib/src/rpc/obrpc/ob_rpc_endec.cpp index 757d39278..290ae23e5 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_endec.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_endec.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_endec.h b/deps/oblib/src/rpc/obrpc/ob_rpc_endec.h index a56bc5d8b..0019ef102 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_endec.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_endec.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBRPC_OB_RPC_ENDEC_H_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_mem_pool.cpp b/deps/oblib/src/rpc/obrpc/ob_rpc_mem_pool.cpp index a7a03e986..287b7289c 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_mem_pool.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_mem_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_mem_pool.h b/deps/oblib/src/rpc/obrpc/ob_rpc_mem_pool.h index 0074ea15d..55167f269 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_mem_pool.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_mem_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBRPC_OB_RPC_MEM_POOL_H_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_net_handler.cpp b/deps/oblib/src/rpc/obrpc/ob_rpc_net_handler.cpp index b4149e080..ccec17b43 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_net_handler.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_net_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC @@ -25,7 +29,6 @@ namespace oceanbase namespace obrpc { -int64_t ObRpcNetHandler::CLUSTER_ID = common::INVALID_CLUSTER_ID; uint64_t ObRpcNetHandler::CLUSTER_NAME_HASH = 0; diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_net_handler.h b/deps/oblib/src/rpc/obrpc/ob_rpc_net_handler.h index 29f66b039..0994d274a 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_net_handler.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_net_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBRPC_OB_RPC_NET_HANDLER_ @@ -28,7 +32,7 @@ class ObRpcNetHandler { public: public: - static int64_t CLUSTER_ID; + static constexpr const int64_t CLUSTER_ID = 1; static uint64_t CLUSTER_NAME_HASH; static bool is_self_cluster(int64_t cluster_id) { diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_opts.h b/deps/oblib/src/rpc/obrpc/ob_rpc_opts.h index c1482d8bc..c8492e147 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_opts.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_opts.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBRPC_OB_RPC_OPTS_H_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_packet.cpp b/deps/oblib/src/rpc/obrpc/ob_rpc_packet.cpp index 9b8056c14..8c09aeff6 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_packet.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_packet.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_packet.h b/deps/oblib/src/rpc/obrpc/ob_rpc_packet.h index c18018967..574884084 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_packet.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_packet.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBRPC_OB_RPC_PACKET_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_packet_list.h b/deps/oblib/src/rpc/obrpc/ob_rpc_packet_list.h index a1bb7b208..01fa769d8 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_packet_list.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_packet_list.h @@ -1,24 +1,27 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define MAX_PCODE 0xFFFF - -//占位须知: +// Placeholder instructions: // -//1. 按ID顺序占位,避免出现ID不连续或者顺序不对 -//2. 始终先在master占位,保证master分支是其他所有分支的超集,避免NAME和ID冲突 -//3. master占位之后,开发分支上不要变更NAME,否则FARM会认为ID占位冲突,如果有这种场景,需要先修改master占位 +//1. Place in order by ID to avoid discontinuous or incorrect order IDs +//2. Always placeholder on master first, ensure the master branch is a superset of all other branches, to avoid NAME and ID conflicts +//3. After master placeholder, do not change NAME on the development branch, otherwise FARM will consider ID placeholder conflict, if there is such a scenario, you need to modify the master placeholder first // -//占位方法: 通过注释,写出完整定义,//PCODE_DEF(OB_TEST_PCODE, 0x001) +//Placeholder method: through comments, write the complete definition, //PCODE_DEF(OB_TEST_PCODE, 0x001) // for initialization PCODE_DEF(OB_TEST_PCODE, 0x001) @@ -471,13 +474,13 @@ PCODE_DEF(OB_NOTIFY_CREATE_DUPLICATE_LS, 0x4B1) //PCODE_DEF(OB_HA_UNBLOCK_TX, 0x4B5) NO NEED ANYMORE PCODE_DEF(OB_TABLET_LOCATION_BROADCAST, 0x4BE) // migration micro cache -PCODE_DEF(OB_HA_GET_MICRO_BLOCK_CACHE_INFO, 0x4C1) // FARM COMPAT WHITELIST, 重命名,兼容检测加白名单 +PCODE_DEF(OB_HA_GET_MICRO_BLOCK_CACHE_INFO, 0x4C1) // FARM COMPAT WHITELIST, rename, compatibility detection whitelist PCODE_DEF(OB_HA_GET_MIGRATION_CACHE_JOB_INFO, 0x4C2) -PCODE_DEF(OB_HA_FETCH_MICRO_BLOCK_KEYS, 0x4C3) // FARM COMPAT WHITELIST, 重命名,兼容检测加白名单 +PCODE_DEF(OB_HA_FETCH_MICRO_BLOCK_KEYS, 0x4C3) // FARM COMPAT WHITELIST, rename, compatibility detection whitelist PCODE_DEF(OB_HA_FETCH_MICRO_BLOCK, 0x4C4) // fetch macro block logic id array -// PCODE_DEF(OB_HA_FETCH_SSTABLE_MACRO_ID_INFO, 0x4C8) // FARM COMPAT WHITELIST, 重命名,兼容检测加白名单 +// PCODE_DEF(OB_HA_FETCH_SSTABLE_MACRO_ID_INFO, 0x4C8) // FARM COMPAT WHITELIST, rename, compatibility detection whitelist // sql, including executor @@ -1057,7 +1060,7 @@ PCODE_DEF(OB_ADD_STORAGE, 0x1572) PCODE_DEF(OB_DROP_STORAGE, 0x1573) PCODE_DEF(OB_ALTER_STORAGE, 0x1574) PCODE_DEF(OB_CHECK_STORAGE_OPERATION_STATUS, 0X1575) -PCODE_DEF(OB_CHECK_SERVER_EMPTY_WITH_RESULT, 0x1576) // FARM COMPAT WHITELIST, 432之后改名 +PCODE_DEF(OB_CHECK_SERVER_EMPTY_WITH_RESULT, 0x1576) // FARM COMPAT WHITELIST, renamed after 432 PCODE_DEF(OB_REPLICA_PREWARM_FETCH_MICRO_BLOCK, 0x1577) PCODE_DEF(OB_SYNC_HOT_MICRO_KEY, 0x1578) PCODE_DEF(OB_NOTIFY_SHARED_STORAGE_INFO, 0x1579) @@ -1113,8 +1116,8 @@ PCODE_DEF(OB_CREATE_TRIGGER_WITH_RES, 0x160D) // Shared storage network throt PCODE_DEF(OB_SHARED_STORAGE_NET_THROT_REGISTER, 0x160E) -PCODE_DEF(OB_SHARED_STORAGE_NET_THROT_PREDICT, 0x1610) // FARM COMPAT WHITELIST, 432之后改名 -PCODE_DEF(OB_SHARED_STORAGE_NET_THROT_SET, 0x1611) // FARM COMPAT WHITELIST, 432之后改名 +PCODE_DEF(OB_SHARED_STORAGE_NET_THROT_PREDICT, 0x1610) // FARM COMPATIBILITY WHITELIST, renamed after 432 +PCODE_DEF(OB_SHARED_STORAGE_NET_THROT_SET, 0x1611) // FARM COMPATIBILITY WHITELIST, renamed after 432 // update materialized view table status PCODE_DEF(OB_UPDATE_MVIEW_TABLE_STATUS, 0x1612) @@ -1226,12 +1229,17 @@ PCODE_DEF(OB_ADMIN_FORCE_DROP_LONELY_LOB_AUX_TABLE, 0x1663) PCODE_DEF(OB_FORCE_DROP_LONELY_LOB_AUX_TABLE, 0x1664) PCODE_DEF(OB_CHECK_NESTED_MVIEW_MDS, 0x1666) -//**** 注意:在此行之前增加新的RPC ID ****** + +// for ai function +PCODE_DEF(OB_CREATE_AI_MODEL, 0x1667) +PCODE_DEF(OB_DROP_AI_MODEL, 0x1668) + +//**** Note: Add new RPC ID before this line ****** // -//占位须知: +// Placeholder Notice: // -//1. 按ID顺序占位,避免出现ID不连续或者顺序不对 -//2. 始终先在master占位,保证master分支是其他所有分支的超集,避免NAME和ID冲突 -//3. master占位之后,开发分支上不要变更NAME,否则FARM会认为ID占位冲突,如果有这种场景,需要先修改master占位 +//1. Place in order by ID to avoid discontinuous or incorrect order IDs +//2. Always placeholder on master first, ensure the master branch is a superset of all other branches, to avoid NAME and ID conflicts +//3. After master placeholder, do not change NAME on the development branch, otherwise FARM will consider ID placeholder conflict, if there is such a scenario, you need to modify the master placeholder first // -//占位方法: 通过注释,写出完整定义,//PCODE_DEF(OB_TEST_PCODE, 0x001) +//Placeholder method: Through comments, write the complete definition, //PCODE_DEF(OB_TEST_PCODE, 0x001) diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_processor.h b/deps/oblib/src/rpc/obrpc/ob_rpc_processor.h index 2dbceb301..3bba9586e 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_processor.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBRPC_OB_RPC_PROCESSOR_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_processor_base.cpp b/deps/oblib/src/rpc/obrpc/ob_rpc_processor_base.cpp index 42890dbc1..0b32820d0 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_processor_base.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_processor_base.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_FRAME diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_processor_base.h b/deps/oblib/src/rpc/obrpc/ob_rpc_processor_base.h index 68fe3c221..7ce6561e7 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_processor_base.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_processor_base.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBRPC_OB_RPC_PROCESSOR_BASE_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_protocol_processor.cpp b/deps/oblib/src/rpc/obrpc/ob_rpc_protocol_processor.cpp index dc2b0e471..6f72ee57f 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_protocol_processor.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_protocol_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_protocol_processor.h b/deps/oblib/src/rpc/obrpc/ob_rpc_protocol_processor.h index 21334905e..f6dd072b6 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_protocol_processor.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_protocol_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_RPC_PROTOCOL_PROCESSOR_H_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.cpp b/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.cpp index 6e2ae3cfe..09084f3e1 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.h b/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.h index 3b5c6a217..8f503b830 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBRPC_OB_RPC_PROXY_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.ipp b/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.ipp index 46b152d7f..a00831579 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.ipp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.ipp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBRPC_OB_RPC_PROXY_IPP_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_proxy_macros.h b/deps/oblib/src/rpc/obrpc/ob_rpc_proxy_macros.h index 7f6c2d8ec..c7a8e2c61 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_proxy_macros.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_proxy_macros.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ // #ifndef OCEANBASE_RPC_OBRPC_OB_RPC_PROXY_MACROS_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_req_context.h b/deps/oblib/src/rpc/obrpc/ob_rpc_req_context.h index b1a78869e..5659837d4 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_req_context.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_req_context.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBRPC_REQ_CONTEXT_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_request.cpp b/deps/oblib/src/rpc/obrpc/ob_rpc_request.cpp index 501a41790..672f61e6b 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_request.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_request.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_request.h b/deps/oblib/src/rpc/obrpc/ob_rpc_request.h index c15fd0b47..e59cc4f07 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_request.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_request.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBRPC_OB_RPC_REQUEST_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_result_code.cpp b/deps/oblib/src/rpc/obrpc/ob_rpc_result_code.cpp index 42d823529..4124f6405 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_result_code.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_result_code.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "rpc/obrpc/ob_rpc_result_code.h" diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_result_code.h b/deps/oblib/src/rpc/obrpc/ob_rpc_result_code.h index ee270ad36..9b6893a73 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_result_code.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_result_code.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBRPC_OB_RPC_RESULT_CODE_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_reverse_keepalive_struct.h b/deps/oblib/src/rpc/obrpc/ob_rpc_reverse_keepalive_struct.h index d38068b18..512898c92 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_reverse_keepalive_struct.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_reverse_keepalive_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_RPC_REVERSE_KEEPALIVE_STRUCT_H diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_session_handler.cpp b/deps/oblib/src/rpc/obrpc/ob_rpc_session_handler.cpp index 829de04de..e00c03ad4 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_session_handler.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_session_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_session_handler.h b/deps/oblib/src/rpc/obrpc/ob_rpc_session_handler.h index 99f29b2dd..8f67b4ebc 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_session_handler.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_session_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBRPC_OB_RPC_SESSION_HANDLER_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_stream_cond.cpp b/deps/oblib/src/rpc/obrpc/ob_rpc_stream_cond.cpp index ab50a781d..bc357958c 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_stream_cond.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_stream_cond.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_stream_cond.h b/deps/oblib/src/rpc/obrpc/ob_rpc_stream_cond.h index b333c57c3..19ec681f9 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_stream_cond.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_stream_cond.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBRPC_OB_RPC_STREAM_COND_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_time.cpp b/deps/oblib/src/rpc/obrpc/ob_rpc_time.cpp index 13ab004e1..8db5cace3 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_time.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_time.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_time.h b/deps/oblib/src/rpc/obrpc/ob_rpc_time.h index 074b4df23..a41bf1c92 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_time.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_time.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBRPC_OB_RPC_TIME_ diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_translator.cpp b/deps/oblib/src/rpc/obrpc/ob_rpc_translator.cpp index dcb36ca07..e0da1972e 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_translator.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_translator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_translator.h b/deps/oblib/src/rpc/obrpc/ob_rpc_translator.h index d6ecd142d..75e31806f 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_translator.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_translator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OBRPC_OB_RPC_TRANSLATOR_ diff --git a/deps/oblib/src/rpc/obrpc/ob_virtual_rpc_protocol_processor.cpp b/deps/oblib/src/rpc/obrpc/ob_virtual_rpc_protocol_processor.cpp index e9bfc188f..8df9791c8 100644 --- a/deps/oblib/src/rpc/obrpc/ob_virtual_rpc_protocol_processor.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_virtual_rpc_protocol_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBRPC diff --git a/deps/oblib/src/rpc/obrpc/ob_virtual_rpc_protocol_processor.h b/deps/oblib/src/rpc/obrpc/ob_virtual_rpc_protocol_processor.h index e0805e16e..f49f42e99 100644 --- a/deps/oblib/src/rpc/obrpc/ob_virtual_rpc_protocol_processor.h +++ b/deps/oblib/src/rpc/obrpc/ob_virtual_rpc_protocol_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_VIRTUAL_RPC_PROTOCOL_PROCESSOR_H_ @@ -75,9 +79,9 @@ class ObVirtualRpcProtocolProcessor int64_t &compressed_size); /* - *@param [in] preceding_data_len: cmd_packet锁占的内存大小, - ms->input->pos + preceding_data_len 即为压缩后的packet的起始位置 - *@param [in] decode_data_len: 压缩后数据的总大小 + *@param [in] preceding_data_len: memory size occupied by cmd_packet lock, + ms->input->pos + preceding_data_len is the starting position of the compressed packet + *@param [in] decode_data_len: total size of the compressed data * */ int decode_compressed_packet_data(common::ObTimeGuard &timeguard, easy_message_t *ms, @@ -86,8 +90,8 @@ class ObVirtualRpcProtocolProcessor ObRpcPacket *&pkt); /* * this func is to decode data after decompressed as a net rpc packet - *@param [in] data: 开始的sizeof(ObRpcPacket)个字节用于分配ObRpcPacket, 接下来的数据是一个完整的net packet - *@param [in] data_len: data的长度 + *@param [in] data: the first sizeof(ObRpcPacket) bytes are used to allocate ObRpcPacket, the following data is a complete net packet + *@param [in] data_len: length of data */ int decode_net_rpc_packet(common::ObTimeGuard &timeguard, char *data, int64_t data_len, ObRpcPacket *&pkt); diff --git a/deps/oblib/unittest/common/rowkey/test_store_rowkey.cpp b/deps/oblib/unittest/common/rowkey/test_store_rowkey.cpp index cfe545a1a..27814f9b4 100644 --- a/deps/oblib/unittest/common/rowkey/test_store_rowkey.cpp +++ b/deps/oblib/unittest/common/rowkey/test_store_rowkey.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/common/test_cell_reader.cpp b/deps/oblib/unittest/common/test_cell_reader.cpp index 8aa4018f7..45363cfd8 100644 --- a/deps/oblib/unittest/common/test_cell_reader.cpp +++ b/deps/oblib/unittest/common/test_cell_reader.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/common/test_cell_writer.cpp b/deps/oblib/unittest/common/test_cell_writer.cpp index 3b259c586..36608a423 100644 --- a/deps/oblib/unittest/common/test_cell_writer.cpp +++ b/deps/oblib/unittest/common/test_cell_writer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/common/test_common_utility.cpp b/deps/oblib/unittest/common/test_common_utility.cpp index c417fb50d..25dbf2a62 100644 --- a/deps/oblib/unittest/common/test_common_utility.cpp +++ b/deps/oblib/unittest/common/test_common_utility.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/common/test_delay_free_allocator.cpp b/deps/oblib/unittest/common/test_delay_free_allocator.cpp index c1d09161d..575962c43 100644 --- a/deps/oblib/unittest/common/test_delay_free_allocator.cpp +++ b/deps/oblib/unittest/common/test_delay_free_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/common/test_memfrag_recycle_allocator.cpp b/deps/oblib/unittest/common/test_memfrag_recycle_allocator.cpp index d503dd897..514f26a9f 100644 --- a/deps/oblib/unittest/common/test_memfrag_recycle_allocator.cpp +++ b/deps/oblib/unittest/common/test_memfrag_recycle_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/common/test_multi_version_range.cpp b/deps/oblib/unittest/common/test_multi_version_range.cpp index 3c40b04e2..f56581181 100644 --- a/deps/oblib/unittest/common/test_multi_version_range.cpp +++ b/deps/oblib/unittest/common/test_multi_version_range.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/common/test_ob_file_common_header.cpp b/deps/oblib/unittest/common/test_ob_file_common_header.cpp index 2ccddf06c..70f81a940 100644 --- a/deps/oblib/unittest/common/test_ob_file_common_header.cpp +++ b/deps/oblib/unittest/common/test_ob_file_common_header.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/common/test_ob_object.cpp b/deps/oblib/unittest/common/test_ob_object.cpp index c1743124e..d8d4c91f6 100644 --- a/deps/oblib/unittest/common/test_ob_object.cpp +++ b/deps/oblib/unittest/common/test_ob_object.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/object/ob_object.h" diff --git a/deps/oblib/unittest/common/test_ob_profile_fill_log.cpp b/deps/oblib/unittest/common/test_ob_profile_fill_log.cpp index 413256268..9d9bcafed 100644 --- a/deps/oblib/unittest/common/test_ob_profile_fill_log.cpp +++ b/deps/oblib/unittest/common/test_ob_profile_fill_log.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/common/test_ob_profile_log.cpp b/deps/oblib/unittest/common/test_ob_profile_log.cpp index c5ef0329d..9f9b9c7ae 100644 --- a/deps/oblib/unittest/common/test_ob_profile_log.cpp +++ b/deps/oblib/unittest/common/test_ob_profile_log.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/common/test_ob_range.cpp b/deps/oblib/unittest/common/test_ob_range.cpp index e1e003b13..8081aa0b6 100644 --- a/deps/oblib/unittest/common/test_ob_range.cpp +++ b/deps/oblib/unittest/common/test_ob_range.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/common/test_ob_sequence.cpp b/deps/oblib/unittest/common/test_ob_sequence.cpp index 7270d8e92..7b99dc030 100644 --- a/deps/oblib/unittest/common/test_ob_sequence.cpp +++ b/deps/oblib/unittest/common/test_ob_sequence.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -26,8 +30,7 @@ public : virtual void SetUp() {} virtual void TearDown() {} }; - -//////////////////////基本功能测试////////////////////////////////////////// +//////////////////////Basic Function Test////////////////////////////////////////// TEST_F(TestObSequence, get_max_seq_no) { diff --git a/deps/oblib/unittest/common/test_profile_utils.h b/deps/oblib/unittest/common/test_profile_utils.h index 6b416e29b..0db0d8046 100644 --- a/deps/oblib/unittest/common/test_profile_utils.h +++ b/deps/oblib/unittest/common/test_profile_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_TEST_PROFILE_UTILS_H diff --git a/deps/oblib/unittest/common/test_row_store.cpp b/deps/oblib/unittest/common/test_row_store.cpp index 00ab51d4b..a2bc24062 100644 --- a/deps/oblib/unittest/common/test_row_store.cpp +++ b/deps/oblib/unittest/common/test_row_store.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/row/ob_row_store.h" diff --git a/deps/oblib/unittest/common/test_serialization_helper.cpp b/deps/oblib/unittest/common/test_serialization_helper.cpp index 8496bb9b1..19a1f418b 100644 --- a/deps/oblib/unittest/common/test_serialization_helper.cpp +++ b/deps/oblib/unittest/common/test_serialization_helper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/common/test_small_allocator.cpp b/deps/oblib/unittest/common/test_small_allocator.cpp index 85ac0e20a..26e0b97a8 100644 --- a/deps/oblib/unittest/common/test_small_allocator.cpp +++ b/deps/oblib/unittest/common/test_small_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "gtest/gtest.h" diff --git a/deps/oblib/unittest/common/test_smart_call.cpp b/deps/oblib/unittest/common/test_smart_call.cpp index 7615015e9..8ab52ef6f 100644 --- a/deps/oblib/unittest/common/test_smart_call.cpp +++ b/deps/oblib/unittest/common/test_smart_call.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/common/test_smart_var.cpp b/deps/oblib/unittest/common/test_smart_var.cpp index dc530c055..6f1665fce 100644 --- a/deps/oblib/unittest/common/test_smart_var.cpp +++ b/deps/oblib/unittest/common/test_smart_var.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/common/test_sql_string.cpp b/deps/oblib/unittest/common/test_sql_string.cpp index bba966577..01ec2423f 100644 --- a/deps/oblib/unittest/common/test_sql_string.cpp +++ b/deps/oblib/unittest/common/test_sql_string.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/common/test_store_range.cpp b/deps/oblib/unittest/common/test_store_range.cpp index aa62637b2..35958a058 100644 --- a/deps/oblib/unittest/common/test_store_range.cpp +++ b/deps/oblib/unittest/common/test_store_range.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/common/test_timeout_ctx.cpp b/deps/oblib/unittest/common/test_timeout_ctx.cpp index 8cfe3b93c..9107b9182 100644 --- a/deps/oblib/unittest/common/test_timeout_ctx.cpp +++ b/deps/oblib/unittest/common/test_timeout_ctx.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/alloc/alloc_trace.cpp b/deps/oblib/unittest/lib/alloc/alloc_trace.cpp index cef67aea4..a2409b940 100644 --- a/deps/oblib/unittest/lib/alloc/alloc_trace.cpp +++ b/deps/oblib/unittest/lib/alloc/alloc_trace.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/alloc/test_alloc_struct.cpp b/deps/oblib/unittest/lib/alloc/test_alloc_struct.cpp index 77d403576..c33bcce73 100644 --- a/deps/oblib/unittest/lib/alloc/test_alloc_struct.cpp +++ b/deps/oblib/unittest/lib/alloc/test_alloc_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/alloc/test_block_set.cpp b/deps/oblib/unittest/lib/alloc/test_block_set.cpp index aa40b876a..4372404e9 100644 --- a/deps/oblib/unittest/lib/alloc/test_block_set.cpp +++ b/deps/oblib/unittest/lib/alloc/test_block_set.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/alloc/test_chunk_mgr.cpp b/deps/oblib/unittest/lib/alloc/test_chunk_mgr.cpp index 738fc7c19..9663bb84b 100644 --- a/deps/oblib/unittest/lib/alloc/test_chunk_mgr.cpp +++ b/deps/oblib/unittest/lib/alloc/test_chunk_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -276,25 +280,12 @@ TEST_F(TestChunkMgr, BorderCase_advise_fail) TEST_F(TestChunkMgr, alloc_co_chunk) { - int LARGE_SIZE = INTACT_ACHUNK_SIZE + 100; int NORMAL_SIZE = OB_MALLOC_BIG_BLOCK_SIZE; - { - AChunk *chunk = alloc_chunk(NORMAL_SIZE); - free_chunk(chunk); - chunk = alloc_chunk(LARGE_SIZE); - free_chunk(chunk); - } - EXPECT_EQ(1, large_slot()->get_pushes()); - EXPECT_EQ(0, large_slot()->get_pops()); - EXPECT_EQ(1, normal_slot()->get_pushes()); - EXPECT_EQ(0, normal_slot()->get_pops()); - set_limit(hold_); - auto *chunk = alloc_co_chunk(NORMAL_SIZE); - EXPECT_TRUE(chunk != NULL); - EXPECT_EQ(1, large_slot()->get_pops()); - chunk = alloc_co_chunk(NORMAL_SIZE); + set_limit(0); + auto *chunk = alloc_co_chunk(NORMAL_SIZE); // high_prio alloc always succeed EXPECT_TRUE(chunk != NULL); - EXPECT_EQ(1, normal_slot()->get_pops()); + free_chunk(chunk); + EXPECT_EQ(0, large_slot()->get_pushes()); // direct free } TEST_F(TestChunkMgr, FreeListBasic) @@ -345,4 +336,4 @@ TEST_F(TestChunkMgr, sync_wash) EXPECT_EQ(0, hold_); EXPECT_EQ(0, normal_slot()->count()); EXPECT_EQ(0, large_slot()->count()); -} \ No newline at end of file +} diff --git a/deps/oblib/unittest/lib/alloc/test_malloc_allocator.cpp b/deps/oblib/unittest/lib/alloc/test_malloc_allocator.cpp index 55a1d0f37..cc6a50428 100644 --- a/deps/oblib/unittest/lib/alloc/test_malloc_allocator.cpp +++ b/deps/oblib/unittest/lib/alloc/test_malloc_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/alloc/test_malloc_hook.cpp b/deps/oblib/unittest/lib/alloc/test_malloc_hook.cpp index 988c80619..b225abc1b 100644 --- a/deps/oblib/unittest/lib/alloc/test_malloc_hook.cpp +++ b/deps/oblib/unittest/lib/alloc/test_malloc_hook.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/alloc/test_ob_malloc_callback_guard.cpp b/deps/oblib/unittest/lib/alloc/test_ob_malloc_callback_guard.cpp index 52515fd64..5f7fc6c59 100644 --- a/deps/oblib/unittest/lib/alloc/test_ob_malloc_callback_guard.cpp +++ b/deps/oblib/unittest/lib/alloc/test_ob_malloc_callback_guard.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/alloc/test_object_mgr.cpp b/deps/oblib/unittest/lib/alloc/test_object_mgr.cpp index 737b0c264..c94f88023 100644 --- a/deps/oblib/unittest/lib/alloc/test_object_mgr.cpp +++ b/deps/oblib/unittest/lib/alloc/test_object_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/deps/oblib/unittest/lib/alloc/test_object_set.cpp b/deps/oblib/unittest/lib/alloc/test_object_set.cpp index 92e0f52e9..be11e4310 100644 --- a/deps/oblib/unittest/lib/alloc/test_object_set.cpp +++ b/deps/oblib/unittest/lib/alloc/test_object_set.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/alloc/test_object_set_v2.cpp b/deps/oblib/unittest/lib/alloc/test_object_set_v2.cpp index 2929d910b..f050f9060 100644 --- a/deps/oblib/unittest/lib/alloc/test_object_set_v2.cpp +++ b/deps/oblib/unittest/lib/alloc/test_object_set_v2.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include #define private public @@ -103,4 +107,4 @@ int main(int argc, char *argv[]) enable_malloc_v2(true); enable_memleak_light_backtrace(true); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/deps/oblib/unittest/lib/alloc/test_tenant_ctx_allocator.cpp b/deps/oblib/unittest/lib/alloc/test_tenant_ctx_allocator.cpp index 872629dfc..07e1dab4a 100644 --- a/deps/oblib/unittest/lib/alloc/test_tenant_ctx_allocator.cpp +++ b/deps/oblib/unittest/lib/alloc/test_tenant_ctx_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -63,12 +67,15 @@ TEST(TestTenantAllocator, SysLimit) cout << "current hold: " << hold << endl; set_memory_limit(hold); + set_memory_hard_limit(hold); EXPECT_EQ(NULL, ta.alloc(1, attr)); set_memory_limit(hold + (1<<20)); + set_memory_hard_limit(hold + (1<<20)); EXPECT_EQ(NULL, ta.alloc(1, attr)); set_memory_limit(hold + (3<<20)); + set_memory_hard_limit(hold + (3<<20)); EXPECT_TRUE(NULL != ta.alloc(1, attr)); } @@ -82,15 +89,10 @@ TEST(TestTenantAllocator, TenantLimit) cout << "current hold: " << hold << endl; set_memory_limit(hold); // now, we can't allocate new memory from system + set_memory_hard_limit(hold); EXPECT_FALSE(NULL != ta.alloc(1, attr)); attr.prio_ = OB_HIGH_ALLOC; - EXPECT_FALSE(NULL != ta.alloc(1, attr)); - - ob_set_urgent_memory((2 << 20) - 1); - EXPECT_FALSE(NULL != ta.alloc(1, attr)); - - ob_set_urgent_memory(2 << 20); EXPECT_TRUE(NULL != ta.alloc(1, attr)); EXPECT_TRUE(NULL != ta.alloc(1, attr)); @@ -122,6 +124,7 @@ TEST(TestTenantAllocator, ctx_limit) const int64_t limit = 30 * size; int64_t alloced = 0; ctx_ta.set_limit(limit); + ctx_ta.set_hard_limit(limit); while (true) { if (NULL == ctx_ta.alloc(size, attr)) { break; diff --git a/deps/oblib/unittest/lib/allocator/test_allocator.cpp b/deps/oblib/unittest/lib/allocator/test_allocator.cpp index 7dacb9b36..5773a2685 100644 --- a/deps/oblib/unittest/lib/allocator/test_allocator.cpp +++ b/deps/oblib/unittest/lib/allocator/test_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/allocator/test_allocator_performance.cpp b/deps/oblib/unittest/lib/allocator/test_allocator_performance.cpp index d23a4d06d..0d068e4dd 100644 --- a/deps/oblib/unittest/lib/allocator/test_allocator_performance.cpp +++ b/deps/oblib/unittest/lib/allocator/test_allocator_performance.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/allocator/test_buddy_allocator.cpp b/deps/oblib/unittest/lib/allocator/test_buddy_allocator.cpp index 3eaf8c286..bed1e6620 100644 --- a/deps/oblib/unittest/lib/allocator/test_buddy_allocator.cpp +++ b/deps/oblib/unittest/lib/allocator/test_buddy_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/allocator/test_concurrent_fifo_allocator.cpp b/deps/oblib/unittest/lib/allocator/test_concurrent_fifo_allocator.cpp index 5413d8575..e6a23833d 100644 --- a/deps/oblib/unittest/lib/allocator/test_concurrent_fifo_allocator.cpp +++ b/deps/oblib/unittest/lib/allocator/test_concurrent_fifo_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/allocator/ob_concurrent_fifo_allocator.h" diff --git a/deps/oblib/unittest/lib/allocator/test_fifo.cpp b/deps/oblib/unittest/lib/allocator/test_fifo.cpp index 4b839497b..ad6f0a2e1 100644 --- a/deps/oblib/unittest/lib/allocator/test_fifo.cpp +++ b/deps/oblib/unittest/lib/allocator/test_fifo.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/allocator/test_jemalloc_performance.cpp b/deps/oblib/unittest/lib/allocator/test_jemalloc_performance.cpp index 6c2ddce6d..44a33aa9f 100644 --- a/deps/oblib/unittest/lib/allocator/test_jemalloc_performance.cpp +++ b/deps/oblib/unittest/lib/allocator/test_jemalloc_performance.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/allocator/test_lf_fifo_allocator.cpp b/deps/oblib/unittest/lib/allocator/test_lf_fifo_allocator.cpp index b99c180f2..def345199 100644 --- a/deps/oblib/unittest/lib/allocator/test_lf_fifo_allocator.cpp +++ b/deps/oblib/unittest/lib/allocator/test_lf_fifo_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/allocator/test_page_arena.cpp b/deps/oblib/unittest/lib/allocator/test_page_arena.cpp index fe1323242..76566caa7 100644 --- a/deps/oblib/unittest/lib/allocator/test_page_arena.cpp +++ b/deps/oblib/unittest/lib/allocator/test_page_arena.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/allocator/test_slice_alloc.cpp b/deps/oblib/unittest/lib/allocator/test_slice_alloc.cpp index 25321e30d..d30b17b8c 100644 --- a/deps/oblib/unittest/lib/allocator/test_slice_alloc.cpp +++ b/deps/oblib/unittest/lib/allocator/test_slice_alloc.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/allocator/ob_vslice_alloc.h" diff --git a/deps/oblib/unittest/lib/allocator/test_sql_arena_allocator.cpp b/deps/oblib/unittest/lib/allocator/test_sql_arena_allocator.cpp index 969eece7f..db0761873 100644 --- a/deps/oblib/unittest/lib/allocator/test_sql_arena_allocator.cpp +++ b/deps/oblib/unittest/lib/allocator/test_sql_arena_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/atomic/test_atomic_reference.cpp b/deps/oblib/unittest/lib/atomic/test_atomic_reference.cpp index 42c00f70b..fbabf993a 100644 --- a/deps/oblib/unittest/lib/atomic/test_atomic_reference.cpp +++ b/deps/oblib/unittest/lib/atomic/test_atomic_reference.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/cbtree/test_key_btree.cpp b/deps/oblib/unittest/lib/cbtree/test_key_btree.cpp index 52a2e0172..c12234483 100644 --- a/deps/oblib/unittest/lib/cbtree/test_key_btree.cpp +++ b/deps/oblib/unittest/lib/cbtree/test_key_btree.cpp @@ -1,12 +1,16 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/deps/oblib/unittest/lib/charset/test_charset.cpp b/deps/oblib/unittest/lib/charset/test_charset.cpp index a7ee5b772..4523d4bca 100644 --- a/deps/oblib/unittest/lib/charset/test_charset.cpp +++ b/deps/oblib/unittest/lib/charset/test_charset.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -165,10 +169,10 @@ TEST_F(TestCharset, sortkey) const char ascii_string[] = {'\x7f','\0'}; const char non_ascii_string[] = {'\xff','\0'}; - const char gbk_string[] = { '\xc4', '\xe3', '\xba', '\xc3','\0' };//meaing is '你好' - const char gb18030_string[] = { '\xc4', '\xe3', '\xba', '\xc3','\0' };//meaing is '你好' - const char utf8_string[] = { '\xe4', '\xbd', '\xa0', '\xe5', '\xa5', '\xbd','\0'};//meaing is '你好' - const char utf16_string[] = { '\x4f', '\x60', '\x59', '\x7d','\0'};//meaing is '你好' + const char gbk_string[] = { '\xc4', '\xe3', '\xba', '\xc3','\0' };//meaning is '你好' + const char gb18030_string[] = { '\xc4', '\xe3', '\xba', '\xc3','\0' };//meaning is '你好' + const char utf8_string[] = { '\xe4', '\xbd', '\xa0', '\xe5', '\xa5', '\xbd','\0'};//meaning is '你好' + const char utf16_string[] = { '\x4f', '\x60', '\x59', '\x7d','\0'};//meaning is '你好' test_string.push_back(std::make_pair(std::string(ascii_string),std::string((non_ascii_string)))); //CS_TYPE_LATIN1_SWEDISH_CI test_string.push_back(std::make_pair(std::string(gbk_string),std::string((non_ascii_string)))); //CS_TYPE_GBK_CHINESE_CI test_string.push_back(std::make_pair(std::string(utf8_string),std::string((non_ascii_string)))); //CS_TYPE_UTF8MB4_GENERAL_CI @@ -1082,7 +1086,7 @@ TEST_F(TestCharset, foreach_char) { void debug_print_hex(const char* str,const char* sort_str ) { - // 以16进制格式打印每个字符 + // Print each character in hexadecimal format fprintf(stdout, "origin str = \"%s\"\n", str); for (int i = 0; str[i] != '\0'; i++) { fprintf(stdout, "%02X ",(unsigned char)str[i]); diff --git a/deps/oblib/unittest/lib/charset/unicode_map.h b/deps/oblib/unittest/lib/charset/unicode_map.h index f9511b14e..d8602b875 100644 --- a/deps/oblib/unittest/lib/charset/unicode_map.h +++ b/deps/oblib/unittest/lib/charset/unicode_map.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ struct UniCodeMap { diff --git a/deps/oblib/unittest/lib/checksum/test_crc64.cpp b/deps/oblib/unittest/lib/checksum/test_crc64.cpp index 8d04babc3..ab5b77f14 100644 --- a/deps/oblib/unittest/lib/checksum/test_crc64.cpp +++ b/deps/oblib/unittest/lib/checksum/test_crc64.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/codec/test_bitpacking.cpp b/deps/oblib/unittest/lib/codec/test_bitpacking.cpp index 7b2211ed7..839bee7b9 100644 --- a/deps/oblib/unittest/lib/codec/test_bitpacking.cpp +++ b/deps/oblib/unittest/lib/codec/test_bitpacking.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/codec/test_bitpacking_performance.cpp b/deps/oblib/unittest/lib/codec/test_bitpacking_performance.cpp index 48f6b9bd1..1453cbb3a 100644 --- a/deps/oblib/unittest/lib/codec/test_bitpacking_performance.cpp +++ b/deps/oblib/unittest/lib/codec/test_bitpacking_performance.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/codec/test_codec_performance.cpp b/deps/oblib/unittest/lib/codec/test_codec_performance.cpp index a24b02c98..e5e6bfd94 100644 --- a/deps/oblib/unittest/lib/codec/test_codec_performance.cpp +++ b/deps/oblib/unittest/lib/codec/test_codec_performance.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/codec/test_composite.cpp b/deps/oblib/unittest/lib/codec/test_composite.cpp index a5dc0a5eb..86bfa698f 100644 --- a/deps/oblib/unittest/lib/codec/test_composite.cpp +++ b/deps/oblib/unittest/lib/codec/test_composite.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/codec/test_fast_delta.cpp b/deps/oblib/unittest/lib/codec/test_fast_delta.cpp index 5052d5344..02de0226c 100644 --- a/deps/oblib/unittest/lib/codec/test_fast_delta.cpp +++ b/deps/oblib/unittest/lib/codec/test_fast_delta.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/codec/ob_fast_delta.h" diff --git a/deps/oblib/unittest/lib/compress/test_compressor.cpp b/deps/oblib/unittest/lib/compress/test_compressor.cpp index cde3e6521..2cfebba7e 100644 --- a/deps/oblib/unittest/lib/compress/test_compressor.cpp +++ b/deps/oblib/unittest/lib/compress/test_compressor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/compress/test_compressor_pool.cpp b/deps/oblib/unittest/lib/compress/test_compressor_pool.cpp index 99bc382b1..348a45e94 100644 --- a/deps/oblib/unittest/lib/compress/test_compressor_pool.cpp +++ b/deps/oblib/unittest/lib/compress/test_compressor_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/compress/test_stream_compress_for_core.cpp b/deps/oblib/unittest/lib/compress/test_stream_compress_for_core.cpp index 276a5ebb7..24eeed630 100644 --- a/deps/oblib/unittest/lib/compress/test_stream_compress_for_core.cpp +++ b/deps/oblib/unittest/lib/compress/test_stream_compress_for_core.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/container/ob_2d_array_test.cpp b/deps/oblib/unittest/lib/container/ob_2d_array_test.cpp index 18d129122..37025226b 100644 --- a/deps/oblib/unittest/lib/container/ob_2d_array_test.cpp +++ b/deps/oblib/unittest/lib/container/ob_2d_array_test.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/container/ob_2d_array.h" diff --git a/deps/oblib/unittest/lib/container/ob_array_test.cpp b/deps/oblib/unittest/lib/container/ob_array_test.cpp index b72697732..ef6c1dd72 100644 --- a/deps/oblib/unittest/lib/container/ob_array_test.cpp +++ b/deps/oblib/unittest/lib/container/ob_array_test.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/container/ob_heap_test.cpp b/deps/oblib/unittest/lib/container/ob_heap_test.cpp index e5aa15ee5..80209e18f 100644 --- a/deps/oblib/unittest/lib/container/ob_heap_test.cpp +++ b/deps/oblib/unittest/lib/container/ob_heap_test.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/container/ob_heap.h" diff --git a/deps/oblib/unittest/lib/container/ob_se_array_test.cpp b/deps/oblib/unittest/lib/container/ob_se_array_test.cpp index 9a92cb6ee..9de53227f 100644 --- a/deps/oblib/unittest/lib/container/ob_se_array_test.cpp +++ b/deps/oblib/unittest/lib/container/ob_se_array_test.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/container/ob_se_array.h" diff --git a/deps/oblib/unittest/lib/container/test_array_array.cpp b/deps/oblib/unittest/lib/container/test_array_array.cpp index d5093d36e..4457ac551 100644 --- a/deps/oblib/unittest/lib/container/test_array_array.cpp +++ b/deps/oblib/unittest/lib/container/test_array_array.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/container/test_array_helper.cpp b/deps/oblib/unittest/lib/container/test_array_helper.cpp index 49cbde3d1..78e22cef8 100644 --- a/deps/oblib/unittest/lib/container/test_array_helper.cpp +++ b/deps/oblib/unittest/lib/container/test_array_helper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/container/test_bit_set.cpp b/deps/oblib/unittest/lib/container/test_bit_set.cpp index 881535b05..474158f1a 100644 --- a/deps/oblib/unittest/lib/container/test_bit_set.cpp +++ b/deps/oblib/unittest/lib/container/test_bit_set.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/container/test_bitmap.cpp b/deps/oblib/unittest/lib/container/test_bitmap.cpp index e70911494..b25d2059e 100644 --- a/deps/oblib/unittest/lib/container/test_bitmap.cpp +++ b/deps/oblib/unittest/lib/container/test_bitmap.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/deps/oblib/unittest/lib/container/test_concurrent_bitset.cpp b/deps/oblib/unittest/lib/container/test_concurrent_bitset.cpp index 7e4b593b8..33273585a 100644 --- a/deps/oblib/unittest/lib/container/test_concurrent_bitset.cpp +++ b/deps/oblib/unittest/lib/container/test_concurrent_bitset.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/container/test_ext_ring_buffer.cpp b/deps/oblib/unittest/lib/container/test_ext_ring_buffer.cpp index c9211efdb..fa180c776 100644 --- a/deps/oblib/unittest/lib/container/test_ext_ring_buffer.cpp +++ b/deps/oblib/unittest/lib/container/test_ext_ring_buffer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/container/test_iarray.cpp b/deps/oblib/unittest/lib/container/test_iarray.cpp index 75d202de8..cac09215f 100644 --- a/deps/oblib/unittest/lib/container/test_iarray.cpp +++ b/deps/oblib/unittest/lib/container/test_iarray.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/container/test_loser_tree.cpp b/deps/oblib/unittest/lib/container/test_loser_tree.cpp index 9e52036d3..bcfd46169 100644 --- a/deps/oblib/unittest/lib/container/test_loser_tree.cpp +++ b/deps/oblib/unittest/lib/container/test_loser_tree.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/container/ob_loser_tree.h" @@ -51,7 +55,7 @@ TEST_F(ObLoserTreeTest, single) int ret = 0; TestMaxComp tc; ObArenaAllocator allocator; - ObLoserTree tree(tc); + ObLoserTree tree(tc); int64_t data = 2019; // not init @@ -63,14 +67,14 @@ TEST_F(ObLoserTreeTest, single) ASSERT_TRUE(tree.is_unique_champion()); // 0 player - ret = tree.init(0, allocator); + ret = tree.init(8, 0, allocator); ASSERT_EQ(ret, OB_INVALID_ARGUMENT); // init twice - ret = tree.init(1, allocator); + ret = tree.init(8, 1, allocator); ASSERT_EQ(ret, OB_SUCCESS); ASSERT_TRUE(tree.is_unique_champion()); - ret = tree.init(1, allocator); + ret = tree.init(8, 1, allocator); ASSERT_EQ(ret, OB_INIT_TWICE); ASSERT_EQ(0, tree.count()); @@ -125,7 +129,7 @@ TEST_F(ObLoserTreeTest, multiple_players) int ret = 0; TestMaxComp tc; ObArenaAllocator allocator; - ObLoserTree tree(tc); + ObLoserTree tree(tc); const int64_t DATA_CNT = 8; int64_t data[DATA_CNT] = {1, 2, 3, 4, 5, 6, 7, 8}; @@ -133,7 +137,7 @@ TEST_F(ObLoserTreeTest, multiple_players) const int64_t *top; for (int64_t count = 1; count <= DATA_CNT; ++count) { tree.reset(); - ret = tree.init(count, allocator); + ret = tree.init(DATA_CNT, count, allocator); ASSERT_EQ(ret, OB_SUCCESS); ASSERT_TRUE(tree.empty()); for (int64_t i = 0; i < count; ++i) { @@ -156,10 +160,10 @@ TEST_F(ObLoserTreeTest, basic) int ret = 0; TestMaxComp tc; ObArenaAllocator allocator; - ObLoserTree tree(tc); + ObLoserTree tree(tc); const int64_t DATA_CNT = 7; int64_t data[DATA_CNT] = {0, 8, 12, 3, 14, 7, 5}; - ret = tree.init(DATA_CNT, allocator); + ret = tree.init(DATA_CNT, DATA_CNT, allocator); ASSERT_EQ(ret, OB_SUCCESS); for (int64_t i = 0; i < DATA_CNT; ++i) { @@ -230,10 +234,10 @@ TEST_F(ObLoserTreeTest, only_one_element) int ret = 0; TestMaxComp tc; ObArenaAllocator allocator; - ObLoserTree tree(tc); + ObLoserTree tree(tc); const int64_t DATA_CNT = 7; int64_t data[DATA_CNT] = {5, 12, 4, 3, 12, 0, 5}; - ret = tree.init(DATA_CNT, allocator); + ret = tree.init(DATA_CNT, DATA_CNT, allocator); ASSERT_EQ(ret, OB_SUCCESS); for (int64_t i = 0; i < DATA_CNT; ++i) { @@ -282,10 +286,10 @@ TEST_F(ObLoserTreeTest, unique_champion) int ret = 0; TestMaxComp tc; ObArenaAllocator allocator; - ObLoserTree tree(tc); + ObLoserTree tree(tc); const int64_t DATA_CNT = 7; int64_t data[DATA_CNT] = {4, 4, 7, 3, 12, 5, 12}; - ret = tree.init(DATA_CNT, allocator); + ret = tree.init(DATA_CNT, DATA_CNT, allocator); ASSERT_EQ(ret, OB_SUCCESS); for (int64_t i = 0; i < DATA_CNT; ++i) { diff --git a/deps/oblib/unittest/lib/container/test_paringheap.cpp b/deps/oblib/unittest/lib/container/test_paringheap.cpp index fa4b27fad..4f48fda14 100644 --- a/deps/oblib/unittest/lib/container/test_paringheap.cpp +++ b/deps/oblib/unittest/lib/container/test_paringheap.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/container/ob_paringheap.h" diff --git a/deps/oblib/unittest/lib/container/test_rbtree.cpp b/deps/oblib/unittest/lib/container/test_rbtree.cpp index 438d811c8..4c51a36e2 100644 --- a/deps/oblib/unittest/lib/container/test_rbtree.cpp +++ b/deps/oblib/unittest/lib/container/test_rbtree.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/container/ob_rbtree.h" diff --git a/deps/oblib/unittest/lib/container/test_ring_buffer.cpp b/deps/oblib/unittest/lib/container/test_ring_buffer.cpp index 7355afee6..5f53ab7ae 100644 --- a/deps/oblib/unittest/lib/container/test_ring_buffer.cpp +++ b/deps/oblib/unittest/lib/container/test_ring_buffer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/container/test_se_array.cpp b/deps/oblib/unittest/lib/container/test_se_array.cpp index 5e6b17070..53758104f 100644 --- a/deps/oblib/unittest/lib/container/test_se_array.cpp +++ b/deps/oblib/unittest/lib/container/test_se_array.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/coro/bench_local_storage.cpp b/deps/oblib/unittest/lib/coro/bench_local_storage.cpp index 1164b8b42..c99e7cb96 100644 --- a/deps/oblib/unittest/lib/coro/bench_local_storage.cpp +++ b/deps/oblib/unittest/lib/coro/bench_local_storage.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/coro/test_co_var.cpp b/deps/oblib/unittest/lib/coro/test_co_var.cpp index f1c5cae0a..6606d9d71 100644 --- a/deps/oblib/unittest/lib/coro/test_co_var.cpp +++ b/deps/oblib/unittest/lib/coro/test_co_var.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/coro/testing.h b/deps/oblib/unittest/lib/coro/testing.h index 9ae36887c..8ac3f510d 100644 --- a/deps/oblib/unittest/lib/coro/testing.h +++ b/deps/oblib/unittest/lib/coro/testing.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef CORO_TESTING_H diff --git a/deps/oblib/unittest/lib/hash/hash_benz.cpp b/deps/oblib/unittest/lib/hash/hash_benz.cpp index f766d82a9..59d46158d 100644 --- a/deps/oblib/unittest/lib/hash/hash_benz.cpp +++ b/deps/oblib/unittest/lib/hash/hash_benz.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/hash/ob_hashtable.h" diff --git a/deps/oblib/unittest/lib/hash/test_array_index_hash_set.cpp b/deps/oblib/unittest/lib/hash/test_array_index_hash_set.cpp index 3e8d4361a..49f90b3e5 100644 --- a/deps/oblib/unittest/lib/hash/test_array_index_hash_set.cpp +++ b/deps/oblib/unittest/lib/hash/test_array_index_hash_set.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "gtest/gtest.h" diff --git a/deps/oblib/unittest/lib/hash/test_build_in_hashmap.cpp b/deps/oblib/unittest/lib/hash/test_build_in_hashmap.cpp index fa1ac571b..0d1b3db3f 100644 --- a/deps/oblib/unittest/lib/hash/test_build_in_hashmap.cpp +++ b/deps/oblib/unittest/lib/hash/test_build_in_hashmap.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "gtest/gtest.h" diff --git a/deps/oblib/unittest/lib/hash/test_concurrent_hash_map_with_hazard_value.cpp b/deps/oblib/unittest/lib/hash/test_concurrent_hash_map_with_hazard_value.cpp index 4eb602875..c8c3165ca 100644 --- a/deps/oblib/unittest/lib/hash/test_concurrent_hash_map_with_hazard_value.cpp +++ b/deps/oblib/unittest/lib/hash/test_concurrent_hash_map_with_hazard_value.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "gtest/gtest.h" diff --git a/deps/oblib/unittest/lib/hash/test_cuckoo_hashmap.cpp b/deps/oblib/unittest/lib/hash/test_cuckoo_hashmap.cpp index b746f8e1c..6b9b89321 100644 --- a/deps/oblib/unittest/lib/hash/test_cuckoo_hashmap.cpp +++ b/deps/oblib/unittest/lib/hash/test_cuckoo_hashmap.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "gtest/gtest.h" diff --git a/deps/oblib/unittest/lib/hash/test_fnv_hash.cpp b/deps/oblib/unittest/lib/hash/test_fnv_hash.cpp index c036490a1..0bedc2c6e 100644 --- a/deps/oblib/unittest/lib/hash/test_fnv_hash.cpp +++ b/deps/oblib/unittest/lib/hash/test_fnv_hash.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/hash/fnv_hash.h" diff --git a/deps/oblib/unittest/lib/hash/test_hash_algorithm_performance.cpp b/deps/oblib/unittest/lib/hash/test_hash_algorithm_performance.cpp index 1c6075500..7ae0dd640 100644 --- a/deps/oblib/unittest/lib/hash/test_hash_algorithm_performance.cpp +++ b/deps/oblib/unittest/lib/hash/test_hash_algorithm_performance.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/hash/test_hashmap.cpp b/deps/oblib/unittest/lib/hash/test_hashmap.cpp index f8412f5ce..1eca7f29a 100644 --- a/deps/oblib/unittest/lib/hash/test_hashmap.cpp +++ b/deps/oblib/unittest/lib/hash/test_hashmap.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "gtest/gtest.h" @@ -290,8 +294,7 @@ TEST(TestObHashMap, set_or_update) uint64_t value = 100; CallBack callback; HashValue value_tmp; - - // 没有create + // There is no create EXPECT_EQ(OB_NOT_INIT, hm.set_or_update(key, value, callback)); hm.create(cal_next_prime(gHashItemNum), ObModIds::OB_HASH_BUCKET); @@ -316,8 +319,7 @@ TEST(TestObHashMap, erase_if) Predicate pred; HashValue value_tmp; bool is_erased = true; - - // 没有create + // There is no create EXPECT_EQ(OB_NOT_INIT, hm.erase_if(key, pred, is_erased)); hm.create(cal_next_prime(gHashItemNum), ObModIds::OB_HASH_BUCKET); diff --git a/deps/oblib/unittest/lib/hash/test_hashset.cpp b/deps/oblib/unittest/lib/hash/test_hashset.cpp index 5d68523a9..9a6bf73fd 100644 --- a/deps/oblib/unittest/lib/hash/test_hashset.cpp +++ b/deps/oblib/unittest/lib/hash/test_hashset.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/hash/ob_hashset.h" diff --git a/deps/oblib/unittest/lib/hash/test_hashutils.cpp b/deps/oblib/unittest/lib/hash/test_hashutils.cpp index 14a2d239c..22f11077e 100644 --- a/deps/oblib/unittest/lib/hash/test_hashutils.cpp +++ b/deps/oblib/unittest/lib/hash/test_hashutils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/deps/oblib/unittest/lib/hash/test_iteratable_hashmap.cpp b/deps/oblib/unittest/lib/hash/test_iteratable_hashmap.cpp index dc1bb0c60..76168f969 100644 --- a/deps/oblib/unittest/lib/hash/test_iteratable_hashmap.cpp +++ b/deps/oblib/unittest/lib/hash/test_iteratable_hashmap.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/hash/ob_iteratable_hashmap.h" diff --git a/deps/oblib/unittest/lib/hash/test_iteratable_hashset.cpp b/deps/oblib/unittest/lib/hash/test_iteratable_hashset.cpp index f0ed2bb34..c9eb5643e 100644 --- a/deps/oblib/unittest/lib/hash/test_iteratable_hashset.cpp +++ b/deps/oblib/unittest/lib/hash/test_iteratable_hashset.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/hash/ob_iteratable_hashset.h" diff --git a/deps/oblib/unittest/lib/hash/test_linear_hash_map.cpp b/deps/oblib/unittest/lib/hash/test_linear_hash_map.cpp index 4a1728698..eea9110e9 100644 --- a/deps/oblib/unittest/lib/hash/test_linear_hash_map.cpp +++ b/deps/oblib/unittest/lib/hash/test_linear_hash_map.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/deps/oblib/unittest/lib/hash/test_link_hashmap.cpp b/deps/oblib/unittest/lib/hash/test_link_hashmap.cpp index 1e5fb00d5..97d4cb953 100644 --- a/deps/oblib/unittest/lib/hash/test_link_hashmap.cpp +++ b/deps/oblib/unittest/lib/hash/test_link_hashmap.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/hash/test_ob_ref_mgr.cpp b/deps/oblib/unittest/lib/hash/test_ob_ref_mgr.cpp index 2bd47a63a..2f8ca290c 100644 --- a/deps/oblib/unittest/lib/hash/test_ob_ref_mgr.cpp +++ b/deps/oblib/unittest/lib/hash/test_ob_ref_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/hash/test_placement_hashset.cpp b/deps/oblib/unittest/lib/hash/test_placement_hashset.cpp index ed43b847b..7138bc313 100644 --- a/deps/oblib/unittest/lib/hash/test_placement_hashset.cpp +++ b/deps/oblib/unittest/lib/hash/test_placement_hashset.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "gtest/gtest.h" diff --git a/deps/oblib/unittest/lib/hash/test_pointer_hashmap.cpp b/deps/oblib/unittest/lib/hash/test_pointer_hashmap.cpp index 69b90d298..7a7cee5f7 100644 --- a/deps/oblib/unittest/lib/hash/test_pointer_hashmap.cpp +++ b/deps/oblib/unittest/lib/hash/test_pointer_hashmap.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "gtest/gtest.h" diff --git a/deps/oblib/unittest/lib/hash/test_simpleallocer.cpp b/deps/oblib/unittest/lib/hash/test_simpleallocer.cpp index 09773840a..8c312e715 100644 --- a/deps/oblib/unittest/lib/hash/test_simpleallocer.cpp +++ b/deps/oblib/unittest/lib/hash/test_simpleallocer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/hash/ob_hashtable.h" diff --git a/deps/oblib/unittest/lib/io/aio_preload.c b/deps/oblib/unittest/lib/io/aio_preload.c index 584353b06..53a73ec2e 100644 --- a/deps/oblib/unittest/lib/io/aio_preload.c +++ b/deps/oblib/unittest/lib/io/aio_preload.c @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define _GNU_SOURCE 1 diff --git a/deps/oblib/unittest/lib/json/test_json_print_utils.cpp b/deps/oblib/unittest/lib/json/test_json_print_utils.cpp index 3e978f1c7..88fa49d3b 100644 --- a/deps/oblib/unittest/lib/json/test_json_print_utils.cpp +++ b/deps/oblib/unittest/lib/json/test_json_print_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/unittest/lib/json/test_yson.cpp b/deps/oblib/unittest/lib/json/test_yson.cpp index 5af60be41..8e1ab1737 100644 --- a/deps/oblib/unittest/lib/json/test_yson.cpp +++ b/deps/oblib/unittest/lib/json/test_yson.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/list/test_atomic_list.cpp b/deps/oblib/unittest/lib/list/test_atomic_list.cpp index 6f17ef32c..3982aad47 100644 --- a/deps/oblib/unittest/lib/list/test_atomic_list.cpp +++ b/deps/oblib/unittest/lib/list/test_atomic_list.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/list/test_dlist.cpp b/deps/oblib/unittest/lib/list/test_dlist.cpp index a6993c67f..a4b3d984c 100644 --- a/deps/oblib/unittest/lib/list/test_dlist.cpp +++ b/deps/oblib/unittest/lib/list/test_dlist.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE_PT diff --git a/deps/oblib/unittest/lib/lock/test_bucket_lock.cpp b/deps/oblib/unittest/lib/lock/test_bucket_lock.cpp index 2a3bed905..60d1a18e2 100644 --- a/deps/oblib/unittest/lib/lock/test_bucket_lock.cpp +++ b/deps/oblib/unittest/lib/lock/test_bucket_lock.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "gtest/gtest.h" diff --git a/deps/oblib/unittest/lib/lock/test_latch.cpp b/deps/oblib/unittest/lib/lock/test_latch.cpp index d51f1d178..3fffc3673 100644 --- a/deps/oblib/unittest/lib/lock/test_latch.cpp +++ b/deps/oblib/unittest/lib/lock/test_latch.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "gtest/gtest.h" diff --git a/deps/oblib/unittest/lib/lock/test_qsync_lock.cpp b/deps/oblib/unittest/lib/lock/test_qsync_lock.cpp index a3e2d85c2..3aa1884bd 100644 --- a/deps/oblib/unittest/lib/lock/test_qsync_lock.cpp +++ b/deps/oblib/unittest/lib/lock/test_qsync_lock.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/lock/test_scond.cpp b/deps/oblib/unittest/lib/lock/test_scond.cpp index d3ba660ff..63f7484e9 100644 --- a/deps/oblib/unittest/lib/lock/test_scond.cpp +++ b/deps/oblib/unittest/lib/lock/test_scond.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/lock/test_thread_cond.cpp b/deps/oblib/unittest/lib/lock/test_thread_cond.cpp index abf9f02d5..4aac4694e 100644 --- a/deps/oblib/unittest/lib/lock/test_thread_cond.cpp +++ b/deps/oblib/unittest/lib/lock/test_thread_cond.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/metrics/test_ema_v2.cpp b/deps/oblib/unittest/lib/metrics/test_ema_v2.cpp index eedd2d1c4..aa5713b62 100644 --- a/deps/oblib/unittest/lib/metrics/test_ema_v2.cpp +++ b/deps/oblib/unittest/lib/metrics/test_ema_v2.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/utility/utility.h" diff --git a/deps/oblib/unittest/lib/metrics/test_ob_accumulator.cpp b/deps/oblib/unittest/lib/metrics/test_ob_accumulator.cpp index 870edb6e9..9506a41a3 100644 --- a/deps/oblib/unittest/lib/metrics/test_ob_accumulator.cpp +++ b/deps/oblib/unittest/lib/metrics/test_ob_accumulator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/metrics/ob_accumulator.h" diff --git a/deps/oblib/unittest/lib/net/test_ob_addr.cpp b/deps/oblib/unittest/lib/net/test_ob_addr.cpp index 9af28399f..ed3e3169f 100644 --- a/deps/oblib/unittest/lib/net/test_ob_addr.cpp +++ b/deps/oblib/unittest/lib/net/test_ob_addr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/net/test_ob_net_util.cpp b/deps/oblib/unittest/lib/net/test_ob_net_util.cpp index 1c0b02afa..a2c452059 100644 --- a/deps/oblib/unittest/lib/net/test_ob_net_util.cpp +++ b/deps/oblib/unittest/lib/net/test_ob_net_util.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/number/test_number_v2.cpp b/deps/oblib/unittest/lib/number/test_number_v2.cpp index fba25c8c2..aaac19276 100644 --- a/deps/oblib/unittest/lib/number/test_number_v2.cpp +++ b/deps/oblib/unittest/lib/number/test_number_v2.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/utility/utility.h" @@ -946,8 +950,7 @@ TEST(ObNumberParseHelper, from_format) ret = nph.fill("888888888888888888888888888"); EXPECT_EQ(OB_SUCCESS, ret); EXPECT_STREQ("888888888888888888888888888", format(nph.number_, 0)); - - //代码中限制补零的个数为60为上限,否则报4002错误,所以下面的执行format后,返回错误码为4002 + // The code limits the number of zeros to be padded to a maximum of 60, otherwise it returns error code 4002, so after the following execution of format, the error code returned is 4002 //ret = nph.fill("0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"); //EXPECT_EQ(OB_SUCCESS, ret); //EXPECT_STREQ("0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", format(nph.number_, 135)); @@ -2067,8 +2070,7 @@ TEST(ObNumberCalc, div) DIV("1", "3000000000", "0.000000000333333333333333333333333333333333333333333333", 54); DIV("1", "3000000000000000000", "0.000000000000000000333333333333333333333333333333333333333333333", 63); DIV("1", "3000000000000000000000000000", "0.000000000000000000000000000333333333333333333333333333333333333333333333", 72); - - //代码中限制补零的个数为60为上限,否则报4002错误,所以下面的执行format后,返回错误码为4002 + // The code limits the number of zeros to be padded to a maximum of 60, otherwise it returns error code 4002, so after the following execution of format, the error code returned is 4002 //DIV("1", // "300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", // "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003333333333333333333333333333333333333", 171); diff --git a/deps/oblib/unittest/lib/objectpool/test_small_obj_pool.cpp b/deps/oblib/unittest/lib/objectpool/test_small_obj_pool.cpp index 96ef40e34..723d78649 100644 --- a/deps/oblib/unittest/lib/objectpool/test_small_obj_pool.cpp +++ b/deps/oblib/unittest/lib/objectpool/test_small_obj_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/oblog/test_base_log_buffer.cpp b/deps/oblib/unittest/lib/oblog/test_base_log_buffer.cpp index a8c05e7ba..f5aa4fb4a 100644 --- a/deps/oblib/unittest/lib/oblog/test_base_log_buffer.cpp +++ b/deps/oblib/unittest/lib/oblog/test_base_log_buffer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/oblog/test_base_log_writer.cpp b/deps/oblib/unittest/lib/oblog/test_base_log_writer.cpp index b05cb95cc..3e91cc16e 100644 --- a/deps/oblib/unittest/lib/oblog/test_base_log_writer.cpp +++ b/deps/oblib/unittest/lib/oblog/test_base_log_writer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/oblog/test_ob_log_compressor.cpp b/deps/oblib/unittest/lib/oblog/test_ob_log_compressor.cpp index 0efcdcdd0..f5c29c583 100644 --- a/deps/oblib/unittest/lib/oblog/test_ob_log_compressor.cpp +++ b/deps/oblib/unittest/lib/oblog/test_ob_log_compressor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -309,15 +313,11 @@ TEST(ObLogCompressor, syslog_compressor_thread_test) const char *pattern_uncompressed[OB_SYSLOG_COMPRESS_TYPE_COUNT] = { "^observer\\.log\\.[0-9]+$", - "^rootservice\\.log\\.[0-9]+$", - "^election\\.log\\.[0-9]+$", "^trace\\.log\\.[0-9]+$", }; const char *pattern_compressed[OB_SYSLOG_COMPRESS_TYPE_COUNT] = { "^observer\\.log\\.[0-9]+\\.[a-z]+$", - "^rootservice\\.log\\.[0-9]+\\.[a-z]+$", - "^election\\.log\\.[0-9]+\\.[a-z]+$", "^trace\\.log\\.[0-9]+\\.[a-z]+$", }; diff --git a/deps/oblib/unittest/lib/oblog/test_ob_log_dba.cpp b/deps/oblib/unittest/lib/oblog/test_ob_log_dba.cpp index 5e4c2c862..49f029c3c 100644 --- a/deps/oblib/unittest/lib/oblog/test_ob_log_dba.cpp +++ b/deps/oblib/unittest/lib/oblog/test_ob_log_dba.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB @@ -42,47 +46,48 @@ TEST(ObDbaLog, basic_test) ObClockGenerator *data_obj_ptr = (ObClockGenerator*)0x7fc1d30996d0; // do not access this addr const ObClockGenerator *data_obj_null = NULL; ASSERT_EQ(OB_SUCCESS, logdata_print_value(buf, len, pos, data_enum)); - ASSERT_STREQ(buf, "5"); + ASSERT_STREQ(buf, "3"); ASSERT_EQ(pos, 1); + pos = 0; ASSERT_EQ(OB_SUCCESS, logdata_print_value(buf, len, pos, data_uint8)); - ASSERT_EQ(pos, 2); - ASSERT_STREQ(buf, "52"); + ASSERT_EQ(pos, 1); + ASSERT_STREQ(buf, "2"); ASSERT_EQ(OB_SUCCESS, logdata_print_value(buf, len, pos, data_uint16)); - ASSERT_EQ(pos, 4); - ASSERT_STREQ(buf, "5233"); + ASSERT_EQ(pos, 3); + ASSERT_STREQ(buf, "233"); ASSERT_EQ(OB_SUCCESS, logdata_print_value(buf, len, pos, data_int32)); - ASSERT_EQ(pos, 8); - ASSERT_STREQ(buf, "5233-444"); + ASSERT_EQ(pos, 7); + ASSERT_STREQ(buf, "233-444"); ASSERT_EQ(OB_SUCCESS, logdata_print_value(buf, len, pos, data_int64)); - ASSERT_EQ(pos, 12); - ASSERT_STREQ(buf, "5233-4445555"); + ASSERT_EQ(pos, 11); + ASSERT_STREQ(buf, "233-4445555"); ASSERT_EQ(OB_SUCCESS, logdata_print_value(buf, len, pos, data_char)); - ASSERT_EQ(pos, 13); - ASSERT_STREQ(buf, "5233-4445555@"); + ASSERT_EQ(pos, 12); + ASSERT_STREQ(buf, "233-4445555@"); ASSERT_EQ(OB_SUCCESS, logdata_print_value(buf, len, pos, data_float)); - ASSERT_EQ(pos, 28); - ASSERT_STREQ(buf, "5233-4445555@3.141592503e+00"); + ASSERT_EQ(pos, 27); + ASSERT_STREQ(buf, "233-4445555@3.141592503e+00"); ASSERT_EQ(OB_SUCCESS, logdata_print_value(buf, len, pos, data_double)); - ASSERT_EQ(pos, 52); - ASSERT_STREQ(buf, "5233-4445555@3.141592503e+002.332330000000000041e+02"); + ASSERT_EQ(pos, 51); + ASSERT_STREQ(buf, "233-4445555@3.141592503e+002.332330000000000041e+02"); ASSERT_EQ(OB_SUCCESS, logdata_print_value(buf, len, pos, data_bool)); - ASSERT_EQ(pos, 57); - ASSERT_STREQ(buf, "5233-4445555@3.141592503e+002.332330000000000041e+02false"); + ASSERT_EQ(pos, 56); + ASSERT_STREQ(buf, "233-4445555@3.141592503e+002.332330000000000041e+02false"); ASSERT_EQ(OB_SUCCESS, logdata_print_value(buf, len, pos, data_str)); - ASSERT_EQ(pos, 63); - ASSERT_STREQ(buf, "5233-4445555@3.141592503e+002.332330000000000041e+02falsehello "); + ASSERT_EQ(pos, 62); + ASSERT_STREQ(buf, "233-4445555@3.141592503e+002.332330000000000041e+02falsehello "); ASSERT_EQ(OB_SUCCESS, logdata_print_value(buf, len, pos, data_const_str)); - ASSERT_EQ(pos, 70); - ASSERT_STREQ(buf, "5233-4445555@3.141592503e+002.332330000000000041e+02falsehello world! "); + ASSERT_EQ(pos, 69); + ASSERT_STREQ(buf, "233-4445555@3.141592503e+002.332330000000000041e+02falsehello world! "); ASSERT_EQ(OB_SUCCESS, logdata_print_value(buf, len, pos, data_null)); - ASSERT_EQ(pos, 74); - ASSERT_STREQ(buf, "5233-4445555@3.141592503e+002.332330000000000041e+02falsehello world! NULL"); + ASSERT_EQ(pos, 73); + ASSERT_STREQ(buf, "233-4445555@3.141592503e+002.332330000000000041e+02falsehello world! NULL"); ASSERT_EQ(OB_SUCCESS, logdata_print_value(buf, len, pos, data_obj_ptr)); - ASSERT_EQ(pos, 88); - ASSERT_STREQ(buf, "5233-4445555@3.141592503e+002.332330000000000041e+02falsehello world! NULL0x7fc1d30996d0"); + ASSERT_EQ(pos, 87); + ASSERT_STREQ(buf, "233-4445555@3.141592503e+002.332330000000000041e+02falsehello world! NULL0x7fc1d30996d0"); ASSERT_EQ(OB_SUCCESS, logdata_print_value(buf, len, pos, data_obj_null)); - ASSERT_EQ(pos, 92); - ASSERT_STREQ(buf, "5233-4445555@3.141592503e+002.332330000000000041e+02falsehello world! NULL0x7fc1d30996d0NULL"); + ASSERT_EQ(pos, 91); + ASSERT_STREQ(buf, "233-4445555@3.141592503e+002.332330000000000041e+02falsehello world! NULL0x7fc1d30996d0NULL"); } TEST(ObDbaLog, test_1) diff --git a/deps/oblib/unittest/lib/oblog/test_ob_log_obj.cpp b/deps/oblib/unittest/lib/oblog/test_ob_log_obj.cpp index ee131f971..186efcfd0 100644 --- a/deps/oblib/unittest/lib/oblog/test_ob_log_obj.cpp +++ b/deps/oblib/unittest/lib/oblog/test_ob_log_obj.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/oblog/test_ob_log_performance.cpp b/deps/oblib/unittest/lib/oblog/test_ob_log_performance.cpp index 750b68a7d..12d0ddd70 100644 --- a/deps/oblib/unittest/lib/oblog/test_ob_log_performance.cpp +++ b/deps/oblib/unittest/lib/oblog/test_ob_log_performance.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -92,7 +96,7 @@ void ObLoggerTest::run_test() { int ret = 0; system("rm -rf s_log.log*"); - OB_LOGGER.set_log_level("TRACE", "WARN"); + OB_LOGGER.set_log_level("TRACE"); OB_LOGGER.set_enable_async_log(false); //OB_LOGGER.set_max_file_size(BIG_LOG_FILE_SIZE); OB_LOGGER.set_file_name("s_log.log", false, true); @@ -110,7 +114,7 @@ void ObLoggerTest::run_test_t() { int ret = 0; system("rm -rf t_log.log*"); - OB_LOGGER.set_log_level("TRACE", "WARN"); + OB_LOGGER.set_log_level("TRACE"); OB_LOGGER.set_enable_async_log(false); //OB_LOGGER.set_max_file_size(BIG_LOG_FILE_SIZE); OB_LOGGER.set_file_name("t_log.log", false, true); @@ -127,7 +131,7 @@ void ObLoggerTest::run_test_async() { int ret = 0; system("rm -rf async_log.log*"); - OB_LOGGER.set_log_level("TRACE", "WARN"); + OB_LOGGER.set_log_level("TRACE"); //OB_LOGGER.set_max_file_size(BIG_LOG_FILE_SIZE); OB_LOGGER.set_file_name("async_log.log", true, true); OB_LOGGER.set_enable_async_log(true); @@ -148,7 +152,7 @@ void ObLoggerTest::run_test_async_multi() { int ret = 0; system("rm -rf async_multi_log.log*"); - OB_LOGGER.set_log_level("TRACE", "WARN"); + OB_LOGGER.set_log_level("TRACE"); //OB_LOGGER.set_max_file_size(BIG_LOG_FILE_SIZE); OB_LOGGER.set_file_name("async_multi_log.log", false, true); OB_LOGGER.set_enable_async_log(true); @@ -170,7 +174,7 @@ void ObLoggerTest::run_test_t_async() { int ret = 0; system("rm -rf t_async_log.log*"); - OB_LOGGER.set_log_level("TRACE", "WARN"); + OB_LOGGER.set_log_level("TRACE"); OB_LOGGER.set_enable_async_log(true); OB_LOGGER.set_use_multi_flush(false); //OB_LOGGER.set_max_file_size(BIG_LOG_FILE_SIZE); @@ -188,7 +192,7 @@ void ObLoggerTest::run_test_t_async_multi() { int ret = 0; system("rm -rf t_async_multi_log.log*"); - OB_LOGGER.set_log_level("TRACE", "WARN"); + OB_LOGGER.set_log_level("TRACE"); OB_LOGGER.set_enable_async_log(true); OB_LOGGER.set_use_multi_flush(true); //OB_LOGGER.set_max_file_size(BIG_LOG_FILE_SIZE); diff --git a/deps/oblib/unittest/lib/orc/test_orc.cpp b/deps/oblib/unittest/lib/orc/test_orc.cpp index 503b0ac6f..7485d8f8e 100644 --- a/deps/oblib/unittest/lib/orc/test_orc.cpp +++ b/deps/oblib/unittest/lib/orc/test_orc.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL @@ -600,4 +604,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); testing::InitGoogleTest(&argc,argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/deps/oblib/unittest/lib/parquet/test_parquet.cpp b/deps/oblib/unittest/lib/parquet/test_parquet.cpp index d2d51a93e..374a772b0 100644 --- a/deps/oblib/unittest/lib/parquet/test_parquet.cpp +++ b/deps/oblib/unittest/lib/parquet/test_parquet.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL diff --git a/deps/oblib/unittest/lib/profile/test_ob_trace_id.cpp b/deps/oblib/unittest/lib/profile/test_ob_trace_id.cpp index 780f8d942..2996ee7af 100644 --- a/deps/oblib/unittest/lib/profile/test_ob_trace_id.cpp +++ b/deps/oblib/unittest/lib/profile/test_ob_trace_id.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/queue/test_fixed_queue.cpp b/deps/oblib/unittest/lib/queue/test_fixed_queue.cpp index d8b77856f..06d1de822 100644 --- a/deps/oblib/unittest/lib/queue/test_fixed_queue.cpp +++ b/deps/oblib/unittest/lib/queue/test_fixed_queue.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/queue/ob_fixed_queue.h" diff --git a/deps/oblib/unittest/lib/queue/test_lighty_queue.cpp b/deps/oblib/unittest/lib/queue/test_lighty_queue.cpp index f5d64f9f5..b2884df5b 100644 --- a/deps/oblib/unittest/lib/queue/test_lighty_queue.cpp +++ b/deps/oblib/unittest/lib/queue/test_lighty_queue.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "test_lighty_queue.h" diff --git a/deps/oblib/unittest/lib/queue/test_lighty_queue.h b/deps/oblib/unittest/lib/queue/test_lighty_queue.h index 0b07ca079..69ce8ad64 100644 --- a/deps/oblib/unittest/lib/queue/test_lighty_queue.h +++ b/deps/oblib/unittest/lib/queue/test_lighty_queue.h @@ -1,15 +1,19 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/queue/ob_lighty_queue.h" -using oceanbase::common::ObLightyQueue; \ No newline at end of file +using oceanbase::common::ObLightyQueue; diff --git a/deps/oblib/unittest/lib/queue/test_link_queue.cpp b/deps/oblib/unittest/lib/queue/test_link_queue.cpp index f56e2a77d..9a80f6143 100644 --- a/deps/oblib/unittest/lib/queue/test_link_queue.cpp +++ b/deps/oblib/unittest/lib/queue/test_link_queue.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/objectpool/ob_concurrency_objpool.h" diff --git a/deps/oblib/unittest/lib/queue/test_priority_queue.cpp b/deps/oblib/unittest/lib/queue/test_priority_queue.cpp index 0abba084e..1ceed8072 100644 --- a/deps/oblib/unittest/lib/queue/test_priority_queue.cpp +++ b/deps/oblib/unittest/lib/queue/test_priority_queue.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/random/test_mysql_random.cpp b/deps/oblib/unittest/lib/random/test_mysql_random.cpp index 7ca0876aa..15af74124 100644 --- a/deps/oblib/unittest/lib/random/test_mysql_random.cpp +++ b/deps/oblib/unittest/lib/random/test_mysql_random.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/random/test_random.cpp b/deps/oblib/unittest/lib/random/test_random.cpp index cb531686f..136333678 100644 --- a/deps/oblib/unittest/lib/random/test_random.cpp +++ b/deps/oblib/unittest/lib/random/test_random.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/rc/test_context.cpp b/deps/oblib/unittest/lib/rc/test_context.cpp index 617ae9a9a..36b06d2fc 100644 --- a/deps/oblib/unittest/lib/rc/test_context.cpp +++ b/deps/oblib/unittest/lib/rc/test_context.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE @@ -262,7 +266,6 @@ TEST_F(TestContext, PM_Wash) ASSERT_FALSE(req_cache_empty(ta.ref_allocator())); ta->set_limit(ta->get_hold()); ASSERT_NE(ob_malloc(OB_MALLOC_BIG_BLOCK_SIZE, attr), nullptr); - ASSERT_TRUE(req_cache_empty(ta.ref_allocator())); } } diff --git a/deps/oblib/unittest/lib/resource/test_affinity_ctrl.cpp b/deps/oblib/unittest/lib/resource/test_affinity_ctrl.cpp index 9192fa70b..76962a1ea 100644 --- a/deps/oblib/unittest/lib/resource/test_affinity_ctrl.cpp +++ b/deps/oblib/unittest/lib/resource/test_affinity_ctrl.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/resource/test_resource_mgr.cpp b/deps/oblib/unittest/lib/resource/test_resource_mgr.cpp index ce41f7c9b..a4f47831a 100644 --- a/deps/oblib/unittest/lib/resource/test_resource_mgr.cpp +++ b/deps/oblib/unittest/lib/resource/test_resource_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -24,6 +28,7 @@ TEST(TestTenantMemoryMgr, basic) ObTenantMemoryMgr memory_mgr(1); const int64_t limit = 1 * 1024 * 1024 * 1024; memory_mgr.set_limit(limit); + memory_mgr.set_hard_limit(limit); ASSERT_TRUE(NULL == memory_mgr.alloc_chunk(-1, ObMemAttr())); ObMemAttr attr; attr.tenant_id_ = 2; @@ -190,6 +195,7 @@ TEST(TestTenantMemoryMgr, sync_wash) chunks.reserve(512); const int64_t tenant_limit = 2 * limit; memory_mgr.set_limit(tenant_limit); + memory_mgr.set_hard_limit(tenant_limit); int64_t mb_count = 0; while (OB_SUCC(washer.alloc_mb(memory_mgr))) { ++mb_count; diff --git a/deps/oblib/unittest/lib/restore/test_common_storage.cpp b/deps/oblib/unittest/lib/restore/test_common_storage.cpp index 7418829e8..83dafcda4 100644 --- a/deps/oblib/unittest/lib/restore/test_common_storage.cpp +++ b/deps/oblib/unittest/lib/restore/test_common_storage.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "test_common_storage.h" #include "test_common_storage_util.h" @@ -1452,4 +1456,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("DEBUG"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/deps/oblib/unittest/lib/restore/test_common_storage.h b/deps/oblib/unittest/lib/restore/test_common_storage.h index e1a60ad9d..251559fa7 100644 --- a/deps/oblib/unittest/lib/restore/test_common_storage.h +++ b/deps/oblib/unittest/lib/restore/test_common_storage.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef TEST_STORAGE_COMMON_STORAGE_H_ #define TEST_STORAGE_COMMON_STORAGE_H_ @@ -152,4 +156,4 @@ struct ObTestStorageMeta } // end of oceanbase -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/unittest/lib/restore/test_common_storage_util.h b/deps/oblib/unittest/lib/restore/test_common_storage_util.h index 4f5513049..91fff6ef8 100644 --- a/deps/oblib/unittest/lib/restore/test_common_storage_util.h +++ b/deps/oblib/unittest/lib/restore/test_common_storage_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef TEST_STORAGE_COMMON_STORAGE_UTIL_H_ @@ -147,4 +151,4 @@ int TestCommonStorageUtil::gen_fs_uri( } -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/unittest/lib/restore/test_object_storage.cpp b/deps/oblib/unittest/lib/restore/test_object_storage.cpp index 06853fa56..1830ffce9 100644 --- a/deps/oblib/unittest/lib/restore/test_object_storage.cpp +++ b/deps/oblib/unittest/lib/restore/test_object_storage.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -705,11 +709,10 @@ TEST_F(TestObjectStorage, test_util_list_adaptive_files) ASSERT_EQ(OB_SUCCESS, appender.close()); } }; - - // 文件层级 - // 第一级:0-normal, 0-appendable, 0-appendable.back .... 9-normal, 9-appendable, 9-appendable.back - // 第二级:0/0-normal, 0/0-appendable, 0/0-appendable.back, ... 9/9-normal, 9/9-appendable, 9/9-appendable.back - // 第三级:0/0/0-normal, 0/0/0-appendable, 0/0/0-appendable.back, ... 9/4/4-normal, 9/4/4-appendable, 9/4/4-appendable.back、 + // file hierarchy + // First level: 0-normal, 0-appendable, 0-appendable.back .... 9-normal, 9-appendable, 9-appendable.back + // Second level: 0/0-normal, 0/0-appendable, 0/0-appendable.back, ... 9/9-normal, 9/9-appendable, 9/9-appendable.back + // Third level: 0/0/0-normal, 0/0/0-appendable, 0/0/0-appendable.back, ... 9/4/4-normal, 9/4/4-appendable, 9/4/4-appendable.back, write_group_files(10, ""); std::string prefix; for (int64_t i = 0; i < 10; i++) { @@ -1157,8 +1160,7 @@ TEST_F(TestObjectStorage, test_append_rw) } } } - -// 写入一个模拟追加写文件,包含一个format文件和500个数据文件,共501个子文件 +// Write a simulated append write file, including one format file and 500 data files, totaling 501 sub-files int write_appendable_object(const char *obj_name, ObObjectStorageInfo &storage_info) { int ret = OB_SUCCESS; @@ -1535,4 +1537,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("DEBUG"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/deps/oblib/unittest/lib/restore/test_object_storage.h b/deps/oblib/unittest/lib/restore/test_object_storage.h index 451911928..d7e7d0920 100644 --- a/deps/oblib/unittest/lib/restore/test_object_storage.h +++ b/deps/oblib/unittest/lib/restore/test_object_storage.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef TEST_OBJECT_STORAGE_H_ @@ -22,4 +26,4 @@ const char *region = "xxx"; const char *appid = "xxx"; const char *extension = nullptr; -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/unittest/lib/restore/test_storage.cpp b/deps/oblib/unittest/lib/restore/test_storage.cpp index 3dbda413b..68a99c269 100644 --- a/deps/oblib/unittest/lib/restore/test_storage.cpp +++ b/deps/oblib/unittest/lib/restore/test_storage.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/restore/test_storage_cos.cpp b/deps/oblib/unittest/lib/restore/test_storage_cos.cpp index caae6197e..7d8b09695 100644 --- a/deps/oblib/unittest/lib/restore/test_storage_cos.cpp +++ b/deps/oblib/unittest/lib/restore/test_storage_cos.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -713,4 +717,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/deps/oblib/unittest/lib/restore/test_storage_cos.h b/deps/oblib/unittest/lib/restore/test_storage_cos.h index 6f3ad9322..3477e1027 100644 --- a/deps/oblib/unittest/lib/restore/test_storage_cos.h +++ b/deps/oblib/unittest/lib/restore/test_storage_cos.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef TEST_STORAGE_COS_H_ @@ -20,4 +24,4 @@ const char *secretid = "xxx"; const char *secretkey = "xxx"; const char *appid = "xxx"; -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/unittest/lib/restore/test_storage_info.cpp b/deps/oblib/unittest/lib/restore/test_storage_info.cpp index c95c4552f..2017605e8 100644 --- a/deps/oblib/unittest/lib/restore/test_storage_info.cpp +++ b/deps/oblib/unittest/lib/restore/test_storage_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -213,4 +217,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/deps/oblib/unittest/lib/restore/test_storage_oss.cpp b/deps/oblib/unittest/lib/restore/test_storage_oss.cpp index e756acb32..67af67c17 100644 --- a/deps/oblib/unittest/lib/restore/test_storage_oss.cpp +++ b/deps/oblib/unittest/lib/restore/test_storage_oss.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/restore/test_storage_s3.cpp b/deps/oblib/unittest/lib/restore/test_storage_s3.cpp index bed899517..0d327cfde 100644 --- a/deps/oblib/unittest/lib/restore/test_storage_s3.cpp +++ b/deps/oblib/unittest/lib/restore/test_storage_s3.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -1099,4 +1103,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("DEBUG"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/deps/oblib/unittest/lib/restore/test_storage_s3.h b/deps/oblib/unittest/lib/restore/test_storage_s3.h index bfb4a377b..8e16bde8e 100644 --- a/deps/oblib/unittest/lib/restore/test_storage_s3.h +++ b/deps/oblib/unittest/lib/restore/test_storage_s3.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef TEST_STORAGE_S3_H_ @@ -21,4 +25,4 @@ const char *endpoint = "xxx"; const char *secretid = "xxx"; const char *secretkey = "xxx"; -#endif \ No newline at end of file +#endif diff --git a/deps/oblib/unittest/lib/stat/test_di_cache.cpp b/deps/oblib/unittest/lib/stat/test_di_cache.cpp index 0181b8f63..f22bf9f76 100644 --- a/deps/oblib/unittest/lib/stat/test_di_cache.cpp +++ b/deps/oblib/unittest/lib/stat/test_di_cache.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/stat/test_diagnose_info.cpp b/deps/oblib/unittest/lib/stat/test_diagnose_info.cpp index 350a155ea..459e0e4f3 100644 --- a/deps/oblib/unittest/lib/stat/test_diagnose_info.cpp +++ b/deps/oblib/unittest/lib/stat/test_diagnose_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/stat/test_diagnostic_info.cpp b/deps/oblib/unittest/lib/stat/test_diagnostic_info.cpp index 180ce60f7..c53ab71bb 100644 --- a/deps/oblib/unittest/lib/stat/test_diagnostic_info.cpp +++ b/deps/oblib/unittest/lib/stat/test_diagnostic_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON diff --git a/deps/oblib/unittest/lib/stat/test_stat_memory.cpp b/deps/oblib/unittest/lib/stat/test_stat_memory.cpp index 8ba7bbb2f..04b821aa7 100644 --- a/deps/oblib/unittest/lib/stat/test_stat_memory.cpp +++ b/deps/oblib/unittest/lib/stat/test_stat_memory.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/stat/test_stat_template.cpp b/deps/oblib/unittest/lib/stat/test_stat_template.cpp index 5009efcce..e39d00c99 100644 --- a/deps/oblib/unittest/lib/stat/test_stat_template.cpp +++ b/deps/oblib/unittest/lib/stat/test_stat_template.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/string/test_fixed_length_string.cpp b/deps/oblib/unittest/lib/string/test_fixed_length_string.cpp index bed5b12ea..7bb988552 100644 --- a/deps/oblib/unittest/lib/string/test_fixed_length_string.cpp +++ b/deps/oblib/unittest/lib/string/test_fixed_length_string.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/unittest/lib/task/test_cancel_task.cpp b/deps/oblib/unittest/lib/task/test_cancel_task.cpp index 3b819102e..dd1f8788d 100644 --- a/deps/oblib/unittest/lib/task/test_cancel_task.cpp +++ b/deps/oblib/unittest/lib/task/test_cancel_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/task/test_timer.cpp b/deps/oblib/unittest/lib/task/test_timer.cpp index d0ed901fa..722dcadc1 100644 --- a/deps/oblib/unittest/lib/task/test_timer.cpp +++ b/deps/oblib/unittest/lib/task/test_timer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/test_fixed_array.cpp b/deps/oblib/unittest/lib/test_fixed_array.cpp index a0e6d26e5..f1032f448 100644 --- a/deps/oblib/unittest/lib/test_fixed_array.cpp +++ b/deps/oblib/unittest/lib/test_fixed_array.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/test_work_queue.cpp b/deps/oblib/unittest/lib/test_work_queue.cpp index 20b07575e..caaeb685b 100644 --- a/deps/oblib/unittest/lib/test_work_queue.cpp +++ b/deps/oblib/unittest/lib/test_work_queue.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/thread/ob_work_queue.h" diff --git a/deps/oblib/unittest/lib/test_worker.cpp b/deps/oblib/unittest/lib/test_worker.cpp index d1f0d163e..5d69ccd02 100644 --- a/deps/oblib/unittest/lib/test_worker.cpp +++ b/deps/oblib/unittest/lib/test_worker.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/thread/test_dynamic_thread_pool.cpp b/deps/oblib/unittest/lib/thread/test_dynamic_thread_pool.cpp index 5ecbb0124..b09bcccb0 100644 --- a/deps/oblib/unittest/lib/thread/test_dynamic_thread_pool.cpp +++ b/deps/oblib/unittest/lib/thread/test_dynamic_thread_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/thread/ob_dynamic_thread_pool.h" diff --git a/deps/oblib/unittest/lib/thread/test_protected_stack_allocator.cpp b/deps/oblib/unittest/lib/thread/test_protected_stack_allocator.cpp index 78229e2c0..42be845bf 100644 --- a/deps/oblib/unittest/lib/thread/test_protected_stack_allocator.cpp +++ b/deps/oblib/unittest/lib/thread/test_protected_stack_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/thread/test_simple_thread_pool.cpp b/deps/oblib/unittest/lib/thread/test_simple_thread_pool.cpp index 089e66e4d..ac3dd4574 100644 --- a/deps/oblib/unittest/lib/thread/test_simple_thread_pool.cpp +++ b/deps/oblib/unittest/lib/thread/test_simple_thread_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/thread/test_tg_mgr.cpp b/deps/oblib/unittest/lib/thread/test_tg_mgr.cpp index 0a68ea33d..17cc7d844 100644 --- a/deps/oblib/unittest/lib/thread/test_tg_mgr.cpp +++ b/deps/oblib/unittest/lib/thread/test_tg_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/thread/test_thread_lease.cpp b/deps/oblib/unittest/lib/thread/test_thread_lease.cpp index 483ca9e47..e4fc36419 100644 --- a/deps/oblib/unittest/lib/thread/test_thread_lease.cpp +++ b/deps/oblib/unittest/lib/thread/test_thread_lease.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/thread/ob_thread_lease.h" @@ -50,8 +54,7 @@ TEST_F(TestObThreadLease, smoke_test) ASSERT_EQ(ObThreadLease::HANDLING, lease.value()); ASSERT_EQ(true, lease.revoke()); ASSERT_EQ(ObThreadLease::IDLE, lease.value()); - - // 直接revoke,期望返回成功 + // Directly revoke, expect to return success ASSERT_EQ(true, lease.revoke()); ASSERT_EQ(ObThreadLease::IDLE, lease.value()); } @@ -64,36 +67,28 @@ TEST_F(TestObThreadLease, simulate_multi_thread) for (int64_t i = 0; i < 100; i++) { ASSERT_EQ(true, lease.acquire()); ASSERT_EQ(ObThreadLease::HANDLING, lease.value()); - - // 再次acquire,期望失败,状态变更为READY + // acquire again, expect failure, status change to READY ASSERT_EQ(false, lease.acquire()); ASSERT_EQ(ObThreadLease::READY, lease.value()); - - // 再次acquire,期望失败,状态变更为READY + // acquire again, expect failure, status change to READY ASSERT_EQ(false, lease.acquire()); ASSERT_EQ(ObThreadLease::READY, lease.value()); - - // 再次acquire,期望失败,状态变更为READY + // acquire again, expect failure, status change to READY ASSERT_EQ(false, lease.acquire()); ASSERT_EQ(ObThreadLease::READY, lease.value()); - - // revoke一次,期望失败,状态变更为HANDLING + // revoke once, expect failure, status change to HANDLING ASSERT_EQ(false, lease.revoke()); ASSERT_EQ(ObThreadLease::HANDLING, lease.value()); - - // 再次acquire,期望失败,状态变更为READY + // acquire again, expect failure, status change to READY ASSERT_EQ(false, lease.acquire()); ASSERT_EQ(ObThreadLease::READY, lease.value()); - - // 再次acquire,期望失败,状态变更为READY + // acquire again, expect failure, status change to READY ASSERT_EQ(false, lease.acquire()); ASSERT_EQ(ObThreadLease::READY, lease.value()); - - // revoke一次,期望失败,状态变更为HANDLING + // revoke once, expect failure, status changes to HANDLING ASSERT_EQ(false, lease.revoke()); ASSERT_EQ(ObThreadLease::HANDLING, lease.value()); - - // 再次revoke,期望成功,状态变更为IDLE + // Again revoke, expect success, status change to IDLE ASSERT_EQ(true, lease.revoke()); ASSERT_EQ(ObThreadLease::IDLE, lease.value()); } diff --git a/deps/oblib/unittest/lib/thread/test_thread_pool.cpp b/deps/oblib/unittest/lib/thread/test_thread_pool.cpp index 77f3b3a8c..07608755d 100644 --- a/deps/oblib/unittest/lib/thread/test_thread_pool.cpp +++ b/deps/oblib/unittest/lib/thread/test_thread_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/thread/test_threads.cpp b/deps/oblib/unittest/lib/thread/test_threads.cpp index 12df3830a..6e2701ff0 100644 --- a/deps/oblib/unittest/lib/thread/test_threads.cpp +++ b/deps/oblib/unittest/lib/thread/test_threads.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/thread_local/test_itid.cpp b/deps/oblib/unittest/lib/thread_local/test_itid.cpp index 0d75d4b1d..67a00a278 100644 --- a/deps/oblib/unittest/lib/thread_local/test_itid.cpp +++ b/deps/oblib/unittest/lib/thread_local/test_itid.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/thread_local/test_tsi.cpp b/deps/oblib/unittest/lib/thread_local/test_tsi.cpp index c9de4c5cf..09832fdad 100644 --- a/deps/oblib/unittest/lib/thread_local/test_tsi.cpp +++ b/deps/oblib/unittest/lib/thread_local/test_tsi.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/time/test_ob_time_utility.cpp b/deps/oblib/unittest/lib/time/test_ob_time_utility.cpp index 38d9b8bf1..902401791 100644 --- a/deps/oblib/unittest/lib/time/test_ob_time_utility.cpp +++ b/deps/oblib/unittest/lib/time/test_ob_time_utility.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/time/test_ob_tsc_timestamp.cpp b/deps/oblib/unittest/lib/time/test_ob_tsc_timestamp.cpp index b37dda787..5de44c590 100644 --- a/deps/oblib/unittest/lib/time/test_ob_tsc_timestamp.cpp +++ b/deps/oblib/unittest/lib/time/test_ob_tsc_timestamp.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/timezone/test_ob_time_convert.cpp b/deps/oblib/unittest/lib/timezone/test_ob_time_convert.cpp index 4f0e2cc3d..ca4b8c009 100644 --- a/deps/oblib/unittest/lib/timezone/test_ob_time_convert.cpp +++ b/deps/oblib/unittest/lib/timezone/test_ob_time_convert.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/timezone/test_ob_time_convert2.cpp b/deps/oblib/unittest/lib/timezone/test_ob_time_convert2.cpp index b719fb276..6857f6404 100644 --- a/deps/oblib/unittest/lib/timezone/test_ob_time_convert2.cpp +++ b/deps/oblib/unittest/lib/timezone/test_ob_time_convert2.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/timezone/test_ob_time_convert3.cpp b/deps/oblib/unittest/lib/timezone/test_ob_time_convert3.cpp index d7c88af8e..543f5296f 100644 --- a/deps/oblib/unittest/lib/timezone/test_ob_time_convert3.cpp +++ b/deps/oblib/unittest/lib/timezone/test_ob_time_convert3.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/timezone/test_ob_timezone_utils.cpp b/deps/oblib/unittest/lib/timezone/test_ob_timezone_utils.cpp index ac993356e..a285e6846 100644 --- a/deps/oblib/unittest/lib/timezone/test_ob_timezone_utils.cpp +++ b/deps/oblib/unittest/lib/timezone/test_ob_timezone_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/trace/test_trace.cpp b/deps/oblib/unittest/lib/trace/test_trace.cpp index 2667a63dc..9387ea0f5 100644 --- a/deps/oblib/unittest/lib/trace/test_trace.cpp +++ b/deps/oblib/unittest/lib/trace/test_trace.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -38,7 +42,7 @@ TEST(TestUUID, basic_test) TEST(TestTrace, basic_test) { - // 框架端完成初始化 + // Framework end completes initialization char buffer[8 << 10]; uint8_t level = 3; uint8_t auto_flush = 1; @@ -51,7 +55,7 @@ TEST(TestTrace, basic_test) FLT_SET_TAG(sql_text, "select 1 from dual;"); FLUSH_TRACE(); auto t = std::thread([=]() { - // RPC框架端完成初始化 + // RPC framework end completes initialization OBTRACE->init(trace_id, proxy->get_span_id(), (auto_flush << 7) + level); // FLTSpanGuard(ObSql); diff --git a/deps/oblib/unittest/lib/trace/test_trace_event.cpp b/deps/oblib/unittest/lib/trace/test_trace_event.cpp index 978bce863..cff565f9f 100644 --- a/deps/oblib/unittest/lib/trace/test_trace_event.cpp +++ b/deps/oblib/unittest/lib/trace/test_trace_event.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "deps/oblib/unittest/lib/unittest_diagnostic_info_util.h" diff --git a/deps/oblib/unittest/lib/unittest_diagnostic_info_util.h b/deps/oblib/unittest/lib/unittest_diagnostic_info_util.h index 91fd93e45..83b5529fa 100644 --- a/deps/oblib/unittest/lib/unittest_diagnostic_info_util.h +++ b/deps/oblib/unittest/lib/unittest_diagnostic_info_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_UNITTEST_DIAGNOSTIC_INFO_UTIL_H_ @@ -47,4 +51,4 @@ class ObUnitTestEnableDiagnoseGuard } /* namespace lib */ } /* namespace oceanbase */ -#endif /* OB_UNITTEST_DIAGNOSTIC_INFO_UTIL_H_ */ \ No newline at end of file +#endif /* OB_UNITTEST_DIAGNOSTIC_INFO_UTIL_H_ */ diff --git a/deps/oblib/unittest/lib/utility/test_defer.cpp b/deps/oblib/unittest/lib/utility/test_defer.cpp index bc55ca95f..1fddff7c5 100644 --- a/deps/oblib/unittest/lib/utility/test_defer.cpp +++ b/deps/oblib/unittest/lib/utility/test_defer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/utility/test_fast_convert.cpp b/deps/oblib/unittest/lib/utility/test_fast_convert.cpp index 66eae707f..8bcbece42 100644 --- a/deps/oblib/unittest/lib/utility/test_fast_convert.cpp +++ b/deps/oblib/unittest/lib/utility/test_fast_convert.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/utility/test_ob_unify_serialize.cpp b/deps/oblib/unittest/lib/utility/test_ob_unify_serialize.cpp index 3fc04ed26..c77e45500 100644 --- a/deps/oblib/unittest/lib/utility/test_ob_unify_serialize.cpp +++ b/deps/oblib/unittest/lib/utility/test_ob_unify_serialize.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX LIB diff --git a/deps/oblib/unittest/lib/utility/test_print_utils.cpp b/deps/oblib/unittest/lib/utility/test_print_utils.cpp index 6570bbce2..809c28966 100644 --- a/deps/oblib/unittest/lib/utility/test_print_utils.cpp +++ b/deps/oblib/unittest/lib/utility/test_print_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -123,4 +127,4 @@ int main(int argc, char **argv) OB_LOGGER.set_file_name("test_print_utility.log", true); testing::InitGoogleTest(&argc,argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/deps/oblib/unittest/lib/utility/test_sample_rate_limiter.cpp b/deps/oblib/unittest/lib/utility/test_sample_rate_limiter.cpp index d6d0d877a..9fbcfe0f5 100644 --- a/deps/oblib/unittest/lib/utility/test_sample_rate_limiter.cpp +++ b/deps/oblib/unittest/lib/utility/test_sample_rate_limiter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/utility/test_simple_rate_limiter.cpp b/deps/oblib/unittest/lib/utility/test_simple_rate_limiter.cpp index 327c74877..84e815239 100644 --- a/deps/oblib/unittest/lib/utility/test_simple_rate_limiter.cpp +++ b/deps/oblib/unittest/lib/utility/test_simple_rate_limiter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/utility/test_utility.cpp b/deps/oblib/unittest/lib/utility/test_utility.cpp index 4f724db37..ae7852c2e 100644 --- a/deps/oblib/unittest/lib/utility/test_utility.cpp +++ b/deps/oblib/unittest/lib/utility/test_utility.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/lib/wait_event/test_wait_event.cpp b/deps/oblib/unittest/lib/wait_event/test_wait_event.cpp index 6913fdc35..28a27eb8b 100644 --- a/deps/oblib/unittest/lib/wait_event/test_wait_event.cpp +++ b/deps/oblib/unittest/lib/wait_event/test_wait_event.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/pub/mock_server.cpp b/deps/oblib/unittest/pub/mock_server.cpp index 8e3d296cc..7c1bd78a9 100644 --- a/deps/oblib/unittest/pub/mock_server.cpp +++ b/deps/oblib/unittest/pub/mock_server.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "mock_server.h" diff --git a/deps/oblib/unittest/pub/mock_server.h b/deps/oblib/unittest/pub/mock_server.h index b0b3f805c..c525f8621 100644 --- a/deps/oblib/unittest/pub/mock_server.h +++ b/deps/oblib/unittest/pub/mock_server.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "common/server_framework/ob_net_easy.h" diff --git a/deps/oblib/unittest/rpc/mem_frag.c b/deps/oblib/unittest/rpc/mem_frag.c index f6fb9460d..f0ad724c1 100644 --- a/deps/oblib/unittest/rpc/mem_frag.c +++ b/deps/oblib/unittest/rpc/mem_frag.c @@ -1,83 +1,87 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ -#include -#include -#include -#include -#include -#include - -struct page_list { - struct page_list *next; -}; - -static struct page_list *free_list; - -uint64_t count=0; - -#define PG_ORDER 2 - -int __init mem_frag_init(void) -{ - struct page *pg; - struct page_list *tmp; - struct page_list *prev, *next; - - free_list = NULL; - while (1) { - pg = alloc_pages(GFP_KERNEL, PG_ORDER); - if (pg == NULL) - break; - tmp = (struct page_list *)page_address(pg); - tmp->next = free_list; - free_list = tmp; - count++; - //printk(KERN_DEBUG "PFN:%lu\n", page_to_pfn(pg)); - } - - printk(KERN_DEBUG "%s: alloc count:%llu\n", __func__, count); - - if (free_list == NULL) - return -ENOMEM; - //free half of pages back to buddy. - prev = free_list; - - while (prev && prev->next) { - next = prev->next; - prev->next = next->next; - free_pages((uint64_t)next, PG_ORDER); - prev = prev->next; - count--; - } - printk(KERN_DEBUG "%s: Fin count:%llu\n", __func__, count); - - return 0; -} - -void __exit mem_frag_exit(void) -{ - struct page_list *tmp; - - while (free_list) { - tmp = free_list; - free_list = free_list->next; - free_pages((uint64_t)tmp, PG_ORDER); - count--; - } - printk(KERN_DEBUG "%s: exit. count:%llu\n", __func__, count); -} - -module_init(mem_frag_init); -module_exit(mem_frag_exit); -MODULE_DESCRIPTION("make page fragment"); -MODULE_LICENSE("GPL"); +#include +#include +#include +#include +#include +#include + +struct page_list { + struct page_list *next; +}; + +static struct page_list *free_list; + +uint64_t count=0; + +#define PG_ORDER 2 + +int __init mem_frag_init(void) +{ + struct page *pg; + struct page_list *tmp; + struct page_list *prev, *next; + + free_list = NULL; + while (1) { + pg = alloc_pages(GFP_KERNEL, PG_ORDER); + if (pg == NULL) + break; + tmp = (struct page_list *)page_address(pg); + tmp->next = free_list; + free_list = tmp; + count++; + //printk(KERN_DEBUG "PFN:%lu\n", page_to_pfn(pg)); + } + + printk(KERN_DEBUG "%s: alloc count:%llu\n", __func__, count); + + if (free_list == NULL) + return -ENOMEM; + //free half of pages back to buddy. + prev = free_list; + + while (prev && prev->next) { + next = prev->next; + prev->next = next->next; + free_pages((uint64_t)next, PG_ORDER); + prev = prev->next; + count--; + } + printk(KERN_DEBUG "%s: Fin count:%llu\n", __func__, count); + + return 0; +} + +void __exit mem_frag_exit(void) +{ + struct page_list *tmp; + + while (free_list) { + tmp = free_list; + free_list = free_list->next; + free_pages((uint64_t)tmp, PG_ORDER); + count--; + } + printk(KERN_DEBUG "%s: exit. count:%llu\n", __func__, count); +} + +module_init(mem_frag_init); +module_exit(mem_frag_exit); +MODULE_DESCRIPTION("make page fragment"); +MODULE_LICENSE("GPL"); diff --git a/deps/oblib/unittest/rpc/mock_ob_common_rpc_proxy.h b/deps/oblib/unittest/rpc/mock_ob_common_rpc_proxy.h index 5c6ebc878..fe2ba5096 100644 --- a/deps/oblib/unittest/rpc/mock_ob_common_rpc_proxy.h +++ b/deps/oblib/unittest/rpc/mock_ob_common_rpc_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBRPC_MOCK_OB_COMMON_RPC_PROXY_H_ diff --git a/deps/oblib/unittest/rpc/mock_ob_srv_rpc_proxy.h b/deps/oblib/unittest/rpc/mock_ob_srv_rpc_proxy.h index 3f2e5825c..239679919 100644 --- a/deps/oblib/unittest/rpc/mock_ob_srv_rpc_proxy.h +++ b/deps/oblib/unittest/rpc/mock_ob_srv_rpc_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBRPC_MOCK_OB_SRV_RPC_PROXY_H_ diff --git a/deps/oblib/unittest/rpc/rpc_bench.cpp b/deps/oblib/unittest/rpc/rpc_bench.cpp index 7158d0012..73468eda3 100644 --- a/deps/oblib/unittest/rpc/rpc_bench.cpp +++ b/deps/oblib/unittest/rpc/rpc_bench.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC diff --git a/deps/oblib/unittest/rpc/test_co_rpc_server.cpp b/deps/oblib/unittest/rpc/test_co_rpc_server.cpp index e66b45dbb..e607f2e8a 100644 --- a/deps/oblib/unittest/rpc/test_co_rpc_server.cpp +++ b/deps/oblib/unittest/rpc/test_co_rpc_server.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_TEST diff --git a/deps/oblib/unittest/rpc/test_deliver.cpp b/deps/oblib/unittest/rpc/test_deliver.cpp index 50114bb9a..9cb8e6548 100644 --- a/deps/oblib/unittest/rpc/test_deliver.cpp +++ b/deps/oblib/unittest/rpc/test_deliver.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/rpc/test_mysql_packet.cpp b/deps/oblib/unittest/rpc/test_mysql_packet.cpp index 9a184a119..81bcc53df 100644 --- a/deps/oblib/unittest/rpc/test_mysql_packet.cpp +++ b/deps/oblib/unittest/rpc/test_mysql_packet.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/rpc/test_mysql_util.cpp b/deps/oblib/unittest/rpc/test_mysql_util.cpp index 4456282fd..c27b04351 100644 --- a/deps/oblib/unittest/rpc/test_mysql_util.cpp +++ b/deps/oblib/unittest/rpc/test_mysql_util.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_TEST diff --git a/deps/oblib/unittest/rpc/test_net_client.cpp b/deps/oblib/unittest/rpc/test_net_client.cpp index 983c62285..321b5aa15 100644 --- a/deps/oblib/unittest/rpc/test_net_client.cpp +++ b/deps/oblib/unittest/rpc/test_net_client.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "rpc/obrpc/ob_net_client.h" diff --git a/deps/oblib/unittest/rpc/test_ob_rpc_translator.cpp b/deps/oblib/unittest/rpc/test_ob_rpc_translator.cpp index 572946fbb..3ac1bdf97 100644 --- a/deps/oblib/unittest/rpc/test_ob_rpc_translator.cpp +++ b/deps/oblib/unittest/rpc/test_ob_rpc_translator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/rpc/test_obrpc_packet.cpp b/deps/oblib/unittest/rpc/test_obrpc_packet.cpp index 43c34e489..6f309dd99 100644 --- a/deps/oblib/unittest/rpc/test_obrpc_packet.cpp +++ b/deps/oblib/unittest/rpc/test_obrpc_packet.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_TEST @@ -68,55 +72,6 @@ TEST_F(TestObrpcPacket, NameIndex) EXPECT_STREQ("OB_BOOTSTRAP", set.name_of_idx(set.idx_of_pcode(OB_BOOTSTRAP))); } -TEST_F(TestObrpcPacket, CheckClusterId) -{ - int ret = OB_SUCCESS; - ObRpcNetHandler::CLUSTER_ID = 100; - - TestPacketProxy proxy; - frame::ObReqTransport transport(NULL, NULL); - ASSERT_EQ(OB_SUCCESS, proxy.init(&transport)); - ObRpcPacket pkt; - oceanbase::obrpc::ObRpcOpts opts; - SimpleProcessor p; - ObRequest req(ObRequest::OB_RPC); - req.set_packet(&pkt); - p.set_ob_request(req); - - ASSERT_EQ(OB_SUCCESS, init_packet(proxy, pkt, OB_TEST2_PCODE, opts, 1)); - - ASSERT_EQ(ObRpcNetHandler::CLUSTER_ID, pkt.get_src_cluster_id()); - ASSERT_EQ(ObRpcNetHandler::CLUSTER_ID, pkt.get_dst_cluster_id()); - - ASSERT_EQ(OB_SUCCESS, p.run()); - ASSERT_EQ(OB_ERR_UNEXPECTED, p.ret_code_); - - // dst_cluster_id mismatch - ObRpcNetHandler::CLUSTER_ID = 200; - ASSERT_EQ(OB_SUCCESS, p.run()); - ASSERT_EQ(OB_PACKET_CLUSTER_ID_NOT_MATCH, p.ret_code_); - - // rpc from 4.x old version observer which is belong to the same cluster - TestPacketProxy proxy2; - proxy2.init(&transport); - ASSERT_EQ(OB_SUCCESS, init_packet(proxy2, pkt, OB_TEST2_PCODE, opts, 1)); - pkt.set_dst_cluster_id(INVALID_CLUSTER_ID); - ASSERT_EQ(OB_SUCCESS, p.run()); - ASSERT_NE(OB_PACKET_CLUSTER_ID_NOT_MATCH, p.ret_code_); - - // rpc from 4.x old version observer which is belong to the different cluster - pkt.set_dst_cluster_id(INVALID_CLUSTER_ID); - pkt.set_src_cluster_id(ObRpcNetHandler::CLUSTER_ID + 1); - ASSERT_EQ(OB_SUCCESS, p.run()); - ASSERT_EQ(OB_PACKET_CLUSTER_ID_NOT_MATCH, p.ret_code_); - - // rpc is not from observer - pkt.set_dst_cluster_id(INVALID_CLUSTER_ID); - pkt.set_src_cluster_id(INVALID_CLUSTER_ID); - ASSERT_EQ(OB_SUCCESS, p.run()); - ASSERT_NE(OB_PACKET_CLUSTER_ID_NOT_MATCH, p.ret_code_); -} - int main(int argc, char *argv[]) { OB_LOGGER.set_log_level("INFO"); diff --git a/deps/oblib/unittest/rpc/test_obrpc_util.h b/deps/oblib/unittest/rpc/test_obrpc_util.h index addf68a2e..c856a09bb 100644 --- a/deps/oblib/unittest/rpc/test_obrpc_util.h +++ b/deps/oblib/unittest/rpc/test_obrpc_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_TEST_OBRPC_UTIL_H_ diff --git a/deps/oblib/unittest/rpc/test_rpc_proxy.cpp b/deps/oblib/unittest/rpc/test_rpc_proxy.cpp index 0191cf5c0..e4d8355a0 100644 --- a/deps/oblib/unittest/rpc/test_rpc_proxy.cpp +++ b/deps/oblib/unittest/rpc/test_rpc_proxy.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/rpc/test_rpc_server.cpp b/deps/oblib/unittest/rpc/test_rpc_server.cpp index d9c5f15d4..32297237f 100644 --- a/deps/oblib/unittest/rpc/test_rpc_server.cpp +++ b/deps/oblib/unittest/rpc/test_rpc_server.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_TEST diff --git a/deps/oblib/unittest/rpc/test_rpc_struct.cpp b/deps/oblib/unittest/rpc/test_rpc_struct.cpp index 3dfc8b7b9..4edead09f 100644 --- a/deps/oblib/unittest/rpc/test_rpc_struct.cpp +++ b/deps/oblib/unittest/rpc/test_rpc_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "rpc/obrpc/ob_rpc_packet.h" diff --git a/deps/oblib/unittest/rpc/test_stream_rpc.cpp b/deps/oblib/unittest/rpc/test_stream_rpc.cpp index ed0c24ee9..ed81f61a4 100644 --- a/deps/oblib/unittest/rpc/test_stream_rpc.cpp +++ b/deps/oblib/unittest/rpc/test_stream_rpc.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_TEST diff --git a/deps/oblib/unittest/rpc/test_translator.cpp b/deps/oblib/unittest/rpc/test_translator.cpp index 72a3480f7..a16304bfe 100644 --- a/deps/oblib/unittest/rpc/test_translator.cpp +++ b/deps/oblib/unittest/rpc/test_translator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/deps/oblib/unittest/rpc/testing.h b/deps/oblib/unittest/rpc/testing.h index 43a1efabe..af7938588 100644 --- a/deps/oblib/unittest/rpc/testing.h +++ b/deps/oblib/unittest/rpc/testing.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef RPC_TESTING_H diff --git a/docs/coding_standard.md b/docs/coding_standard.md index 6310311fa..f240a9447 100644 --- a/docs/coding_standard.md +++ b/docs/coding_standard.md @@ -37,15 +37,19 @@ Of course, developers may also perform module-level or multi-module integration Currently (as of May 2023), all source code files in Observer must include the following copyright information in the file header: ```cpp -Copyright (c) 2021 OceanBase -OceanBase is licensed under Mulan PubL v2. -You can use this software according to the terms and conditions of the Mulan PubL v2. -You may obtain a copy of Mulan PubL v2 at: - http://license.coscl.org.cn/MulanPubL-2.0 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PubL v2 for more details. +Copyright (c) 2025 OceanBase. + +Licensed 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. ``` ## 2.3 Header File Code diff --git a/docs/docs/en/coding_standard.md b/docs/docs/en/coding_standard.md index eecc2c7b3..95131e3f3 100644 --- a/docs/docs/en/coding_standard.md +++ b/docs/docs/en/coding_standard.md @@ -40,15 +40,19 @@ Of course, developers may also perform module-level or multi-module integration Currently (as of May 2023), all source code files in Observer must include the following copyright information in the file header: ```cpp -Copyright (c) 2021 OceanBase -OceanBase is licensed under Mulan PubL v2. -You can use this software according to the terms and conditions of the Mulan PubL v2. -You may obtain a copy of Mulan PubL v2 at: - http://license.coscl.org.cn/MulanPubL-2.0 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PubL v2 for more details. +Copyright (c) 2025 OceanBase. + +Licensed 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. ``` ## 2.3 Header File Code diff --git a/docs/docs/zh/coding_standard.md b/docs/docs/zh/coding_standard.md index 5280c9799..3b933efd8 100644 --- a/docs/docs/zh/coding_standard.md +++ b/docs/docs/zh/coding_standard.md @@ -37,15 +37,19 @@ C代码的实现文件命名为.c,头文件命名为.h,C++代码的实现文 ## 2.2 版权信息 目前(2021-3),observer & obproxy所有源代码文件头中必须使用如下版权信息: ```cpp -Copyright (c) 2021 OceanBase -OceanBase is licensed under Mulan PubL v2. -You can use this software according to the terms and conditions of the Mulan PubL v2. -You may obtain a copy of Mulan PubL v2 at: - http://license.coscl.org.cn/MulanPubL-2.0 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PubL v2 for more details. +Copyright (c) 2025 OceanBase. + +Licensed 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. ``` ## 2.3 头文件代码 diff --git a/mittest/env/ob_simple_server_helper.cpp b/mittest/env/ob_simple_server_helper.cpp index 563ec5c67..d60ceec0d 100644 --- a/mittest/env/ob_simple_server_helper.cpp +++ b/mittest/env/ob_simple_server_helper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/env/ob_simple_server_helper.h b/mittest/env/ob_simple_server_helper.h index 5f20c6ec3..0feeb234c 100644 --- a/mittest/env/ob_simple_server_helper.h +++ b/mittest/env/ob_simple_server_helper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/mittest/logservice/archiveservice/basic_archive.cpp b/mittest/logservice/archiveservice/basic_archive.cpp index 8337a4219..bd43dc1e3 100644 --- a/mittest/logservice/archiveservice/basic_archive.cpp +++ b/mittest/logservice/archiveservice/basic_archive.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "storage/tx_storage/ob_ls_service.h" @@ -57,7 +61,7 @@ int ObSimpleArchive::prepare_dest() int ret = OB_SUCCESS; EXPECT_EQ(OB_SUCCESS, get_curr_simple_server().init_sql_proxy2("tt1", "oceanbase")); common::ObMySQLProxy &sql_proxy = get_curr_simple_server().get_sql_proxy2(); - // 设置backup dest + // set backup dest { ObSqlString sql; sql.assign_fmt("alter system set log_archive_dest = 'location=%s'", "file://./"); @@ -199,8 +203,7 @@ int ObSimpleArchive::check_rs_archive_progress(const uint64_t tenant_id) OB_LOG(INFO, "check archive progress succ", K(ts), K(attr)); return ret; } - -// 测试日志流归档进度, 需要保证日志流归档进度已经持久化成功 +// Test the log stream archiving progress, need to ensure that the log stream archiving progress has been successfully persisted int ObSimpleArchive::check_archive_progress(const uint64_t tenant_id, const bool check_piece_advance) { int ret = OB_SUCCESS; @@ -264,7 +267,7 @@ int ObSimpleArchive::create_table_() { int ret = OB_SUCCESS; common::ObMySQLProxy &sql_proxy = get_curr_simple_server().get_sql_proxy2(); - // 创建表 + // Create table OB_LOG(INFO, "create_table start"); ObSqlString sql; sql.assign_fmt( @@ -324,7 +327,7 @@ int ObSimpleArchive::fake_piece_info_after_fake_stop(const uint64_t tenant_id, c ret = MTL(archive::ObArchiveService*)->persist_mgr_.load_archive_round_attr(attr); EXPECT_EQ(OB_SUCCESS, ret); share::SCN genesis_scn; - genesis_scn.convert_from_ts(attr.start_scn_.convert_to_ts() - 2 * piece_interval); // 由于piece_interval粒度小, 需要调高 + genesis_scn.convert_from_ts(attr.start_scn_.convert_to_ts() - 2 * piece_interval); // Due to the small granularity of piece_interval, it needs to be increased MTL(archive::ObArchiveService*)->fetcher_.piece_interval_ = piece_interval; MTL(archive::ObArchiveService*)->fetcher_.genesis_scn_ = genesis_scn; MTL(archive::ObArchiveService*)->ls_mgr_.piece_interval_ = piece_interval; diff --git a/mittest/logservice/archiveservice/basic_archive.h b/mittest/logservice/archiveservice/basic_archive.h index a17018133..0476fb3ee 100644 --- a/mittest/logservice/archiveservice/basic_archive.h +++ b/mittest/logservice/archiveservice/basic_archive.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef FAKE_SIMPLE_ARCHIVE_H_ diff --git a/mittest/logservice/archiveservice/create_restore_tenant.h b/mittest/logservice/archiveservice/create_restore_tenant.h index 61ec8965a..ef4d3e601 100644 --- a/mittest/logservice/archiveservice/create_restore_tenant.h +++ b/mittest/logservice/archiveservice/create_restore_tenant.h @@ -1,13 +1,17 @@ -#/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/container/ob_array.h" diff --git a/mittest/logservice/archiveservice/fake_archive_piece_mgr.cpp b/mittest/logservice/archiveservice/fake_archive_piece_mgr.cpp index b4d2342a5..b7cb64a21 100644 --- a/mittest/logservice/archiveservice/fake_archive_piece_mgr.cpp +++ b/mittest/logservice/archiveservice/fake_archive_piece_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "fake_archive_piece_mgr.h" diff --git a/mittest/logservice/archiveservice/fake_archive_piece_mgr.h b/mittest/logservice/archiveservice/fake_archive_piece_mgr.h index f9ee24c76..c65e5a54e 100644 --- a/mittest/logservice/archiveservice/fake_archive_piece_mgr.h +++ b/mittest/logservice/archiveservice/fake_archive_piece_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef FAKE_ARCHIVE_PIECE_CONTEXT_H_ diff --git a/mittest/logservice/archiveservice/test_archive_file_utils.cpp b/mittest/logservice/archiveservice/test_archive_file_utils.cpp index e36d73eca..0a7731bd3 100644 --- a/mittest/logservice/archiveservice/test_archive_file_utils.cpp +++ b/mittest/logservice/archiveservice/test_archive_file_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/logservice/archiveservice/test_archive_manage.cpp b/mittest/logservice/archiveservice/test_archive_manage.cpp index 33594b208..67717018a 100644 --- a/mittest/logservice/archiveservice/test_archive_manage.cpp +++ b/mittest/logservice/archiveservice/test_archive_manage.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "basic_archive.h" @@ -29,7 +33,7 @@ static const int64_t ONE_MINUTE = 60L * 1000 * 1000 * 1000; TEST_F(MySimpleArchiveInstance, test_archive_mgr) { int ret = OB_SUCCESS; - // 创建普通租户以及用户表 + // Create normal tenant and user table ret = prepare(); EXPECT_EQ(OB_SUCCESS, ret); @@ -37,80 +41,71 @@ TEST_F(MySimpleArchiveInstance, test_archive_mgr) EXPECT_EQ(OB_SUCCESS, ret); const uint64_t tenant_id = tenant_ids_[0]; int64_t round_id = 0; - - // =============== 首次开启归档 ================ // - // 开启归档 - round_id = 1; // 第一轮开启, round_id == 1 + // =============== First Archive Initialization ================ // + // Enable archiving + round_id = 1; // First round starts, round_id == 1 ret = run_archive(tenant_id); EXPECT_EQ(OB_SUCCESS, ret); - - // 检查rs归档状态为BEGINNING + // Check rs archive status is BEGINNING ret = check_rs_beginning(tenant_id, round_id); EXPECT_EQ(OB_SUCCESS, ret); - - // 检查rs归档状态为DOING + // Check rs archive status is DOING ret = check_rs_doing(tenant_id, round_id); EXPECT_EQ(OB_SUCCESS, ret); - - // 检查rs归档进度 + // Check rs archive progress ret = check_rs_archive_progress(tenant_id); EXPECT_EQ(OB_SUCCESS, ret); - - // 检查日志流归档状态推进 + // Check the log stream archive status advancement ret = check_archive_progress(tenant_id); EXPECT_EQ(OB_SUCCESS, ret); - - // 检查日志流归档任务 + // Check log stream archiving task ret = check_ls_archive_task(tenant_id); EXPECT_EQ(OB_SUCCESS, ret); - - // fake关闭归档组件 + // fake close archive component ret = fake_stop_component(tenant_id); EXPECT_EQ(OB_SUCCESS, ret); /* - * TODO 暂时关闭该部分单测内容 - * 需要补齐功能: - * 1. INTERRUPT持久化内部表在没有piece记录场景没有覆盖到 - * 2. 切piece与切archive server目前可能造成归档进度回退, rs无法推进进度 + * TODO temporarily disable this part of the unit test content + * functions to be completed: + * 1. INTERRUPT persistence internal table is not covered in scenarios without piece records + * 2. Switching piece and switching archive server may cause archive progress to retreat, rs cannot advance progress * - // 检查归档任务全部处理完成 + // Check if all archive tasks are processed ret = check_task_finish(tenant_id); EXPECT_EQ(OB_SUCCESS, ret); - // fake修改piece相关信息, 将piece interval修改为秒级别 + // fake modify piece related information, change piece interval to second level ret = fake_piece_info_after_fake_stop(tenant_id, ONE_MINUTE); EXPECT_EQ(OB_SUCCESS, ret); - // fake删除日志流归档任务 + // fake delete log stream archive task ret = fake_remove_ls(tenant_id); EXPECT_EQ(OB_SUCCESS, ret); - // fake重启归档组件 + // fake restart archive component ret = fake_restart_component(tenant_id); EXPECT_EQ(OB_SUCCESS, ret); - // 检查重启归档组件后, rs归档进度 + // Check archive progress of rs after restarting archive component ret = check_rs_archive_progress(tenant_id); EXPECT_EQ(OB_SUCCESS, ret); - // 检查日志流归档状态推进 + // Check if log stream archive status advances ret = check_archive_progress(tenant_id, true); EXPECT_EQ(OB_SUCCESS, ret); */ - // =============== 关闭归档 ================ // + // =============== Close Archive ================ // ret = stop_archive(); EXPECT_EQ(OB_SUCCESS, ret); ret = check_rs_stop(tenant_id, round_id); EXPECT_EQ(OB_SUCCESS, ret); - - // =============== 重新开启归档 ================ // + // =============== Reopen Archive ================ // round_id = 2; ret = run_archive(tenant_id); EXPECT_EQ(OB_SUCCESS, ret); - - // 检查归档组件处于doing + // Check if the archive component is in doing state ret = check_rs_doing(tenant_id, round_id); EXPECT_EQ(OB_SUCCESS, ret); } @@ -120,7 +115,7 @@ TEST_F(MySimpleArchiveInstance, test_archive_mgr) int main(int argc, char **argv) { - OB_LOGGER.set_file_name("test_archive_mgr.log", true, false, "test_archive_mgr_rs.log", "test_archive_election.log"); + OB_LOGGER.set_file_name("test_archive_mgr.log", true, false); OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); diff --git a/mittest/logservice/archiveservice/test_archive_task.cpp b/mittest/logservice/archiveservice/test_archive_task.cpp index 41e6ecc92..fdd3ccdf5 100644 --- a/mittest/logservice/archiveservice/test_archive_task.cpp +++ b/mittest/logservice/archiveservice/test_archive_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/logservice/archiveservice/test_log_archive_source.cpp b/mittest/logservice/archiveservice/test_log_archive_source.cpp index 7d39c206d..a301c7069 100644 --- a/mittest/logservice/archiveservice/test_log_archive_source.cpp +++ b/mittest/logservice/archiveservice/test_log_archive_source.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -137,7 +141,7 @@ TEST_F(TestLogArchiveSource, insert_source) int main(int argc, char **argv) { - OB_LOGGER.set_file_name("test_log_archive_source.log", true, false, "test_log_archive_source_rs.log", "test_archive_election.log"); + OB_LOGGER.set_file_name("test_log_archive_source.log", true, false); OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); diff --git a/mittest/logservice/archiveservice/test_restore_archive_log.cpp b/mittest/logservice/archiveservice/test_restore_archive_log.cpp index 2418eb714..e3e271b7e 100644 --- a/mittest/logservice/archiveservice/test_restore_archive_log.cpp +++ b/mittest/logservice/archiveservice/test_restore_archive_log.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/logservice/archiveservice/test_restore_mysql_proxy.cpp b/mittest/logservice/archiveservice/test_restore_mysql_proxy.cpp index e7def34c7..b59de4976 100644 --- a/mittest/logservice/archiveservice/test_restore_mysql_proxy.cpp +++ b/mittest/logservice/archiveservice/test_restore_mysql_proxy.cpp @@ -1,13 +1,17 @@ -#/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/logservice/archiveservice/test_restore_oracle_proxy.cpp b/mittest/logservice/archiveservice/test_restore_oracle_proxy.cpp index 2bc0b2f41..e22daa000 100644 --- a/mittest/logservice/archiveservice/test_restore_oracle_proxy.cpp +++ b/mittest/logservice/archiveservice/test_restore_oracle_proxy.cpp @@ -1,13 +1,17 @@ -#/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/logservice/env/mock_election.cpp b/mittest/logservice/env/mock_election.cpp index 7d50a4652..ce385ecc0 100644 --- a/mittest/logservice/env/mock_election.cpp +++ b/mittest/logservice/env/mock_election.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c)2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "mock_election.h" @@ -121,8 +125,7 @@ int MockElection::reset_priority() int ret = OB_SUCCESS; return ret; } - -// 处理消息 +// Process message int MockElection::handle_message(const ElectionPrepareRequestMsg &msg) { int ret = OB_SUCCESS; @@ -175,4 +178,4 @@ int MockElection::set_leader(const common::ObAddr &leader, const int64_t new_epo return ret; } }// unittest -}// oceanbase \ No newline at end of file +}// oceanbase diff --git a/mittest/logservice/env/mock_election.h b/mittest/logservice/env/mock_election.h index 0e5b11f2b..d19efe1b5 100644 --- a/mittest/logservice/env/mock_election.h +++ b/mittest/logservice/env/mock_election.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "logservice/palf/election/interface/election.h" #include "logservice/palf/palf_handle_impl.h" @@ -26,24 +30,24 @@ class MockElection : public Election, public common::LinkHashValue int init(const int64_t id, const common::ObAddr &self); void stop() override final; int can_set_memberlist(const palf::LogConfigVersion &new_config_version) const override final; - // 设置成员列表 + // Set member list int set_memberlist(const MemberList &new_member_list) override final; - // 获取选举当前的角色 + // Get the current role of the election int get_role(common::ObRole &role, int64_t &epoch) const override final; - // 如果自己是leader,那么拿到的就是准确的leader,如果自己不是leader,那么拿到lease的owner + // If you are the leader, then you get the accurate leader; if you are not the leader, then you get the lease owner int get_current_leader_likely(common::ObAddr &addr, int64_t &cur_leader_epoch) const override final; - // 供role change service使用 + // For role change service use int change_leader_to(const common::ObAddr &dest_addr) override final; int temporarily_downgrade_protocol_priority(const int64_t time_us, const char *reason) override final; - // 拿本机地址 + // Get local address const common::ObAddr &get_self_addr() const override final; - // 打印日志 + // print log int64_t to_string(char *buf, const int64_t buf_len) const override final; - // 设置选举优先级 + // Set election priority int set_priority(ElectionPriority *priority) override final; int reset_priority() override final; - // 处理消息 + // Process message int handle_message(const ElectionPrepareRequestMsg &msg) override final; int handle_message(const ElectionAcceptRequestMsg &msg) override final; int handle_message(const ElectionPrepareResponseMsg &msg) override final; @@ -59,4 +63,4 @@ class MockElection : public Election, public common::LinkHashValue bool is_inited_; }; }// unittest -}// oceanbase \ No newline at end of file +}// oceanbase diff --git a/mittest/logservice/env/mock_ob_locality_manager.h b/mittest/logservice/env/mock_ob_locality_manager.h index 6801dc641..88ce54bc7 100644 --- a/mittest/logservice/env/mock_ob_locality_manager.h +++ b/mittest/logservice/env/mock_ob_locality_manager.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "storage/ob_locality_manager.h" diff --git a/mittest/logservice/env/mock_ob_meta_reporter.h b/mittest/logservice/env/mock_ob_meta_reporter.h index 850c1c86a..4416cf037 100644 --- a/mittest/logservice/env/mock_ob_meta_reporter.h +++ b/mittest/logservice/env/mock_ob_meta_reporter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_MITTEST_MOCK_OB_META_REPORTER_ @@ -45,4 +49,4 @@ class MockMetaReporter : public ObIMetaReport }; }// storage }// oceanbase -#endif \ No newline at end of file +#endif diff --git a/mittest/logservice/env/ob_simple_arb_server.cpp b/mittest/logservice/env/ob_simple_arb_server.cpp index 8afa4a5bb..10f05160f 100644 --- a/mittest/logservice/env/ob_simple_arb_server.cpp +++ b/mittest/logservice/env/ob_simple_arb_server.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public @@ -25,7 +29,7 @@ namespace palflite int PalfEnvLiteMgr::get_palf_env_lite(const palflite::PalfEnvKey &key, PalfEnvLite *&palf_env_lite) { - // NB:保证arb server的node id为1002 + // NB: ensure the node id of arb server is 1002 palf_env_lite = NULL; int ret = OB_SUCCESS; if (OB_FAIL(palf_env_lite_map_.get(key, palf_env_lite))) { diff --git a/mittest/logservice/env/ob_simple_arb_server.h b/mittest/logservice/env/ob_simple_arb_server.h index ec4343abc..0ab9d5984 100644 --- a/mittest/logservice/env/ob_simple_arb_server.h +++ b/mittest/logservice/env/ob_simple_arb_server.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/mittest/logservice/env/ob_simple_log_cluster_env.cpp b/mittest/logservice/env/ob_simple_log_cluster_env.cpp index 7f835c4a6..034516465 100644 --- a/mittest/logservice/env/ob_simple_log_cluster_env.cpp +++ b/mittest/logservice/env/ob_simple_log_cluster_env.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public @@ -27,7 +31,7 @@ namespace unittest void init_gtest_output(std::string >est_log_name) { - // 判断是否处于Farm中 + // Determine if it is within the Farm char *mit_network_start_port_env = getenv("mit_network_start_port"); char *mit_network_port_num_env = getenv("mit_network_port_num"); if (mit_network_start_port_env != nullptr && mit_network_port_num_env != nullptr) { @@ -739,7 +743,7 @@ int ObSimpleLogClusterTestEnv::switch_leader(const int64_t id, const int64_t new CLOG_LOG(INFO, "switch_leader success", K(ret), "prev_leader:", cluster[prev_leader_idx_]->get_addr(), "new_leader:", cluster[new_leader_idx]->get_addr(), "old_leader:", cluster[old_leader_idx]->get_addr(), K(old_leader_idx), K(new_leader_idx)); prev_leader_idx_ = new_leader_idx; - // 确保election已经切主成功. + // Ensure election has successfully switched to the new master. do { ret = get_leader(id, leader, old_leader_idx); } while (old_leader_idx != new_leader_idx); @@ -781,7 +785,7 @@ int ObSimpleLogClusterTestEnv::check_replica_sync(const int64_t id, PalfHandleIm } else if (end_lsn_1 < max_lsn_1) { usleep(1 * 1000); } else if (max_lsn_2 < end_lsn_1) { - // 目前用max_lsn与leader的end_lsn比较 + // Currently compare max_lsn with leader's end_lsn usleep(1 * 1000); } else if (max_lsn_2 > end_lsn_1) { ret = OB_ERR_UNEXPECTED; diff --git a/mittest/logservice/env/ob_simple_log_cluster_env.h b/mittest/logservice/env/ob_simple_log_cluster_env.h index 80c9770af..d86e64242 100644 --- a/mittest/logservice/env/ob_simple_log_cluster_env.h +++ b/mittest/logservice/env/ob_simple_log_cluster_env.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "logservice/palf_handle_guard.h" @@ -28,10 +32,8 @@ class MockLSAdapter; #define SET_CASE_LOG_FILE(TEST_NAME, CASE_NAME) \ const std::string log_file_name = TEST_NAME + "/" + CASE_NAME + ".log";\ - const std::string ele_log_file_name = TEST_NAME + "/" + CASE_NAME + ".election.log";\ OB_LOGGER.set_file_name(log_file_name.c_str(),\ - true, false, NULL, \ - ele_log_file_name.c_str(), NULL); + true, false, NULL); #define RUN_SIMPLE_LOG_CLUSTER_TEST(TEST_NAME) \ void *ptr = malloc(SIG_STACK_SIZE); \ @@ -57,10 +59,7 @@ class MockLSAdapter; system(rm_log_cmd.c_str()); \ system(mk_base_dir_cm.c_str()); \ const std::string log_file_name = TEST_NAME+"/"+TEST_NAME + ".log"; \ - const std::string ele_log_file_name = TEST_NAME+"/"+TEST_NAME + ".election.log"; \ - const std::string rs_log_file_name = TEST_NAME+"/"+TEST_NAME + ".rs.log"; \ - OB_LOGGER.set_file_name(log_file_name.c_str(), true, false, rs_log_file_name.c_str(), \ - ele_log_file_name.c_str(), NULL); \ + OB_LOGGER.set_file_name(log_file_name.c_str(), true, false); \ OB_LOGGER.set_log_level("DEBUG"); \ OB_LOGGER.set_enable_log_limit(false); \ OB_LOGGER.set_enable_async_log(false); \ diff --git a/mittest/logservice/env/ob_simple_log_cluster_testbase.cpp b/mittest/logservice/env/ob_simple_log_cluster_testbase.cpp index 30fb62e34..2b2651821 100644 --- a/mittest/logservice/env/ob_simple_log_cluster_testbase.cpp +++ b/mittest/logservice/env/ob_simple_log_cluster_testbase.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_simple_log_cluster_testbase.h" @@ -178,8 +182,8 @@ int ObSimpleLogClusterTestBase::start() io_unit_config.min_iops_ = 10000000; io_unit_config.weight_ = 10000000; tio_manager_->update_basic_io_unit_config(io_unit_config); - // 如果需要新增arb server,将其作为memberlist最后一项 - // TODO by runlin, 这个是暂时的解决方法,以后可以走加减成员的流程 + // If you need to add a new arb server, add it as the last item in memberlist + // TODO by runlin, this is a temporary solution, it can follow the process of adding or removing members in the future const int64_t arb_idx = member_cnt_ - 1; int64_t node_id = node_idx_base_; for (int i = 0; OB_SUCC(ret) && i < node_cnt_; i++) { diff --git a/mittest/logservice/env/ob_simple_log_cluster_testbase.h b/mittest/logservice/env/ob_simple_log_cluster_testbase.h index 16b476b8b..62ac4fb97 100644 --- a/mittest/logservice/env/ob_simple_log_cluster_testbase.h +++ b/mittest/logservice/env/ob_simple_log_cluster_testbase.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/mittest/logservice/env/ob_simple_log_server.cpp b/mittest/logservice/env/ob_simple_log_server.cpp index 1f73ddd47..14217eab8 100644 --- a/mittest/logservice/env/ob_simple_log_server.cpp +++ b/mittest/logservice/env/ob_simple_log_server.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public #define protected public @@ -139,7 +143,7 @@ int ObSimpleLogServer::simple_init( malloc->create_and_add_tenant_allocator(node_id); } if (is_bootstrap) { - // mittest的打印日志采用仲裁的方式 + // The print log of mittest uses an arbitration method OB_LOGGER.is_arb_replica_ = true; // ObTenantIOManager depend static instance, need init it in ObSimpleLogCluster ls_service_ = OB_NEW(ObLSService, "mittest"); @@ -218,9 +222,9 @@ int ObSimpleLogServer::update_disk_opts_no_lock_(const PalfDiskOptions &opts) int64_t old_log_disk_size = disk_opts_.log_disk_usage_limit_size_; int64_t new_log_disk_size = opts.log_disk_usage_limit_size_; int64_t allowed_new_log_disk_size = 0; - // 内部表中的disk_opts立马生效 + // The disk_opts in the internal table take effect immediately inner_table_disk_opts_ = opts; - // disk_opts_表示本地持久化最新的disk_opts,log_disk_percentage_延迟生效 + // disk_opts_ represents the latest disk_opts for local persistence, log_disk_percentage_ takes effect with a delay disk_opts_ = opts; disk_opts_.log_disk_usage_limit_size_ = old_log_disk_size; if (!opts.is_valid()) { @@ -305,7 +309,7 @@ int ObSimpleLogServer::init_memory_dump_timer_() { int ret = OB_SUCCESS; common::ObFunction print_memory_info = [=](){ - // 内存分配仍采取不同的租户id + // Memory allocation still uses different tenant id ObMallocAllocator::get_instance()->print_tenant_memory_usage(node_id_); ObMallocAllocator::get_instance()->print_tenant_ctx_memory_usage(node_id_); ObMallocAllocator::get_instance()->print_tenant_memory_usage(OB_SERVER_TENANT_ID); @@ -393,7 +397,7 @@ int ObSimpleLogServer::init_io_(const std::string &cluster_name) storage_env.default_block_size_ = OB_DEFAULT_MACRO_BLOCK_SIZE; storage_env.data_disk_size_ = 1024 * 1024 * 1024; storage_env.data_disk_percentage_ = 0; - // 当disk_opts_有效时,使用disk_opts_中记录的log_disk_usage_limit_size_作为log_block_pool_的初始值,否则重启会失败 + // When disk_opts_ is valid, use log_disk_usage_limit_size_ recorded in disk_opts_ as the initial value of log_block_pool_, otherwise the restart will fail storage_env.log_disk_size_ = disk_opts_.is_valid() ? disk_opts_.log_disk_usage_limit_size_ : 2LL * 1024 * 1024 * 1024; storage_env.log_disk_percentage_ = 0; @@ -420,7 +424,7 @@ int ObSimpleLogServer::init_io_(const std::string &cluster_name) if (OB_SUCC(ret)) { log_block_pool_.get_tenants_log_disk_size_func_ = [](int64_t &log_disk_size) -> int { - // ObServerLogBlockMGR 率先于 ObLogService加载,此时租户使用的log_disk_size为0. + // ObServerLogBlockMGR loads before ObLogService, at this time the log_disk_size used by the tenant is 0. log_disk_size = 0; return OB_SUCCESS; }; @@ -452,7 +456,7 @@ int ObSimpleLogServer::init_log_service_(const bool is_bootstrap) opts.enable_log_cache_ = true; } std::string clog_dir = clog_dir_ + "/tenant_" + std::to_string(tenant_id_); - // 内存分配器仍使用不同的tenant_id + // Memory allocator still uses different tenant_id allocator_ = OB_NEW(ObTenantMutilAllocator, "TestBase", node_id_); ObMemAttr attr(1, "SimpleLog"); ObMemAttr ele_attr(1, ObNewModIds::OB_ELECTION); diff --git a/mittest/logservice/env/ob_simple_log_server.h b/mittest/logservice/env/ob_simple_log_server.h index 422ca90e0..02b69a602 100644 --- a/mittest/logservice/env/ob_simple_log_server.h +++ b/mittest/logservice/env/ob_simple_log_server.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -521,11 +525,11 @@ class ObSimpleLogServer : public ObISimpleLogServer ObSrvRpcProxy srv_proxy_; logservice::coordinator::ObFailureDetector detector_; MockElectionMap mock_election_map_; - // ObTenantUnit以及__all_unit_configs + // ObTenantUnit and __all_unit_configs ObSpinLock log_disk_lock_; - // 本地已生效日志盘规格 + // Local effective log disk specification palf::PalfDiskOptions disk_opts_; - // 内部表中记录日志盘规格 + // Internal table records log disk specifications palf::PalfDiskOptions inner_table_disk_opts_; ObLooper looper_; MockCkptMap ckpt_map_; diff --git a/mittest/logservice/test_ob_simple_arb_server_mutil_replica.cpp b/mittest/logservice/test_ob_simple_arb_server_mutil_replica.cpp index 08a5f2d40..9cd52fce7 100644 --- a/mittest/logservice/test_ob_simple_arb_server_mutil_replica.cpp +++ b/mittest/logservice/test_ob_simple_arb_server_mutil_replica.cpp @@ -1,15 +1,21 @@ // owner: zjf225077 // owner group: log -// Copyright (c) 2021 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define private public #define protected public #include "env/ob_simple_log_cluster_env.h" @@ -84,7 +90,7 @@ TEST_F(TestObSimpleMutilArbServer, create_mutil_tenant) ObSimpleLogServer *log_server = dynamic_cast(iserver_log); ObSrvRpcProxy &rpc_proxy = log_server->srv_proxy_; ObAddr dst_addr = iserver_arb->get_addr(); - // 验证建立arb replica副本 + // Validate the establishment of arb replica copy obrpc::ObCreateArbArg arg; obrpc::ObCreateArbResult result; ObRpcNetHandler::CLUSTER_ID = 1; @@ -97,8 +103,7 @@ TEST_F(TestObSimpleMutilArbServer, create_mutil_tenant) palflite::PalfEnvKey(cluster_id, 1001), palf_env_lite)); EXPECT_EQ(OB_SUCCESS, palf_env_lite->get_palf_handle_impl(1, guard)); guard.reset(); - - // 验证设置成员列表 + // Validate member list settings obrpc::ObSetMemberListArgV2 memberlist_arg; obrpc::ObSetMemberListArgV2 memberlist_result; const ObMemberList member_list = get_arb_member_list(); @@ -139,7 +144,7 @@ TEST_F(TestObSimpleMutilArbServer, test_gc) ObSimpleLogServer *log_server = dynamic_cast(iserver_log); ObSrvRpcProxy &rpc_proxy = log_server->srv_proxy_; ObAddr dst_addr = iserver_arb->get_addr(); - // 验证GC + // Validate GC { palflite::PalfEnvLiteMgr *mgr = &arb_server->palf_env_mgr_; auto create_clusters = [&mgr, log_server](const std::vector &cluster_ids) -> int { @@ -302,12 +307,12 @@ TEST_F(TestObSimpleMutilArbServer, test_gc) }; arbserver::GCMsgEpoch epoch(100, 1000); - // 执行GC动作 + // Execute GC action { uint64_t max_tenant_id = 1006; - // 只操作了1000 1002 cluster,预期1001 1003 cluster的日志流全部存在 - // 预期1003租户会被直接删除完毕 - // 预期1000 1001 1002 1004租户的1002 1007日志流会被删除 + // Only operated on 1000 1002 cluster, expected all log streams of 1001 1003 cluster to exist + // Expected tenant 1003 to be directly deleted completely + // Expected tenant 1000 1001 1002 1004's 1002 1007 log streams to be deleted arbserver::TenantLSIDSArray array; EXPECT_EQ(OB_SUCCESS, create_tenant_ls_id_array(array)); for (auto cluster_id : gc_cluster_ids) { @@ -323,21 +328,20 @@ TEST_F(TestObSimpleMutilArbServer, test_gc) std::vector not_exist_tenant_ids = {1003}; std::vector no_gc_cluster_ids = {1001, 1003}; - // 已经gc的cluster中,1003 租户不存在 + // The tenant 1003 does not exist in the already gc cluster CLOG_LOG(INFO, "first check"); EXPECT_EQ(false, check_tenant(gc_cluster_ids, not_exist_tenant_ids, epoch)); - // 未gc的cluster中,1003 租户存在 + // In the un-gced cluster, tenant 1003 exists CLOG_LOG(INFO, "second check"); EXPECT_EQ(true, check_tenant(no_gc_cluster_ids, not_exist_tenant_ids, GCMsgEpoch(palf::INVALID_PROPOSAL_ID, -1))); - // 已经gc的cluster中,gc_tenant_ids中租户存在 + // already gc'd cluster, tenant exists in gc_tenant_ids CLOG_LOG(INFO, "third check"); EXPECT_EQ(true, check_tenant(gc_cluster_ids, gc_tenant_ids, epoch)); - - // 已经gc的cluster中,1002以及1007日志流不存在 + // In the already gc'd cluster, log streams 1002 and 1007 do not exist std::vector not_exist_ls = {1002, 1007}; CLOG_LOG(INFO, "fourth check"); EXPECT_EQ(false, check_tenant_and_ls(gc_cluster_ids, gc_tenant_ids, not_exist_ls)); - // 已经gc的cluster中,其他日志流存在 + // In the cluster that has already been gc, other log streams exist CLOG_LOG(INFO, "five check"); EXPECT_EQ(true, check_tenant_and_ls(gc_cluster_ids, gc_tenant_ids, gc_ls_ids)); diff --git a/mittest/logservice/test_ob_simple_arb_server_single_replica.cpp b/mittest/logservice/test_ob_simple_arb_server_single_replica.cpp index da0195926..c836b9427 100755 --- a/mittest/logservice/test_ob_simple_arb_server_single_replica.cpp +++ b/mittest/logservice/test_ob_simple_arb_server_single_replica.cpp @@ -1,15 +1,21 @@ // owner: zjf225077 // owner group: log -// Copyright (c) 2021 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define private public #include "env/ob_simple_log_cluster_env.h" #undef private diff --git a/mittest/logservice/test_ob_simple_log_access_mode.cpp b/mittest/logservice/test_ob_simple_log_access_mode.cpp index ba454a565..7bc6c6b35 100644 --- a/mittest/logservice/test_ob_simple_log_access_mode.cpp +++ b/mittest/logservice/test_ob_simple_log_access_mode.cpp @@ -1,16 +1,20 @@ // owner: yunlong.cb // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public @@ -222,8 +226,7 @@ TEST_F(TestObSimpleLogClusterAccessMode, add_member) EXPECT_EQ(OB_SUCCESS, leader.palf_handle_impl_->change_access_mode(curr_proposal_id, mode_version, palf::AccessMode::RAW_WRITE, share::SCN::min_scn())); unblock_net(leader_idx, follower1_idx); block_net(leader_idx, follower2_idx); - - // new_leader需要在delete_paxos_group()之前析构,否则palf_handle引用计数无法清零 + // new_leader needs to be destructed before delete_paxos_group(), otherwise palf_handle reference count cannot be reset to zero PalfHandleImplGuard new_leader; int64_t new_leader_idx; EXPECT_EQ(OB_SUCCESS, get_leader(id, new_leader, new_leader_idx)); diff --git a/mittest/logservice/test_ob_simple_log_apply.cpp b/mittest/logservice/test_ob_simple_log_apply.cpp index 93342ae4a..c2e371eda 100644 --- a/mittest/logservice/test_ob_simple_log_apply.cpp +++ b/mittest/logservice/test_ob_simple_log_apply.cpp @@ -1,16 +1,20 @@ // owner: zjf225077 // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public @@ -134,8 +138,7 @@ TEST_F(TestObSimpleLogApplyFunc, apply) EXPECT_EQ(OB_SUCCESS, ap_sv.switch_to_leader(ls_id, 1)); const int64_t idx_1 = (leader_idx + 1) % get_node_cnt(); const int64_t idx_2 = (leader_idx + 2) % get_node_cnt(); - - //旧主少数派写日志 + // Old master minority writes log block_net(leader_idx, idx_1); block_net(leader_idx, idx_2); do { @@ -169,23 +172,21 @@ TEST_F(TestObSimpleLogApplyFunc, apply) share::SCN min_scn; EXPECT_EQ(OB_SUCCESS, ap_sv.get_max_applied_scn(ls_id, min_scn)); EXPECT_EQ(OB_SUCCESS, ap_sv.switch_to_follower(ls_id)); - - //切主, truncate旧主日志,预期所有cb都调用on_failure + // Switch master, truncate old master log, expect all cb to call on_failure sleep(15); while (!is_apply_done) { ap_sv.is_apply_done(ls_id, is_apply_done, unused_apply_end_lsn); usleep(100); } - - //切回旧主写日志,预期所有cb都调用on_success + // Switch back to the old main writer log, expect all cb to call on_success unblock_net(leader_idx, idx_1); unblock_net(leader_idx, idx_2); int64_t new_leader_idx = 0; PalfHandleImplGuard new_leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, new_leader, new_leader_idx)); EXPECT_NE(new_leader_idx, leader_idx); - //等待membership同步 + // Wait for membership synchronization sleep(2); leader.reset(); CLOG_LOG(INFO, "new leader", K(new_leader_idx), K(leader_idx)); diff --git a/mittest/logservice/test_ob_simple_log_arb.cpp b/mittest/logservice/test_ob_simple_log_arb.cpp index 17bc7128d..f993a85b7 100755 --- a/mittest/logservice/test_ob_simple_log_arb.cpp +++ b/mittest/logservice/test_ob_simple_log_arb.cpp @@ -1,15 +1,21 @@ // owner: yunlong.cb // owner group: log -// Copyright (c) 2021 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define private public #include "env/ob_simple_log_cluster_env.h" #undef private @@ -92,7 +98,7 @@ TEST_F(TestObSimpleLogClusterArbService, test_2f1a_degrade_upgrade) EXPECT_EQ(OB_SUCCESS, get_cluster_palf_handle_guard(id, palf_list)); const int64_t another_f_idx = (leader_idx+1)%3; EXPECT_EQ(OB_SUCCESS, submit_log(leader, 100, id)); - // 为备副本设置location cb,用于备副本找leader + // Set location cb for the backup copy to find the leader palf_list[another_f_idx]->get_palf_handle_impl()->set_location_cache_cb(&loc_cb); block_net(leader_idx, another_f_idx); // do not check OB_SUCCESS, may return OB_NOT_MASTER during degrading member @@ -240,7 +246,7 @@ TEST_F(TestObSimpleLogClusterArbService, test_2f1a_reconfirm_degrade_upgrade) ARB_TIMEOUT_ARG = 15 * 1000 * 1000; block_net(leader_idx, another_f_idx); block_net(leader_idx, arb_replica_idx); - // block_net后会理解进行降级操作,导致旧主上有些单副本写成功的日志被committed + // block_net after will perform a downgrade operation, leading to some single replica writes that succeeded on the old master being committed submit_log(leader, 20, id); // submit some logs which will be truncated @@ -341,7 +347,7 @@ TEST_F(TestObSimpleLogClusterArbService, test_2f1a_config_change) common::ObMember dummy_member; EXPECT_EQ(OB_SUCCESS, create_paxos_group_with_arb(id, arb_replica_idx, leader_idx, leader)); EXPECT_EQ(OB_SUCCESS, get_cluster_palf_handle_guard(id, palf_list)); - // 为备副本设置location cb,用于备副本找leader + // Set location cb for the backup copy to find the leader const int64_t another_f_idx = (leader_idx+1)%3; loc_cb.leader_ = leader.palf_handle_impl_->self_; palf_list[another_f_idx]->get_palf_handle_impl()->set_location_cache_cb(&loc_cb); @@ -398,7 +404,7 @@ TEST_F(TestObSimpleLogClusterArbService, test_2f1a_arb_with_highest_version) common::ObMember dummy_member; EXPECT_EQ(OB_SUCCESS, create_paxos_group_with_arb(id, arb_replica_idx, leader_idx, leader)); EXPECT_EQ(OB_SUCCESS, get_cluster_palf_handle_guard(id, palf_list)); - // 为备副本设置location cb,用于备副本找leader + // Set location cb for the backup copy to find the leader const int64_t another_f_idx = (leader_idx+1)%3; loc_cb.leader_ = leader.palf_handle_impl_->self_; palf_list[another_f_idx]->get_palf_handle_impl()->set_location_cache_cb(&loc_cb); @@ -478,7 +484,7 @@ TEST_F(TestObSimpleLogClusterArbService, test_2f1a_defensive) common::ObMember dummy_member; EXPECT_EQ(OB_SUCCESS, create_paxos_group_with_arb(id, arb_replica_idx, leader_idx, leader)); EXPECT_EQ(OB_SUCCESS, get_cluster_palf_handle_guard(id, palf_list)); - // 为备副本设置location cb,用于备副本找leader + // Set location cb for the backup copy to find the leader const int64_t another_f_idx = (leader_idx+1)%3; loc_cb.leader_ = leader.palf_handle_impl_->self_; palf_list[another_f_idx]->get_palf_handle_impl()->set_location_cache_cb(&loc_cb); @@ -564,7 +570,7 @@ TEST_F(TestObSimpleLogClusterArbService, test_multi_meta_block) common::ObMember dummy_member; EXPECT_EQ(OB_SUCCESS, create_paxos_group_with_arb(id, arb_replica_idx, leader_idx, leader)); EXPECT_EQ(OB_SUCCESS, get_cluster_palf_handle_guard(id, palf_list)); - // 为备副本设置location cb,用于备副本找leader + // Set location cb for the backup copy to find the leader const int64_t another_f_idx = (leader_idx+1)%3; loc_cb.leader_ = leader.palf_handle_impl_->self_; palf_list[another_f_idx]->get_palf_handle_impl()->set_location_cache_cb(&loc_cb); @@ -668,7 +674,7 @@ TEST_F(TestObSimpleLogClusterArbService, test_2f1a_degrade_when_no_leader) common::ObMember dummy_member; EXPECT_EQ(OB_SUCCESS, create_paxos_group_with_arb(id, arb_replica_idx, leader_idx, leader)); EXPECT_EQ(OB_SUCCESS, get_cluster_palf_handle_guard(id, palf_list)); - // 为备副本设置location cb,用于备副本找leader + // Set location cb for the backup copy to find the leader const int64_t another_f_idx = (leader_idx+1)%3; loc_cb.leader_ = leader.palf_handle_impl_->self_; palf_list[another_f_idx]->get_palf_handle_impl()->set_location_cache_cb(&loc_cb); @@ -743,7 +749,7 @@ TEST_F(TestObSimpleLogClusterArbService, test_2f1a_upgrade_when_no_leader) common::ObMember dummy_member; EXPECT_EQ(OB_SUCCESS, create_paxos_group_with_arb(id, arb_replica_idx, leader_idx, leader)); EXPECT_EQ(OB_SUCCESS, get_cluster_palf_handle_guard(id, palf_list)); - // 为备副本设置location cb,用于备副本找leader + // Set location cb for the backup copy to find the leader const int64_t another_f_idx = (leader_idx+1)%3; loc_cb.leader_ = leader.palf_handle_impl_->self_; palf_list[another_f_idx]->get_palf_handle_impl()->set_location_cache_cb(&loc_cb); diff --git a/mittest/logservice/test_ob_simple_log_arb_mock_ele.cpp b/mittest/logservice/test_ob_simple_log_arb_mock_ele.cpp index 51bc45df6..933590c6c 100755 --- a/mittest/logservice/test_ob_simple_log_arb_mock_ele.cpp +++ b/mittest/logservice/test_ob_simple_log_arb_mock_ele.cpp @@ -1,15 +1,21 @@ // owner: yunlong.cb // owner group: log -// Copyright (c) 2021 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define private public #include "env/ob_simple_log_cluster_env.h" #undef private diff --git a/mittest/logservice/test_ob_simple_log_basic_func.cpp b/mittest/logservice/test_ob_simple_log_basic_func.cpp index 1aedab3f9..2a214b1c5 100644 --- a/mittest/logservice/test_ob_simple_log_basic_func.cpp +++ b/mittest/logservice/test_ob_simple_log_basic_func.cpp @@ -1,16 +1,20 @@ // owner: zjf225077 // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public @@ -66,8 +70,7 @@ TEST_F(TestObSimpleLogClusterBasicFunc, submit_log) guard.click("delete"); PALF_LOG(INFO, "end test submit_log", K(id), K(guard)); } - -// test_max_padding_size: 测试padding entry最长的场景(2M+16K+88+4K-1B). +// test_max_padding_size: Test the scenario of the longest padding entry (2M+16K+88+4K-1B). TEST_F(TestObSimpleLogClusterBasicFunc, test_max_padding_size) { SET_CASE_LOG_FILE(TEST_NAME, "max_padding_size"); @@ -87,16 +90,16 @@ TEST_F(TestObSimpleLogClusterBasicFunc, test_max_padding_size) const int64_t group_entry_header_total_size = LogGroupEntryHeader::HEADER_SER_SIZE + LogEntryHeader::HEADER_SER_SIZE; const int64_t max_valid_group_entry_size = MAX_LOG_BODY_SIZE + group_entry_header_total_size; - // padding entry size上限如下,预期不会达到该值,故最大值应该是该值减1Byte + // padding entry size upper limit as follows, it is expected not to reach this value, so the maximum value should be this value minus 1 Byte const int64_t max_padding_entry_size = max_valid_group_entry_size + CLOG_FILE_TAIL_PADDING_TRIGGER; - // 测试写一个最大padding entry的场景 - // 首先写30条2MB的group log + // Test a scenario with a maximum padding entry + // First write 30 group logs of 2MB each EXPECT_EQ(OB_SUCCESS, submit_log(leader, 30, leader_idx, (2 * 1024 * 1024 - group_entry_header_total_size))); - // 接着写文件尾最后一条有效的group entry, 确保文件剩余空间触发生成最大的padding entry + // Write the last valid group entry at the end of the file, ensuring that the remaining space triggers the generation of the largest padding entry EXPECT_EQ(OB_SUCCESS, submit_log(leader, 1, leader_idx, (4 * 1024 * 1024 - MAX_INFO_BLOCK_SIZE - max_valid_group_entry_size - CLOG_FILE_TAIL_PADDING_TRIGGER - group_entry_header_total_size + 1))); - // 提交一个2MB+16KB size的log buf, 触发生成padding + // Submit a 2MB+16KB size log buf, trigger padding generation EXPECT_EQ(OB_SUCCESS, submit_log(leader, 1, leader_idx, MAX_LOG_BODY_SIZE)); - // 预期max_lsn为单个block文件size+最大valid group entry size + // Expected max_lsn to be the single block file size + maximum valid group entry size const LSN expected_max_lsn(PALF_BLOCK_SIZE + max_valid_group_entry_size); guard.click("submit_log for max size padding entry finish"); CLOG_LOG(INFO, "leader submit log finished", K(expected_max_lsn)); @@ -119,8 +122,8 @@ TEST_F(TestObSimpleLogClusterBasicFunc, test_max_padding_size) CLOG_LOG(INFO, "follower_2 wait end_lsn finished", K(expected_max_lsn)); PalfHandleImplGuard &follower_1 = *palf_list[follower_1_idx]; - // follower_1依赖fetch log追日志,但end_lsn无法推到与leader一致 - // 因为这里committed_end_lsn依赖周期性的keepAlive日志推进 + // follower_1 depends on fetch log to follow logs, but end_lsn cannot be pushed to match the leader + // Because here committed_end_lsn depends on the periodic keepAlive log advancement while (follower_1.palf_handle_impl_->get_max_lsn() < expected_max_lsn) { usleep(100 * 1000); } diff --git a/mittest/logservice/test_ob_simple_log_cache.cpp b/mittest/logservice/test_ob_simple_log_cache.cpp index 697effa92..0cf1c808b 100644 --- a/mittest/logservice/test_ob_simple_log_cache.cpp +++ b/mittest/logservice/test_ob_simple_log_cache.cpp @@ -1,16 +1,20 @@ // owner: liuhanyi.lhy // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/logservice/test_ob_simple_log_config_change.cpp b/mittest/logservice/test_ob_simple_log_config_change.cpp index da8273f33..37d16c304 100644 --- a/mittest/logservice/test_ob_simple_log_config_change.cpp +++ b/mittest/logservice/test_ob_simple_log_config_change.cpp @@ -1,16 +1,20 @@ // owner: yunlong.cb // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/logservice/test_ob_simple_log_config_change_mock_ele.cpp b/mittest/logservice/test_ob_simple_log_config_change_mock_ele.cpp index f17b33e40..fbff0602d 100644 --- a/mittest/logservice/test_ob_simple_log_config_change_mock_ele.cpp +++ b/mittest/logservice/test_ob_simple_log_config_change_mock_ele.cpp @@ -1,16 +1,20 @@ // owner: yunlong.cb // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/logservice/test_ob_simple_log_data_intergrity.cpp b/mittest/logservice/test_ob_simple_log_data_intergrity.cpp index ee51eb0ae..98072a6fe 100644 --- a/mittest/logservice/test_ob_simple_log_data_intergrity.cpp +++ b/mittest/logservice/test_ob_simple_log_data_intergrity.cpp @@ -1,16 +1,20 @@ // owner: zjf225077 // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public @@ -144,7 +148,7 @@ TEST_F(TestObSimpleLogDataIntergrity, accumlate_checksum) } EXPECT_EQ(OB_SUCCESS, delete_paxos_group(id)); PALF_LOG(INFO, "runlin trace delete_paxos_group"); - // 模拟最后一条的LogEntry非原子写入(LogEntry没有写入),报错OB_INVALID_DATA, 重启成功,预期log_tail是该日志头 + // Simulate the last LogEntry not being atomically written (LogEntry not written), error OB_INVALID_DATA, restart successful, expected log_tail to be this log header LSN expected_log_tail; { id = ATOMIC_AAF(&palf_id_, 1); @@ -162,7 +166,7 @@ TEST_F(TestObSimpleLogDataIntergrity, accumlate_checksum) EXPECT_EQ(OB_SUCCESS, iterator.next()); EXPECT_EQ(OB_SUCCESS, iterator.get_entry(entry, curr_lsn)); EXPECT_EQ(curr_lsn, max_lsn); - // LogEntry完全被写坏 + // LogEntry is completely corrupted char *output_buf = NULL; int64_t pos = sizeof(LogGroupEntryHeader); DataFaultInject inject = [&pos, &entry](char *buf) { @@ -190,7 +194,7 @@ TEST_F(TestObSimpleLogDataIntergrity, accumlate_checksum) PALF_LOG(INFO, "runlin trace second restart_paxos_groups begin"); EXPECT_EQ(OB_SUCCESS, restart_paxos_groups()); PALF_LOG(INFO, "runlin trace second restart_paxos_groups end"); - // 模拟最后一条的LogEntry非原子写入(LogEntry部分写入, datacheck sum以及后续的数据被写坏为0),报错OB_CHECKSUM_ERROR, 重启成功,预期log_tail是该日志头 + // Simulate the last LogEntry not being atomically written (LogEntry part is written, data checksum and subsequent data are corrupted to 0), error OB_CHECKSUM_ERROR, restart successful, expected log_tail is this log header { PalfHandleImplGuard leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, leader, leader_idx)); @@ -206,7 +210,7 @@ TEST_F(TestObSimpleLogDataIntergrity, accumlate_checksum) EXPECT_EQ(OB_SUCCESS, iterator.next()); EXPECT_EQ(OB_SUCCESS, iterator.get_entry(entry, curr_lsn)); EXPECT_EQ(curr_lsn, max_lsn); - // 模拟LogEntry的datachecsum以及后续的数据被置为全0 + // Simulate LogEntry's data checksum and subsequent data being set to all 0 // LogEntryHeader 16bit(maigc) 16bit(version) 32bit(size) 64bit(scn) datachecsum char *output_buf = NULL; int64_t pos = sizeof(LogGroupEntryHeader) + 16; @@ -236,7 +240,7 @@ TEST_F(TestObSimpleLogDataIntergrity, accumlate_checksum) EXPECT_EQ(OB_SUCCESS, get_leader(id, leader, leader_idx)); EXPECT_EQ(expected_log_tail, leader.palf_handle_impl_->get_max_lsn()); } - // 模拟最后一条的LogEntryHeadr bit位反转, 报错OB_INVALID_DATA, 重启成功,预期log_tail是该日志头 + // Simulate the bit inversion of the last LogEntryHeadr, error OB_INVALID_DATA, restart successful, expected log_tail is this log header { PalfHandleImplGuard leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, leader, leader_idx)); @@ -252,7 +256,7 @@ TEST_F(TestObSimpleLogDataIntergrity, accumlate_checksum) EXPECT_EQ(OB_SUCCESS, iterator.next()); EXPECT_EQ(OB_SUCCESS, iterator.get_entry(entry, curr_lsn)); EXPECT_EQ(curr_lsn, max_lsn); - // 模拟LogEntry的datachecsum以及后续的数据被置为全0 + // Simulate LogEntry's data checksum and subsequent data being set to all 0 // LogEntryHeader 16bit(maigc) 16bit(version) 32bit(size) 64bit(scn) datachecsum char *output_buf = NULL; int64_t pos = sizeof(LogGroupEntryHeader) + 14; @@ -276,7 +280,7 @@ TEST_F(TestObSimpleLogDataIntergrity, accumlate_checksum) PALF_LOG(INFO, "runlin trace fourth restart_paxos_groups begin"); EXPECT_EQ(OB_SUCCESS, restart_paxos_groups()); PALF_LOG(INFO, "runlin trace fourth restart_paxos_groups end"); - // 模拟最后一条的LogGroupEntryHeadr bit位反转, 报错OB_INVALID_DATA, 重启成功,预期log_tail是该日志头 + // Simulate the bit inversion of the last LogGroupEntryHeadr, error OB_INVALID_DATA, restart successfully, expected log_tail is this log header { PalfHandleImplGuard leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, leader, leader_idx)); @@ -292,7 +296,7 @@ TEST_F(TestObSimpleLogDataIntergrity, accumlate_checksum) EXPECT_EQ(OB_SUCCESS, iterator.next()); EXPECT_EQ(OB_SUCCESS, iterator.get_entry(entry, curr_lsn)); EXPECT_EQ(curr_lsn, max_lsn); - // 模拟LogGroupEntryHeader bit位反转 + // Simulate LogGroupEntryHeader bit reversal char *output_buf = NULL; int64_t pos = 14; DataFaultInject inject = [&pos](char *buf) { diff --git a/mittest/logservice/test_ob_simple_log_disk_mgr.cpp b/mittest/logservice/test_ob_simple_log_disk_mgr.cpp index 98817baf3..9d12b6ab6 100755 --- a/mittest/logservice/test_ob_simple_log_disk_mgr.cpp +++ b/mittest/logservice/test_ob_simple_log_disk_mgr.cpp @@ -1,16 +1,20 @@ // owner: zjf225077 // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public @@ -86,7 +90,7 @@ TEST_F(TestObSimpleLogDiskMgr, out_of_disk_space) PALF_LOG(INFO, "out of disk max_lsn", K(max_lsn)); sleep(2); EXPECT_EQ(OB_LOG_OUTOF_DISK_SPACE, submit_log(leader, 1, id, MAX_LOG_BODY_SIZE)); - // shrinking 后继续停写 + // Continue to stop writing after shrinking update_disk_options(leader_idx, MIN_DISK_SIZE_PER_PALF_INSTANCE/PALF_PHY_BLOCK_SIZE); EXPECT_EQ(OB_LOG_OUTOF_DISK_SPACE, submit_log(leader, 1, id, MAX_LOG_BODY_SIZE)); usleep(ObLooper::INTERVAL_US*2); @@ -97,7 +101,7 @@ TEST_F(TestObSimpleLogDiskMgr, update_disk_options_basic) SET_CASE_LOG_FILE(TEST_NAME, "update_disk_options_basic"); OB_LOGGER.set_log_level("INFO"); const int64_t id = ATOMIC_AAF(&palf_id_, 1); - // 将日志盘空间设置为10GB + // Set the log disk space to 10GB update_disk_options(10*1024*1024*1024ul/PALF_PHY_BLOCK_SIZE); sleep(2); PALF_LOG(INFO, "start update_disk_options_basic", K(id)); @@ -106,8 +110,7 @@ TEST_F(TestObSimpleLogDiskMgr, update_disk_options_basic) PalfEnv *palf_env = NULL; EXPECT_EQ(OB_SUCCESS, create_paxos_group(id, leader_idx, leader)); EXPECT_EQ(OB_SUCCESS, get_palf_env(leader_idx, palf_env)); - - // 提交1G的日志 + // Submit 1G of logs EXPECT_EQ(OB_SUCCESS, submit_log(leader, 500, id, log_entry_size)); EXPECT_EQ(OB_SUCCESS, wait_lsn_until_flushed(leader.palf_handle_impl_->get_max_lsn(), leader)); @@ -117,28 +120,27 @@ TEST_F(TestObSimpleLogDiskMgr, update_disk_options_basic) palf_env->palf_env_impl_.disk_options_wrapper_.status_); EXPECT_EQ(palf_env->palf_env_impl_.disk_options_wrapper_.disk_opts_for_recycling_blocks_.log_disk_usage_limit_size_, 20*PALF_PHY_BLOCK_SIZE); - - // case1: 在上一次未缩容完成之前,可以继续缩容 + // case1: before the last scaling down is completed, you can continue to scale down EXPECT_EQ(OB_SUCCESS, update_disk_options(leader_idx, 10)); sleep(2); EXPECT_EQ(PalfDiskOptionsWrapper::Status::SHRINKING_STATUS, palf_env->palf_env_impl_.disk_options_wrapper_.status_); EXPECT_EQ(palf_env->palf_env_impl_.disk_options_wrapper_.disk_opts_for_recycling_blocks_.log_disk_usage_limit_size_, 10*PALF_PHY_BLOCK_SIZE); - // 此时日志盘依旧未完成缩容,ObSimpleLogServer维护的disk_opts_依旧是10GB + // At this time, the log disk has not yet completed the reduction, ObSimpleLogServer maintains the disk_opts_ as 10GB { PalfDiskOptions opts; EXPECT_EQ(OB_SUCCESS, get_disk_options(leader_idx, opts)); EXPECT_EQ(opts.log_disk_usage_limit_size_, 10*1024*1024*1024ul); } - // case2: 在上一次未缩容完成之前,可以继续扩容, 同时由于扩容后日志盘依旧小于第一次缩容,因此依旧处于缩容状态. + // case2: before the previous shrink operation is completed, you can continue to expand, at the same time, since the log disk is still smaller than the first shrink after expansion, it remains in the shrinking state. EXPECT_EQ(OB_SUCCESS, update_disk_options(leader_idx, 11)); sleep(2); EXPECT_EQ(PalfDiskOptionsWrapper::Status::SHRINKING_STATUS, palf_env->palf_env_impl_.disk_options_wrapper_.status_); EXPECT_EQ(palf_env->palf_env_impl_.disk_options_wrapper_.disk_opts_for_recycling_blocks_.log_disk_usage_limit_size_, 11*PALF_PHY_BLOCK_SIZE); - // 此时日志盘依旧未完成缩容,ObSimpleLogServer维护的disk_opts_依旧是10GB + // At this time, the log disk has not yet completed the reduction, ObSimpleLogServer maintains the disk_opts_ as 10GB { PalfDiskOptions opts; EXPECT_EQ(OB_SUCCESS, get_disk_options(leader_idx, opts)); @@ -161,7 +163,7 @@ TEST_F(TestObSimpleLogDiskMgr, update_disk_options_basic) palf_env->palf_env_impl_.disk_options_wrapper_.status_); EXPECT_EQ(palf_env->palf_env_impl_.disk_options_wrapper_.disk_opts_for_stopping_writing_.log_disk_usage_limit_size_, 11*PALF_PHY_BLOCK_SIZE); - // 等待后台线程再次执行update_disk_options操作,预期本地持久化的disk_opts会变为11*PALF_PHY_BLOCK_SIZE + // Wait for the background thread to execute the update_disk_options operation again, expect the locally persisted disk_opts to become 11*PALF_PHY_BLOCK_SIZE { sleep(2); PalfDiskOptions opts; @@ -174,8 +176,8 @@ TEST_F(TestObSimpleLogDiskMgr, shrink_log_disk) { SET_CASE_LOG_FILE(TEST_NAME, "shrink_log_disk"); OB_LOGGER.set_log_level("INFO"); - // 验证缩容由于单日志流最少需要512MB日志盘失败 - // 保证能同时容纳两个日志流 + // Validate that scaling down fails due to the minimum requirement of 512MB log disk for a single log stream + // Ensure that it can accommodate two log streams simultaneously PalfEnv *palf_env = NULL; int64_t leader_idx = 0; PalfHandleImplGuard leader; @@ -206,7 +208,7 @@ TEST_F(TestObSimpleLogDiskMgr, update_disk_options_restart) disable_hot_cache_ = true; SET_CASE_LOG_FILE(TEST_NAME, "update_disk_options_restart"); OB_LOGGER.set_log_level("INFO"); - // 扩容操作 + // Expansion operation EXPECT_EQ(OB_SUCCESS, update_disk_options(10*1024*1024*1024ul/PALF_PHY_BLOCK_SIZE)); sleep(2); const int64_t id = ATOMIC_AAF(&palf_id_, 1); @@ -227,13 +229,13 @@ TEST_F(TestObSimpleLogDiskMgr, update_disk_options_restart) EXPECT_EQ(10*1024*1024*1024ul, palf_env->palf_env_impl_.disk_options_wrapper_.disk_opts_for_recycling_blocks_.log_disk_usage_limit_size_); } - // 产生10个文件的数据 + // Generate data for 10 files EXPECT_EQ(OB_SUCCESS, submit_log(leader, 10*32, id, log_entry_size)); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(leader, leader.palf_handle_impl_->get_max_lsn())); - // 最小的log_disk_size要求是存在8个日志文件 + // The minimum log_disk_size requirement is to have 8 log files EXPECT_EQ(OB_SUCCESS, update_disk_options(leader_idx, 8)); sleep(2); - // 宕机前,缩容不会正式生效,因此不会导致停写 + // Before shutdown, scaling down will not take effect officially, therefore it will not cause write stoppage EXPECT_EQ(true, palf_env->palf_env_impl_.diskspace_enough_); EXPECT_EQ(PalfDiskOptionsWrapper::Status::SHRINKING_STATUS, palf_env->palf_env_impl_.disk_options_wrapper_.status_); @@ -241,25 +243,25 @@ TEST_F(TestObSimpleLogDiskMgr, update_disk_options_restart) int64_t log_disk_usage, total_log_disk_size; EXPECT_EQ(OB_SUCCESS, palf_env->palf_env_impl_.get_disk_usage(log_disk_usage, total_log_disk_size)); PALF_LOG(INFO, "log_disk_usage:", K(log_disk_usage), K(total_log_disk_size)); - // 缩容未成功前,log_disk_usage_limit_size_依旧保持10G. - // 本地持久化的log_disk_size为10G - // 内部表中持久化的log_disk_size为8*PALF_PHY_BLOCK_SIZE + // Before the downsizing is successful, log_disk_usage_limit_size_ still remains at 10G. + // The locally persisted log_disk_size is 10G + // The persisted log_disk_size in the internal table is 8*PALF_PHY_BLOCK_SIZE PalfDiskOptions opts; EXPECT_EQ(OB_SUCCESS, get_disk_options(leader_idx, opts)); EXPECT_EQ(opts.log_disk_usage_limit_size_, 10*1024*1024*1024ul); } - // 物理缩容未成功前,宕机重启预期不会停写 + // Physical shrink not successful yet, expected that shutdown restart will not stop writing EXPECT_EQ(OB_SUCCESS, restart_paxos_groups()); { - // 内部表中持久化的log_disk_size依旧是8*PALF_PHY_BLOCK_SIZE - // 重启后继续缩容 + // The log_disk_size persisted in the internal table is still 8*PALF_PHY_BLOCK_SIZE + // Restart and continue scaling down int64_t log_disk_usage, total_log_disk_size; EXPECT_EQ(OB_SUCCESS, get_palf_env(leader_idx, palf_env)); usleep(2*1000*1000 + BlockGCTimerTask::BLOCK_GC_TIMER_INTERVAL_MS); EXPECT_EQ(true, palf_env->palf_env_impl_.diskspace_enough_); EXPECT_EQ(PalfDiskOptionsWrapper::Status::SHRINKING_STATUS, palf_env->palf_env_impl_.disk_options_wrapper_.status_); - // 本地持久化的(slog)记录的依旧是10G,因此不会停写 + // Locally persisted (slog) records are still 10G, therefore writing will not stop EXPECT_EQ(10*1024*1024*1024ul, palf_env->palf_env_impl_.disk_options_wrapper_.disk_opts_for_stopping_writing_.log_disk_usage_limit_size_); EXPECT_EQ(OB_SUCCESS, palf_env->palf_env_impl_.get_disk_usage(log_disk_usage, total_log_disk_size)); PALF_LOG(INFO, "log_disk_usage:", K(log_disk_usage), K(total_log_disk_size)); @@ -273,20 +275,19 @@ TEST_F(TestObSimpleLogDiskMgr, update_disk_options_restart) PalfDiskOptions opts; EXPECT_EQ(OB_SUCCESS, get_disk_options(leader_idx, opts)); EXPECT_EQ(opts.log_disk_usage_limit_size_, 10*1024*1024*1024ul); - - // 物理上保证不缩容,内部表中持久化的变为16*PALF_PHY_BLOCK_SIZE, 由于palf的log_disk_size是10G, - // 因此本次对palf是一次缩容操作. 但下一轮GC任务运行时,发现当前的使用的日志盘空间不会导致停写, - // 于是日志盘变为正常状态 + // Physically ensure no shrinking, the persisted internal table becomes 16*PALF_PHY_BLOCK_SIZE, since palf's log_disk_size is 10G, + // Therefore this operation is a shrink for palf. But when the next GC task runs, it finds that the currently used log disk space will not cause a stop write, + // Thus the log disk became normal status EXPECT_EQ(OB_SUCCESS, update_disk_options(leader_idx, 16)); - // 在下一轮GC任务运行后,本地持久化的log_disk_size也会变为16*PALF_PHY_BLOCK_SIZE + // After the next round of GC task runs, the locally persisted log_disk_size will also become 16*PALF_PHY_BLOCK_SIZE usleep(2*1000*1000+palf::BlockGCTimerTask::BLOCK_GC_TIMER_INTERVAL_MS); - // 经过一轮GC后,会变为NORMAL_STATUS + // After one round of GC, it will become NORMAL_STATUS EXPECT_EQ(true, palf_env->palf_env_impl_.diskspace_enough_); EXPECT_EQ(PalfDiskOptionsWrapper::Status::NORMAL_STATUS, palf_env->palf_env_impl_.disk_options_wrapper_.status_); EXPECT_EQ(16*PALF_PHY_BLOCK_SIZE, palf_env->palf_env_impl_.disk_options_wrapper_.disk_opts_for_recycling_blocks_.log_disk_usage_limit_size_); - // 后台线程会完成缩容操作,最终本地持久化的变为16*PALF_PHY_BLOCK_SIZE + // The background thread will complete the scaling down operation, ultimately making the local persistence 16*PALF_PHY_BLOCK_SIZE usleep(2*1000*1000+ObLooper::INTERVAL_US*2); EXPECT_EQ(OB_SUCCESS, get_disk_options(leader_idx, opts)); EXPECT_EQ(opts.log_disk_usage_limit_size_, 16*PALF_PHY_BLOCK_SIZE); @@ -301,7 +302,7 @@ TEST_F(TestObSimpleLogDiskMgr, overshelling) ObServerLogBlockMgr *log_pool = nullptr; EXPECT_EQ(OB_SUCCESS, get_log_pool(0, log_pool)); ASSERT_NE(nullptr, log_pool); - // 验证扩缩容场景下的LogPool字段的正确性 + // Validate the correctness of the LogPool field in the scaling scenario EXPECT_EQ(16*PALF_PHY_BLOCK_SIZE, log_pool->min_log_disk_size_for_all_tenants_); const int64_t id = ATOMIC_AAF(&palf_id_, 1); int64_t leader_idx = 0; @@ -312,25 +313,23 @@ TEST_F(TestObSimpleLogDiskMgr, overshelling) } EXPECT_EQ(OB_SUCCESS, update_disk_options(leader_idx, 15)); int64_t log_disk_size_used_for_tenants = log_pool->min_log_disk_size_for_all_tenants_; - // 缩容还未成功,预期log_disk_size_used_for_tenants一定是16*PALF_PHY_BLOCK_SIZE + // Shrink has not been successful yet, expected log_disk_size_used_for_tenants must be 16*PALF_PHY_BLOCK_SIZE PalfDiskOptions opts; EXPECT_EQ(OB_SUCCESS, get_disk_options(leader_idx, opts)); if (opts.log_disk_usage_limit_size_ == 16*PALF_PHY_BLOCK_SIZE) { EXPECT_EQ(16*PALF_PHY_BLOCK_SIZE, log_disk_size_used_for_tenants); - // 缩容不会立马生效 + // Shrinking will not take effect immediately usleep(2*1000*1000+ObLooper::INTERVAL_US*2); EXPECT_EQ(15*PALF_PHY_BLOCK_SIZE, log_pool->min_log_disk_size_for_all_tenants_); } else { PALF_LOG(INFO, "update_disk_options successfully", K(log_disk_size_used_for_tenants), K(opts)); } - - // 扩容预期立马成功 + // Expansion expected to succeed immediately EXPECT_EQ(OB_SUCCESS, update_disk_options(leader_idx, 16)); EXPECT_EQ(OB_SUCCESS, get_disk_options(leader_idx, opts)); EXPECT_EQ(16*PALF_PHY_BLOCK_SIZE, log_disk_size_used_for_tenants); EXPECT_EQ(16*PALF_PHY_BLOCK_SIZE, opts.log_disk_usage_limit_size_); - - // 直接扩容为LogPool上限值 + // Directly expand to the upper limit value of LogPool const int64_t limit_log_disk_size = log_pool->log_pool_meta_.curr_total_size_; EXPECT_EQ(OB_SUCCESS, update_disk_options(leader_idx, limit_log_disk_size/PALF_PHY_BLOCK_SIZE)); EXPECT_EQ(OB_SUCCESS, get_disk_options(leader_idx, opts)); @@ -341,11 +340,11 @@ TEST_F(TestObSimpleLogDiskMgr, overshelling) { PalfHandleImplGuard leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, leader, leader_idx)); - // 生成10个文件 + // Generate 10 files EXPECT_EQ(OB_SUCCESS, submit_log(leader, 10*32, id, log_entry_size)); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(leader, leader.palf_handle_impl_->get_max_lsn())); EXPECT_EQ(OB_SUCCESS, update_disk_options(leader_idx, 10)); - // 缩容一定不会成功,租户日志盘规格依旧为上限值 + // Shrinking will definitely not succeed, tenant log disk specification remains at the upper limit value usleep(2*1000*1000+ObLooper::INTERVAL_US * 2); EXPECT_EQ(OB_SUCCESS, get_palf_env(leader_idx, palf_env)); EXPECT_EQ(PalfDiskOptionsWrapper::Status::SHRINKING_STATUS, @@ -369,8 +368,7 @@ TEST_F(TestObSimpleLogDiskMgr, overshelling) EXPECT_EQ(10*PALF_PHY_BLOCK_SIZE, opts.log_disk_usage_limit_size_); EXPECT_EQ(OB_SUCCESS, log_pool->create_tenant(MIN_DISK_SIZE_PER_PALF_INSTANCE)); log_pool->abort_create_tenant(MIN_DISK_SIZE_PER_PALF_INSTANCE); - - // 扩容预计一定成功 + // Expansion is expected to succeed EXPECT_EQ(OB_SUCCESS, update_disk_options(leader_idx, limit_log_disk_size/PALF_PHY_BLOCK_SIZE)); EXPECT_EQ(PalfDiskOptionsWrapper::Status::NORMAL_STATUS, palf_env->palf_env_impl_.disk_options_wrapper_.status_); @@ -405,7 +403,7 @@ TEST_F(TestObSimpleLogDiskMgr, hidden_sys) } EXPECT_EQ(OB_SUCCESS, delete_paxos_group(id)); EXPECT_EQ(OB_SUCCESS, update_disk_options(0)); - // tenant unit中记录的disk_opts直接生效 + // disk_opts recorded in tenant unit take effect directly PalfDiskOptions disk_opts; EXPECT_EQ(OB_SUCCESS, get_disk_options(0, disk_opts)); EXPECT_EQ(0, disk_opts.log_disk_usage_limit_size_); diff --git a/mittest/logservice/test_ob_simple_log_engine.cpp b/mittest/logservice/test_ob_simple_log_engine.cpp index 01cfe4a6c..b4dfa2ac9 100644 --- a/mittest/logservice/test_ob_simple_log_engine.cpp +++ b/mittest/logservice/test_ob_simple_log_engine.cpp @@ -1,16 +1,20 @@ // owner: zjf225077 // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public @@ -179,8 +183,7 @@ std::string ObSimpleLogClusterTestBase::test_name_ = TEST_NAME; bool ObSimpleLogClusterTestBase::need_add_arb_server_ = false; bool ObSimpleLogClusterTestBase::need_shared_storage_ = false; int64_t log_entry_size = 2 * 1024 * 1024 + 16 * 1024; - -// 验证flashback过程中宕机重启 +// Validate flashback process during shutdown and restart TEST_F(TestObSimpleLogClusterLogEngine, flashback_restart) { SET_CASE_LOG_FILE(TEST_NAME, "flashback_restart"); @@ -309,12 +312,11 @@ TEST_F(TestObSimpleLogClusterLogEngine, exception_path) EXPECT_EQ(OB_SUCCESS, log_storage->get_block_id_range(min_block_id, max_block_id)); EXPECT_EQ(0, min_block_id); EXPECT_EQ(11, max_block_id); - - // 测试truncate场景 + // Test truncate scenario block_id_t truncate_block_id = max_block_id - 2; EXPECT_EQ(OB_SUCCESS, log_storage->truncate(LSN(truncate_block_id * PALF_BLOCK_SIZE))); EXPECT_EQ(OB_SUCCESS, log_storage->get_block_id_range(min_block_id, max_block_id)); - // 此时最后一个block是空的 + // At this point the last block is empty EXPECT_EQ(log_storage->log_tail_, LSN(truncate_block_id * PALF_BLOCK_SIZE)); EXPECT_EQ(truncate_block_id, max_block_id); EXPECT_EQ(lsn_2_block(log_engine_->log_meta_storage_.log_block_header_.min_lsn_, PALF_BLOCK_SIZE), truncate_block_id + 1); @@ -341,16 +343,14 @@ TEST_F(TestObSimpleLogClusterLogEngine, exception_path) LSN log_tail = log_engine_->log_storage_.log_tail_; share::SCN ts_origin = scn_11; PALF_LOG(INFO, "after second write_several_blocks 1", K(truncate_block_id), K(max_block_id)); - // 由于truncate之后,最后一个文件是空的,因此max_block_id = truncate_block_id + // Since the last file is empty after truncate, therefore max_block_id = truncate_block_id EXPECT_EQ(OB_SUCCESS, write_several_blocks(0, 1)); EXPECT_EQ(OB_SUCCESS, log_storage->get_block_min_scn(truncate_block_id, scn_11)); EXPECT_NE(scn_11, ts_origin); - - // 测试重启场景 + // Test restart scenario EXPECT_EQ(OB_SUCCESS, reload(log_engine_->log_storage_.log_tail_, log_engine_->log_meta_storage_.log_tail_, log_engine_->log_meta_.log_snapshot_meta_.base_lsn_)); PALF_LOG(INFO, "after reload1"); - - //测试truncate_prefix 场景 + // Test truncate_prefix scenario block_id_t truncate_prefix_block_id = 4; prev_log_info.lsn_ = LSN(truncate_prefix_block_id*PALF_BLOCK_SIZE)-100; prev_log_info.log_id_ = 0; @@ -362,14 +362,13 @@ TEST_F(TestObSimpleLogClusterLogEngine, exception_path) EXPECT_EQ(OB_SUCCESS, log_engine_->append_log_meta_(log_engine_->log_meta_)); EXPECT_EQ(OB_SUCCESS, log_storage->truncate_prefix_blocks(LSN(truncate_prefix_block_id * PALF_BLOCK_SIZE))); - // 测试truncate_prefix后,继续写一个block + // Test truncate_prefix after, continue to write a block write_several_blocks(0, 1); EXPECT_EQ(OB_SUCCESS, log_storage->get_block_id_range(min_block_id, max_block_id)); EXPECT_EQ(truncate_prefix_block_id, min_block_id); EXPECT_EQ(truncate_block_id+2, max_block_id); - - // 测试目录清空场景,此时log_tail应该为truncate_prefix_block_id - // 目录清空之后,会重置log_tail + // Test directory clear scenario, at this point log_tail should be truncate_prefix_block_id + // Directory cleared, log_tail will be reset truncate_prefix_block_id = max_block_id + 2; LSN new_base_lsn(truncate_prefix_block_id*PALF_BLOCK_SIZE); prev_log_info.lsn_ = new_base_lsn - 100; @@ -383,14 +382,13 @@ TEST_F(TestObSimpleLogClusterLogEngine, exception_path) const LSN old_log_tail = log_engine_->log_storage_.log_tail_; EXPECT_EQ(OB_SUCCESS, log_engine_->truncate_prefix_blocks(new_base_lsn)); EXPECT_EQ(OB_ENTRY_NOT_EXIST, log_storage->get_block_id_range(min_block_id, max_block_id)); - // truncate_prefix_block_id 和 prev_lsn对应的block_id一样 + // truncate_prefix_block_id and prev_lsn corresponding block_id are the same EXPECT_EQ(log_storage->log_tail_, LSN(truncate_prefix_block_id * PALF_BLOCK_SIZE)); - // truncate_prefxi_blocks后,min_block_info被置为无效 + // after truncate_prefix_blocks, min_block_info is set to invalid EXPECT_EQ(false, is_valid_block_id(log_engine_->min_block_id_)); EXPECT_EQ(false, log_engine_->min_block_min_scn_.is_valid()); EXPECT_EQ(false, log_engine_->min_block_max_scn_.is_valid()); - - // 测试目录清空后,读数据是否正常报错 + // Test directory cleared, is data read error reported normally ReadBufGuard buf_guard("dummy", 100); int64_t out_read_size; LogIOContext io_ctx(LogIOUser::DEFAULT); @@ -406,7 +404,7 @@ TEST_F(TestObSimpleLogClusterLogEngine, exception_path) buf_guard.read_buf_, out_read_size, io_ctx)); - // 测试目录清空后,重启是否正常 + // Test directory cleared, does restart work normally EXPECT_EQ(OB_SUCCESS, reload(log_engine_->log_storage_.log_tail_, log_engine_->log_meta_storage_.log_tail_, log_engine_->log_meta_.log_snapshot_meta_.base_lsn_)); { block_id_t tmp_block_id = LOG_INVALID_BLOCK_ID; @@ -415,8 +413,8 @@ TEST_F(TestObSimpleLogClusterLogEngine, exception_path) } PALF_LOG(INFO, "directory is empty"); - // 测试目录清空后,写数据是否正常 - // 此时log_tail为truncate_prefix_block_id的头部 + // Test directory cleared, is data writing normal + // At this time log_tail is the head of truncate_prefix_block_id const block_id_t expected_min_block_id = lsn_2_block(log_storage->log_tail_, log_storage->logical_block_size_); EXPECT_EQ(OB_SUCCESS, write_several_blocks(expected_min_block_id, 3)); EXPECT_EQ(OB_SUCCESS, log_storage->get_block_id_range(min_block_id, max_block_id)); @@ -424,8 +422,7 @@ TEST_F(TestObSimpleLogClusterLogEngine, exception_path) EXPECT_EQ(expected_min_block_id+3, max_block_id); share::SCN scn_cur; EXPECT_EQ(OB_SUCCESS, log_engine_->get_block_min_scn(max_block_id, scn_cur)); - - // 测试人为删除文件的重启场景 + // Test the restart scenario when a file is manually deleted EXPECT_EQ(OB_SUCCESS, log_engine_->get_block_id_range(min_block_id, max_block_id)); EXPECT_EQ(OB_SUCCESS, delete_block_by_human(max_block_id)); EXPECT_EQ(OB_ERR_UNEXPECTED, reload(log_engine_->log_storage_.log_tail_, log_engine_->log_meta_storage_.log_tail_, log_engine_->log_meta_.log_snapshot_meta_.base_lsn_)); @@ -460,8 +457,8 @@ TEST_F(TestObSimpleLogClusterLogEngine, io_reducer_basic_func) LogEngine *log_engine = &leader_1.palf_handle_impl_->log_engine_; IOTaskCond io_task_cond_1(id_1, log_engine->palf_epoch_); IOTaskVerify io_task_verify_1(id_1, log_engine->palf_epoch_); - // 单日志流场景 - // 卡住log_io_worker的处理 + // Single log stream scenario + // Block the processing of log_io_worker { EXPECT_EQ(OB_SUCCESS, log_io_worker->submit_io_task(&io_task_cond_1)); EXPECT_EQ(OB_SUCCESS, submit_log(leader_1, 1024, id_1, 110)); @@ -470,13 +467,13 @@ TEST_F(TestObSimpleLogClusterLogEngine, io_reducer_basic_func) io_task_cond_1.cond_.signal(); wait_lsn_until_flushed(max_lsn, leader_1); EXPECT_EQ(OB_ITER_END, read_log(leader_1)); - // sw内部做了自适应freeze之后这个等式可能不成立, 因为上层可能基于写盘反馈触发提交下一个io_task + // After sw performs adaptive freeze internally, this equation may not hold, because the upper layer may trigger submission of the next io_task based on disk write feedback prev_log_id_1 = log_id; } - // 单日志流场景 - // 当聚合度为1的时候,应该走正常的提交流程,目前暂未实现,先通过has_batched_size不计算绕过 + // Single log stream scenario + // When the aggregation degree is 1, the normal submission process should be followed, which is currently not implemented, so we bypass it by not calculating through has_batched_size { - // 聚合度为1的忽略 + // Aggregation degree of 1 is ignored EXPECT_EQ(OB_SUCCESS, log_io_worker->submit_io_task(&io_task_cond_1)); EXPECT_EQ(OB_SUCCESS, submit_log(leader_1, 1, id_1, 110)); sleep(1); @@ -490,8 +487,7 @@ TEST_F(TestObSimpleLogClusterLogEngine, io_reducer_basic_func) EXPECT_EQ(2, io_task_verify_1.count_); prev_log_id_1 = log_id; } - - // 多日志流场景 + // Multi-log stream scenario int64_t id_2 = ATOMIC_AAF(&palf_id_, 1); int64_t prev_log_id_2 = 0; int64_t leader_idx_2 = 0; @@ -501,7 +497,7 @@ TEST_F(TestObSimpleLogClusterLogEngine, io_reducer_basic_func) IOTaskVerify io_task_verify_2(id_2, leader_2.get_palf_handle_impl()->log_engine_.palf_epoch_); { LogIOWorker *log_io_worker = leader_2.palf_handle_impl_->log_engine_.log_io_worker_; - // 聚合度为1的忽略 + // Aggregation degree of 1 is ignored EXPECT_EQ(OB_SUCCESS, log_io_worker->submit_io_task(&io_task_cond_2)); EXPECT_EQ(OB_SUCCESS, submit_log(leader_1, 1, id_1, 110)); EXPECT_EQ(OB_SUCCESS, submit_log(leader_2, 1, id_2, 110)); @@ -522,14 +518,12 @@ TEST_F(TestObSimpleLogClusterLogEngine, io_reducer_basic_func) wait_lsn_until_flushed(max_lsn_2, leader_2); EXPECT_EQ(3, io_task_verify_1.count_); EXPECT_EQ(1, io_task_verify_2.count_); - - // ls1已经有个一个log_id被忽略聚合了 + // ls1 already has a log_id that was ignored during aggregation prev_log_id_2 = log_id_2; prev_log_id_1 = log_id_1; } - - // 三个日志流,stripe为2 - // 目前不支持可配的LogIOWorkerConfig,此测试暂时不打开,但结果是对的 + // three log streams, stripe is 2 + // Currently does not support configurable LogIOWorkerConfig, this test is temporarily not enabled, but the result is correct // int64_t id_3 = ATOMIC_AAF(&palf_id_, 1); // int64_t leader_idx_3 = 0; // int64_t prev_log_id_3 = 0; @@ -557,7 +551,7 @@ TEST_F(TestObSimpleLogClusterLogEngine, io_reducer_basic_func) // wait_lsn_until_flushed(max_lsn_2, leader_2); // wait_lsn_until_flushed(max_lsn_3, leader_3); // } - // 验证切文件场景 + // Validate the split file scenario int64_t id_3 = ATOMIC_AAF(&palf_id_, 1); int64_t leader_idx_3 = 0; int64_t prev_log_id_3 = 0; @@ -602,8 +596,7 @@ TEST_F(TestObSimpleLogClusterLogEngine, io_reducer_basic_func) wait_lsn_until_flushed(max_lsn_1, leader_1); EXPECT_EQ(OB_ITER_END, read_log(leader_1)); } - - // 测试epoch change + // test epoch change PALF_LOG(INFO, "begin test epoch change"); int64_t id_4 = ATOMIC_AAF(&palf_id_, 1); int64_t leader_idx_4 = 0; @@ -620,8 +613,8 @@ TEST_F(TestObSimpleLogClusterLogEngine, io_reducer_basic_func) LSN max_lsn = leader_4.palf_handle_impl_->sw_.get_max_lsn(); io_task_cond_4.cond_.signal(); PALF_LOG(INFO, "after signal"); - // signal之后需要sleep一会等前面的日志都提交给io_worker, - // 否则在反馈模式下, 这批日志可能会延迟submit, 排在下一个cond task后面 + // After signal, need to sleep for a while to wait for all previous logs to be submitted to io_worker, + // Otherwise in feedback mode, this batch of logs may be delayed submit, placed after the next cond task sleep(1); wait_lsn_until_flushed(max_lsn, leader_4); EXPECT_EQ(OB_SUCCESS, log_io_worker->submit_io_task(&io_task_cond_4)); @@ -636,8 +629,7 @@ TEST_F(TestObSimpleLogClusterLogEngine, io_reducer_basic_func) PALF_LOG(INFO, "after flused case 4", K(max_lsn), K(log_tail)); EXPECT_EQ(max_lsn, log_tail); } - - // 测试truncate + // test truncate PALF_LOG(INFO, "begin test truncate"); int64_t id_5 = ATOMIC_AAF(&palf_id_, 1); int64_t leader_idx_5 = 0; @@ -653,7 +645,7 @@ TEST_F(TestObSimpleLogClusterLogEngine, io_reducer_basic_func) EXPECT_EQ(OB_SUCCESS, submit_log(leader_5, 10, id_5, 110)); LSN max_lsn = leader_5.palf_handle_impl_->sw_.get_max_lsn(); sleep(2); - // 在提交truncate log task之前需先等待之前的日志提交写盘 + // Before submitting the truncate log task, you need to wait for the previous log submission to be written to disk io_task_cond_5.cond_.signal(); wait_lsn_until_flushed(max_lsn, leader_5); EXPECT_EQ(OB_SUCCESS, leader_5.palf_handle_impl_->log_engine_.submit_truncate_log_task(ctx)); @@ -666,8 +658,8 @@ TEST_F(TestObSimpleLogClusterLogEngine, io_reducer_basic_func) } PALF_LOG(INFO, "begin test sw full case"); - // 测试滑动窗口满场景 - // 聚合的两条日志分别在头尾部 + // Test sliding window full scenario + // The aggregated two logs are at the beginning and end respectively int64_t id_6 = ATOMIC_AAF(&palf_id_, 1); int64_t leader_idx_6 = 0; int64_t prev_log_id_6 = 0; @@ -725,7 +717,7 @@ TEST_F(TestObSimpleLogClusterLogEngine, io_reducer_basic_func) TEST_F(TestObSimpleLogClusterLogEngine, limit_reduce_task) { SET_CASE_LOG_FILE(TEST_NAME, "limit_reduce_task"); - // 验证限制单个reduce task size为1M + // Validate the restriction of a single reduce task size to 1M int64_t id_7 = ATOMIC_AAF(&palf_id_, 1); int64_t leader_idx_7 = 0; int64_t prev_log_id_7 = 0; @@ -738,8 +730,8 @@ TEST_F(TestObSimpleLogClusterLogEngine, limit_reduce_task) BatchLogIOFlushLogTask::SINGLE_TASK_MAX_SIZE = 1*1024*1024; LogIOWorker *log_io_worker = leader_7.palf_handle_impl_->log_engine_.log_io_worker_; log_io_worker->batch_io_task_mgr_.handle_count_ = 0; - // case1: 测试单条日志超过SINGLE_TASK_MAX_SIZE - // 阻塞提交 + // case1: test single log exceeds SINGLE_TASK_MAX_SIZE + // Block submission EXPECT_EQ(OB_SUCCESS, log_io_worker->submit_io_task(&io_task_cond_7)); EXPECT_EQ(OB_SUCCESS, submit_log(leader_7, 15, id_7, log_entry_size)); io_task_cond_7.cond_.signal(); @@ -747,13 +739,12 @@ TEST_F(TestObSimpleLogClusterLogEngine, limit_reduce_task) LSN max_lsn = leader_7.palf_handle_impl_->sw_.get_max_lsn(); wait_lsn_until_flushed(max_lsn, leader_7); } - // 单条日志超过SINGLE_TASK_MAX_SIZE,会reduce一次, 第二条日志不会被reduce + // A single log exceeding SINGLE_TASK_MAX_SIZE will trigger one reduce, the second log will not be reduced EXPECT_EQ(8, log_io_worker->batch_io_task_mgr_.handle_count_); PALF_LOG(INFO, "case 2"); - - // case2:测试日志大小混合场景 - // 阻塞提交 + // case2: test log size mixed scenario + // Block submission EXPECT_EQ(OB_SUCCESS, log_io_worker->submit_io_task(&io_task_cond_7)); EXPECT_EQ(OB_SUCCESS, submit_log(leader_7, 15, id_7, 1024)); io_task_cond_7.cond_.signal(); @@ -778,8 +769,7 @@ TEST_F(TestObSimpleLogClusterLogEngine, limit_reduce_task) EXPECT_EQ(prev_handle_count+1, log_io_worker->batch_io_task_mgr_.handle_count_); prev_handle_count = log_io_worker->batch_io_task_mgr_.handle_count_; PALF_LOG(INFO, "after first LT"); - - // case3:测试小日志场景 + // case3: test small log scenario EXPECT_EQ(OB_SUCCESS, log_io_worker->submit_io_task(&io_task_cond_7)); EXPECT_EQ(OB_SUCCESS, submit_log(leader_7, 30, id_7, 1024)); io_task_cond_7.cond_.signal(); diff --git a/mittest/logservice/test_ob_simple_log_fast_rebuild.cpp b/mittest/logservice/test_ob_simple_log_fast_rebuild.cpp index c9a9d53f9..5b538ed1b 100644 --- a/mittest/logservice/test_ob_simple_log_fast_rebuild.cpp +++ b/mittest/logservice/test_ob_simple_log_fast_rebuild.cpp @@ -1,16 +1,20 @@ // owner: yunlong.cb // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/logservice/test_ob_simple_log_flashback.cpp b/mittest/logservice/test_ob_simple_log_flashback.cpp index 8be0dc106..aec6d66af 100644 --- a/mittest/logservice/test_ob_simple_log_flashback.cpp +++ b/mittest/logservice/test_ob_simple_log_flashback.cpp @@ -1,15 +1,21 @@ // owner: yunlong.cb // owner group: log -// Copyright (c) 2021 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define private public #include "env/ob_simple_log_cluster_env.h" diff --git a/mittest/logservice/test_ob_simple_log_flashback_arb.cpp b/mittest/logservice/test_ob_simple_log_flashback_arb.cpp index b65e13af0..f1a2f7541 100644 --- a/mittest/logservice/test_ob_simple_log_flashback_arb.cpp +++ b/mittest/logservice/test_ob_simple_log_flashback_arb.cpp @@ -1,15 +1,21 @@ // owner: yunlong.cb // owner group: log -// Copyright (c) 2021 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define private public #include "env/ob_simple_log_cluster_env.h" diff --git a/mittest/logservice/test_ob_simple_log_iterator_performance.cpp b/mittest/logservice/test_ob_simple_log_iterator_performance.cpp index 2f921662b..089015928 100644 --- a/mittest/logservice/test_ob_simple_log_iterator_performance.cpp +++ b/mittest/logservice/test_ob_simple_log_iterator_performance.cpp @@ -1,16 +1,20 @@ // owner: zjf225077 // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public @@ -24,8 +28,7 @@ #include "log/ob_shared_log_utils.h" #endif #include "share/resource_manager/ob_resource_manager.h" // ObResourceManager - -// 测试OSS需要设置如下几个环境变量 +// Testing OSS requires setting the following environment variables //export BUCKET=xxxx //export ENDPOINT=xxxx //export ACCESS_ID=xxxx @@ -355,7 +358,7 @@ TEST_F(TestObSimpleLogSharedStorage, iterator_performance) EXPECT_EQ(OB_SUCCESS, create_paxos_group(id, create_scn, leader_idx, leader)); const block_id_t start_block_id = 0; const block_id_t end_block_id = g_end_block_id; - // 上传g_end_block_id个文件到oss + // Upload g_end_block_id files to oss if (0 == strcmp(need_upload_blocks, "TRUE")) { EXPECT_EQ(OB_SUCCESS, upload_blocks(dst_tenant_id, dst_palf_id, log_dir, start_block_id, end_block_id)); } @@ -382,7 +385,7 @@ TEST_F(TestObSimpleLogSharedStorage, iterator_performance) // EXPECT_EQ(OB_SUCCESS, create_paxos_group(id, create_scn, leader_idx, leader)); // const block_id_t start_block_id = 0; // const block_id_t end_block_id = g_end_block_id; -// // 上传400个文件到oss +// // Upload 400 files to oss // if (0 == strcmp(need_upload_blocks, "TRUE")) { // EXPECT_EQ(OB_SUCCESS, upload_blocks(dst_tenant_id, dst_palf_id, src_dir_bmsql_array, start_block_id, end_block_id)); // } diff --git a/mittest/logservice/test_ob_simple_log_rebuild.cpp b/mittest/logservice/test_ob_simple_log_rebuild.cpp index 03114370a..c9f4b9ef3 100644 --- a/mittest/logservice/test_ob_simple_log_rebuild.cpp +++ b/mittest/logservice/test_ob_simple_log_rebuild.cpp @@ -1,16 +1,20 @@ // owner: yunlong.cb // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/logservice/test_ob_simple_log_replay.cpp b/mittest/logservice/test_ob_simple_log_replay.cpp index fe5aa4872..5fc6129ff 100644 --- a/mittest/logservice/test_ob_simple_log_replay.cpp +++ b/mittest/logservice/test_ob_simple_log_replay.cpp @@ -1,16 +1,20 @@ // owner: zjf225077 // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public @@ -59,7 +63,7 @@ class MockLSAdapter : public ObLSAdapter if (NULL == rp_st_) { CLOG_LOG(ERROR, "rp_st_ is null"); } else if (rand() % 2 && retry_count_ < RETRY_LIMIT) { - //随机模拟错误码和执行时间 + // Randomly simulate error codes and execution time ret = OB_EAGAIN; retry_count_++; CLOG_LOG(INFO, "replay log retry", K(task_count_)); @@ -78,7 +82,7 @@ class MockLSAdapter : public ObLSAdapter pre_barrier_scn_.atomic_set(replay_task->scn_); } if (replay_task->is_post_barrier_) { - //尽量让后向barrier回放慢,如果有没卡住的后向barrier之后的日志就会增大回放的概率 + // Try to make the backward barrier replay slowly, if there are any unblocked backward barriers, the logs after them will increase the probability of replay usleep(1000); } ATOMIC_INC(&task_count_); @@ -96,7 +100,7 @@ class MockLSAdapter : public ObLSAdapter } } } - static const int64_t RETRY_LIMIT = 10000; //模拟随机重试限制 + static const int64_t RETRY_LIMIT = 10000; // simulate random retry limit int64_t task_count_; int64_t retry_count_; share::SCN pre_barrier_scn_; @@ -142,7 +146,7 @@ TEST_F(TestObSimpleLogReplayFunc, basic_replay) } LSN unused_lsn; int64_t unused_ts = 0; - //正向流程 + // Forward process LSN last_log_lsn; share::SCN unused_scn; share::SCN last_scn; @@ -162,7 +166,7 @@ TEST_F(TestObSimpleLogReplayFunc, basic_replay) EXPECT_EQ(0, rp_sv.get_pending_task_size()); EXPECT_EQ(OB_SUCCESS, rp_sv.switch_to_leader(ls_id)); EXPECT_EQ(OB_SUCCESS, rp_sv.switch_to_follower(ls_id, basic_lsn)); - //验证reuse + // Validate reuse EXPECT_EQ(OB_SUCCESS, rp_sv.disable(ls_id)); EXPECT_EQ(OB_SUCCESS, rp_sv.enable(ls_id, basic_lsn, share::SCN::min_scn())); is_done = false; @@ -171,7 +175,7 @@ TEST_F(TestObSimpleLogReplayFunc, basic_replay) usleep(100); rp_sv.is_replay_done(ls_id, end_lsn, is_done); } - //测试受控回放 + // Test controlled replay const int64_t id_shadow = ATOMIC_AAF(&palf_id_, 1); ObLSID ls_id_shadow(id_shadow); PalfHandleImplGuard leader_shadow; @@ -189,11 +193,11 @@ TEST_F(TestObSimpleLogReplayFunc, basic_replay) ls_adapter.pre_barrier_scn_.set_min(); ls_adapter.rp_st_ = rp_st; } - //只卡住最后一条日志的回放 + // Only hold back the replay of the last log rp_sv.replayable_point_ = SCN::minus(last_scn, 1); EXPECT_EQ(OB_SUCCESS, rp_sv.enable(ls_id_shadow, basic_lsn, basic_scn)); ls_adapter.wait_replay_done(task_count - 1); - //验证最大连续回放位点 + // Validate maximum consecutive replay point SCN max_replayed_scn = SCN::min_scn(); while (SCN::minus(last_scn, 1) != max_replayed_scn) { EXPECT_EQ(OB_SUCCESS, rp_sv.get_max_replayed_scn(ls_id_shadow, max_replayed_scn)); @@ -248,7 +252,7 @@ TEST_F(TestObSimpleLogReplayFunc, test_flashback_to_padding) } PalfBufferIterator &iterator = rp_st->submit_log_task_.iterator_; iterator.iterator_storage_.get_file_end_lsn_ = get_file_end_lsn; - // 停止拉日志 + // Stop pulling logs rp_st->block_submit(); EXPECT_EQ(OB_SUCCESS, submit_log(leader, 31, leader_idx, log_entry_size)); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(leader, leader.get_palf_handle_impl()->get_max_lsn())); @@ -274,18 +278,18 @@ TEST_F(TestObSimpleLogReplayFunc, test_flashback_to_padding) } is_done = false; CLOG_LOG(INFO, "runlin trace 3", K(iterator), KPC(rp_st)); - // 预期replay的next_to_submit_lsn是padding_header + // Expected replay's next_to_submit_lsn is padding_header EXPECT_EQ(padding_header, rp_st->submit_log_task_.next_to_submit_lsn_); switch_flashback_to_append(leader, mode_version); iterator_end_lsn = LSN(100000000); - // 停止拉日志 + // Stop pulling logs rp_st->block_submit(); EXPECT_EQ(OB_SUCCESS, submit_log(leader, 1, leader_idx, log_entry_size)); padding_tail_scn = leader.get_palf_handle_impl()->get_max_scn(); LSN max_lsn = leader.get_palf_handle_impl()->get_max_lsn(); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(leader, max_lsn)); } - // Test2: flashback到padding头部, replay先执行flashback,再执行replay padding + // Test2: flashback to padding header, replay first executes flashback, then executes replay padding { int ret = OB_SUCCESS; CLOG_LOG(WARN, "flashback to padding header case2"); @@ -293,9 +297,9 @@ TEST_F(TestObSimpleLogReplayFunc, test_flashback_to_padding) SCN flashback_scn = padding_header_scn; switch_append_to_flashback(leader, mode_version); EXPECT_EQ(OB_SUCCESS, leader.get_palf_handle_impl()->flashback(mode_version, flashback_scn, abs_timeout_us)); - // iterator看到的终点是padding日志头 + // iterator sees the end as padding log header iterator_end_lsn = padding_header; - // replay看到的committed位点是padding尾 + // replay sees the committed point as the tail of padding rp_st->unblock_submit(); bool is_done = false; while (!is_done) { @@ -303,48 +307,47 @@ TEST_F(TestObSimpleLogReplayFunc, test_flashback_to_padding) usleep(10*1000); CLOG_LOG(WARN, "not replay done", KPC(rp_st), K(padding_header)); } - // 预期replay的next_to_submit_lsn是padding头 + // Expected replay's next_to_submit_lsn is padding header EXPECT_EQ(iterator_end_lsn, rp_st->submit_log_task_.next_to_submit_lsn_); - // 修改iterator看到的终点为padding尾 + // Modify the endpoint seen by iterator to the tail of padding iterator_end_lsn = LSN(PALF_BLOCK_SIZE); - // 触发拉日志 + // Trigger pull log rp_st->trigger_fetch_log(); sleep(1); - // 预期replay的next_to_submit_lsn是padding头 + // Expected replay's next_to_submit_lsn is padding header EXPECT_EQ(padding_header, rp_st->submit_log_task_.next_to_submit_lsn_); switch_flashback_to_append(leader, mode_version); - // 停止拉日志 + // Stop pulling logs rp_st->block_submit(); EXPECT_EQ(OB_SUCCESS, submit_log(leader, 1, leader_idx, log_entry_size)); padding_tail_scn = leader.get_palf_handle_impl()->get_max_scn(); LSN max_lsn = leader.get_palf_handle_impl()->get_max_lsn(); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(leader, max_lsn)); } - - // Test3: flashback到padding尾部, replay先执行flashback,再执行replay padding + // Test3: flashback to the end of padding, replay first executes flashback, then executes replay padding { int ret = OB_SUCCESS; CLOG_LOG(WARN, "flashback to padding tailer case1"); int64_t abs_timeout_us = 4*1000*1000; - // flashback_scn为padding尾 + // flashback_scn is the tail of padding SCN flashback_scn = SCN::minus(padding_tail_scn, 1); switch_append_to_flashback(leader, mode_version); EXPECT_EQ(OB_SUCCESS, leader.get_palf_handle_impl()->flashback(mode_version, flashback_scn, abs_timeout_us)); - // iterator看到的终点是padding日志头 + // iterator sees the end as padding log header iterator_end_lsn = padding_header; - // replay看到的committed位点是padding头 + // replay sees the committed position as the padding header rp_st->unblock_submit(); bool is_done = false; - // iterator由于文件长度,不会吐出padding日志,replay的next_to_submit_lsn到padding头部 + // iterator due to file length, will not output padding log, replay's next_to_submit_lsn to padding head while (!is_done) { rp_sv.is_replay_done(ls_id, padding_header, is_done); usleep(10*1000); CLOG_LOG(WARN, "not replay done", KPC(rp_st), K(padding_header)); } is_done = false; - // 预期replay的next_to_submit_lsn是padding头 + // Expected replay's next_to_submit_lsn is padding header EXPECT_EQ(padding_header, rp_st->submit_log_task_.next_to_submit_lsn_); - // iterator能看到padding日志 + // iterator can see padding log iterator_end_lsn = LSN(PALF_BLOCK_SIZE); rp_st->trigger_fetch_log(); while (!is_done) { @@ -408,7 +411,7 @@ TEST_F(TestObSimpleLogReplayFunc, test_wait_replay_done) EXPECT_EQ(LSN(PALF_BLOCK_SIZE), leader.get_palf_handle_impl()->get_max_lsn()); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(leader, leader.get_palf_handle_impl()->get_max_lsn())); bool is_done = false; - // 无padding日志,committed位点是文件头 + // No padding log, committed point is the file header while (!is_done) { rp_sv.is_replay_done(ls_id, LSN(PALF_BLOCK_SIZE), is_done); } @@ -416,7 +419,7 @@ TEST_F(TestObSimpleLogReplayFunc, test_wait_replay_done) EXPECT_EQ(OB_SUCCESS, submit_log(leader, 31, leader_idx, log_entry_size)); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(leader, leader.get_palf_handle_impl()->get_max_lsn())); EXPECT_EQ(OB_SUCCESS, submit_log(leader, 1, leader_idx, log_entry_size)); - // 有padding日志,committed位点是文件头 + // Padding log, committed point is the file header is_done =false; while (!is_done) { rp_sv.is_replay_done(ls_id, LSN(PALF_BLOCK_SIZE), is_done); diff --git a/mittest/logservice/test_ob_simple_log_restart.cpp b/mittest/logservice/test_ob_simple_log_restart.cpp index 222698c5d..e0d06b749 100644 --- a/mittest/logservice/test_ob_simple_log_restart.cpp +++ b/mittest/logservice/test_ob_simple_log_restart.cpp @@ -1,16 +1,20 @@ // owner: zjf225077 // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public @@ -86,25 +90,22 @@ TEST_F(TestObSimpleLogClusterRestart, read_block_in_flashback) EXPECT_EQ(-1, ::openat(log_storage->block_mgr_.dir_fd_, block_name, LOG_READ_FLAG)); EXPECT_EQ(OB_NEED_RETRY, read_log(leader)); EXPECT_EQ(OB_NEED_RETRY, log_storage->get_block_min_scn(max_block_id, scn)); - - // 测试边界场景,read_log_tail_为文件中间,最后一个文件完全被flashback掉, 此时log_tail_是最后一个文件头 + // Test boundary scenario, read_log_tail_ is in the middle of the file, the last file is completely flashbacked, at this time log_tail_ is the header of the last file log_storage->log_tail_ = LSN(2*PALF_BLOCK_SIZE); EXPECT_EQ(OB_NEED_RETRY, read_log(leader)); EXPECT_EQ(OB_NEED_RETRY, log_storage->get_block_min_scn(max_block_id, scn)); - - // 测试边界场景,read_log_tail_最后一个文件头,最后一个文件完全被flashback掉 + // Test boundary scenario, read_log_tail_ last file header, last file completely flashbacked log_storage->log_tail_ = LSN(2*PALF_BLOCK_SIZE); log_storage->readable_log_tail_ = LSN(2*PALF_BLOCK_SIZE); EXPECT_EQ(OB_ITER_END, read_log(leader)); EXPECT_EQ(OB_ERR_OUT_OF_UPPER_BOUND, log_storage->get_block_min_scn(max_block_id, scn)); - - // 不太好模拟这种场景,考虑引入debug sync - // // 测试边界场景,readable_log_tail_还没改变前检验是否可读通过,直接读文件时报错文件不存在。 +// It is not easy to simulate this scenario, consider introducing debug sync +// // Test boundary scenario, check if readable before readable_log_tail_ changes, directly reading the file throws an error indicating the file does not exist. // log_storage->log_tail_ = LSN(3*PALF_BLOCK_SIZE); // log_storage->readable_log_tail_ = LSN(3*PALF_BLOCK_SIZE); - // // 设置max_block_id_为1是为了构造check_read_out_of_bound返回OB_ERR_OUT_OF_UPPER_BOUND的场景 +// // Set max_block_id_ to 1 to construct the scenario where check_read_out_of_bound returns OB_ERR_OUT_OF_UPPER_BOUND // log_storage->block_mgr_.max_block_id_ = 1; - // // log_storage返回OB_ERR_OUT_OF_UPPER_BOUND, iterator将其转换为OB_ITER_END +// // log_storage returns OB_ERR_OUT_OF_UPPER_BOUND, iterator converts it to OB_ITER_END // EXPECT_EQ(OB_ITER_END, read_log(leader)); // EXPECT_EQ(OB_ERR_OUT_OF_UPPER_BOUND, log_storage->get_block_min_scn(max_block_id, scn)); } @@ -115,13 +116,13 @@ TEST_F(TestObSimpleLogClusterRestart, restart_when_first_log_block_is_empty) OB_LOGGER.set_log_level("TRACE"); const int64_t id = ATOMIC_AAF(&palf_id_, 1); int64_t leader_idx = 0; - // 创建日志流后不写入任何数据 + // Create log stream without writing any data { PalfHandleImplGuard leader; EXPECT_EQ(OB_SUCCESS, create_paxos_group(id, leader_idx, leader)); } EXPECT_EQ(OB_SUCCESS, restart_paxos_groups()); - // 测试truncate场景 + // Test truncate scenario { PalfHandleImplGuard leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, leader, leader_idx)); @@ -132,7 +133,7 @@ TEST_F(TestObSimpleLogClusterRestart, restart_when_first_log_block_is_empty) } EXPECT_EQ(OB_SUCCESS, restart_paxos_groups()); LSN rebuild_lsn(2*PALF_BLOCK_SIZE); - // 测试rebuild场景 + // Test rebuild scenario { PalfHandleImplGuard leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, leader, leader_idx)); @@ -157,7 +158,7 @@ TEST_F(TestObSimpleLogClusterRestart, restart_when_first_log_block_is_empty) } } EXPECT_EQ(OB_SUCCESS, restart_paxos_groups()); - // 测试flashback场景 + // Test flashback scene { PalfHandleImplGuard leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, leader, leader_idx)); @@ -208,8 +209,7 @@ TEST_F(TestObSimpleLogClusterRestart, test_restart) system(log_fd); PALF_LOG(INFO, "first restart_paxos_groups, after meta dir is empty while log dir is not"); EXPECT_EQ(OB_SUCCESS, restart_paxos_groups()); - - // 验证切文件过程中宕机重启 + // Validate system crash and restart during file slicing process { PalfHandleImplGuard leader; EXPECT_EQ(OB_SUCCESS, create_paxos_group(id, leader_idx, leader)); @@ -221,7 +221,7 @@ TEST_F(TestObSimpleLogClusterRestart, test_restart) LogStorage *meta_storage = &leader.get_palf_handle_impl()->log_engine_.log_meta_storage_; EXPECT_EQ(OB_SUCCESS, log_storage->get_block_id_range(min_block_id, max_block_id)); EXPECT_EQ(1, max_block_id); - // 模拟只switch block,但没有更新manifest, 此时manifest依旧是1, 宕机重启后由于2号文件为空,manifest会被更新为2 + // Simulate only switch block, but do not update manifest, at this time manifest is still 1, after shutdown and restart, since file 2 is empty, manifest will be updated to 2 EXPECT_EQ(OB_SUCCESS, log_storage->truncate(LSN(PALF_BLOCK_SIZE))); EXPECT_EQ(OB_SUCCESS, log_storage->update_manifest_(1)); EXPECT_EQ(PALF_BLOCK_SIZE, log_storage->curr_block_writable_size_); @@ -232,14 +232,14 @@ TEST_F(TestObSimpleLogClusterRestart, test_restart) { PalfHandleImplGuard leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, leader, leader_idx)); - //检查manifest是否为3 + // Check if manifest is version 3 EXPECT_EQ(OB_SUCCESS, submit_log(leader, 1, id, log_entry_size)); LogStorage *meta_storage = &leader.get_palf_handle_impl()->log_engine_.log_meta_storage_; EXPECT_EQ(2, lsn_2_block(meta_storage->log_block_header_.min_lsn_, PALF_BLOCK_SIZE)); } PALF_LOG(INFO, "third restart_paxos_groups"); EXPECT_EQ(OB_SUCCESS, restart_paxos_groups()); - // 验证重启后新建日志流 + // Validate new log stream creation after restart { PalfHandleImplGuard leader; id = ATOMIC_AAF(&palf_id_, 1); @@ -248,34 +248,34 @@ TEST_F(TestObSimpleLogClusterRestart, test_restart) wait_lsn_until_flushed(leader.palf_handle_impl_->get_max_lsn(), leader); EXPECT_EQ(OB_ITER_END, read_log(leader)); } - // 验证truncate或flashback过程中,修改完manifest后,删除文件前宕机重启(删除1个文件) + // Validate system restart during truncate or flashback process, after modifying the manifest but before deleting files (deleting 1 file) { PalfHandleImplGuard leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, leader, leader_idx)); block_id_t min_block_id, max_block_id; - // 此时manifest为3 + // At this point manifest is 3 LogStorage *log_storage = &leader.palf_handle_impl_->log_engine_.log_storage_; LogStorage *meta_storage = &leader.get_palf_handle_impl()->log_engine_.log_meta_storage_; EXPECT_EQ(OB_SUCCESS, log_storage->get_block_id_range(min_block_id, max_block_id)); EXPECT_EQ(2, max_block_id); EXPECT_EQ(3, lsn_2_block(meta_storage->log_block_header_.min_lsn_, PALF_BLOCK_SIZE)); - // truncate 或 flashback会先更新manifest为2 + // truncate or flashback will first update manifest to 2 EXPECT_EQ(OB_SUCCESS, log_storage->update_manifest_(2)); EXPECT_EQ(2, lsn_2_block(meta_storage->log_block_header_.min_lsn_, PALF_BLOCK_SIZE)); } PALF_LOG(INFO, "fourth restart_paxos_groups after modify manifest while not delete block"); - // 验证truncate或flashback过程中,修改完manifest后,truncaet/flashback正好将最后一个文件清空 + // Verify that during the truncate or flashback process, after modifying the manifest, the truncate/flashback exactly empties the last file EXPECT_EQ(OB_SUCCESS, restart_paxos_groups()); { PalfHandleImplGuard leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, leader, leader_idx)); block_id_t min_block_id, max_block_id; - // 此时manifest为2 + // At this point manifest is 2 LogStorage *log_storage = &leader.palf_handle_impl_->log_engine_.log_storage_; LogStorage *meta_storage = &leader.get_palf_handle_impl()->log_engine_.log_meta_storage_; EXPECT_EQ(OB_SUCCESS, log_storage->get_block_id_range(min_block_id, max_block_id)); EXPECT_EQ(2, max_block_id); - // 尽管manifest为2,但在这种场景下,2号文件是可以删除的 + // Although manifest is 2, in this scenario, file 2 can be deleted EXPECT_EQ(2, lsn_2_block(meta_storage->log_block_header_.min_lsn_, PALF_BLOCK_SIZE)); EXPECT_EQ(OB_SUCCESS, log_storage->truncate(LSN(2*PALF_BLOCK_SIZE))); EXPECT_EQ(OB_SUCCESS, log_storage->update_manifest_(2)); @@ -286,7 +286,7 @@ TEST_F(TestObSimpleLogClusterRestart, test_restart) PalfHandleImplGuard leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, leader, leader_idx)); block_id_t min_block_id, max_block_id; - // 重启之后,由于磁盘上最大的文件为2,同时该文件为空,此时会更新manifest为3 + // After restarting, since the largest file on the disk is 2 and this file is empty, the manifest will be updated to 3 LogStorage *log_storage = &leader.palf_handle_impl_->log_engine_.log_storage_; LogStorage *meta_storage = &leader.get_palf_handle_impl()->log_engine_.log_meta_storage_; EXPECT_EQ(OB_SUCCESS, log_storage->get_block_id_range(min_block_id, max_block_id)); @@ -297,7 +297,7 @@ TEST_F(TestObSimpleLogClusterRestart, test_restart) EXPECT_EQ(3, lsn_2_block(meta_storage->log_block_header_.min_lsn_, PALF_BLOCK_SIZE)); } PALF_LOG(INFO, "six restart_paxos_groups"); - // 验证base lsn 大于持久化的committed 位点 + // Validate base lsn greater than persisted committed point { PalfHandleImplGuard leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, leader, leader_idx)); @@ -307,7 +307,7 @@ TEST_F(TestObSimpleLogClusterRestart, test_restart) int64_t palf_id = leader.palf_handle_impl_->palf_id_; EXPECT_EQ(OB_SUCCESS, submit_log(leader, 29, id, log_entry_size)); EXPECT_EQ(OB_SUCCESS, wait_lsn_until_flushed(leader.palf_handle_impl_->get_max_lsn(), leader)); - // 预期log_tail接近文件2的尾部 + // Expected log_tail to be near the end of file 2 EXPECT_LE(LSN(3*PALF_BLOCK_SIZE) - log_storage->log_tail_, 5*1024*1024); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(leader, leader.palf_handle_impl_->get_end_lsn())); sleep(1); @@ -338,7 +338,7 @@ TEST_F(TestObSimpleLogClusterRestart, test_restart) } EXPECT_EQ(OB_SUCCESS, restart_paxos_groups()); PALF_LOG(INFO, "seven restart_paxos_groups after committed lsn is smaller than base lsn"); - // 验证rebuild过程中持久化palf_base_info后,宕机重启 + // Validate that after persisting palf_base_info during rebuild, the system can crash and restart { PalfHandleImplGuard leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, leader, leader_idx)); @@ -500,7 +500,7 @@ TEST_F(TestObSimpleLogClusterRestart, restart_and_clear_tmp_files) guard.click("read_log"); PALF_LOG(INFO, "finish read_log", KPC(log_storage), K(lsn_origin_log_tail), KPC(leader1.palf_handle_impl_)); } - // 验证tenant下有临时文件的场景,该临时文件需要归还给log_pool + // Validate the scenario where there are temporary files under tenant, these temporary files need to be returned to log_pool { PalfHandleImplGuard leader1; int64_t leader_idx1 = 0; diff --git a/mittest/logservice/test_ob_simple_log_shared_storage.cpp b/mittest/logservice/test_ob_simple_log_shared_storage.cpp index d340a1b9b..4ef82f161 100644 --- a/mittest/logservice/test_ob_simple_log_shared_storage.cpp +++ b/mittest/logservice/test_ob_simple_log_shared_storage.cpp @@ -1,16 +1,20 @@ // owner: zjf225077 // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/logservice/test_ob_simple_log_single_replica_func.cpp b/mittest/logservice/test_ob_simple_log_single_replica_func.cpp index 592781b3a..b746c1d69 100644 --- a/mittest/logservice/test_ob_simple_log_single_replica_func.cpp +++ b/mittest/logservice/test_ob_simple_log_single_replica_func.cpp @@ -1,16 +1,20 @@ // owner: zjf225077 // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public @@ -90,7 +94,7 @@ int64_t log_entry_size = 2 * 1024 * 1024 + 16 * 1024; void read_padding_entry(PalfHandleImplGuard &leader, SCN padding_scn, LSN padding_log_lsn) { - // 从padding group entry开始读取 + // Start reading from the padding group entry { PalfBufferIterator iterator; EXPECT_EQ(OB_SUCCESS, leader.get_palf_handle_impl()->alloc_palf_buffer_iterator(padding_log_lsn, iterator)); @@ -102,7 +106,7 @@ void read_padding_entry(PalfHandleImplGuard &leader, SCN padding_scn, LSN paddin EXPECT_EQ(true, padding_log_entry.check_integrity()); EXPECT_EQ(padding_scn, padding_log_entry.get_scn()); } - // 从padding log entry开始读取 + // Start reading from the padding log entry { PalfBufferIterator iterator; EXPECT_EQ(OB_SUCCESS, leader.get_palf_handle_impl()->alloc_palf_buffer_iterator(padding_log_lsn+LogGroupEntryHeader::HEADER_SER_SIZE, iterator)); @@ -151,18 +155,17 @@ TEST_F(TestObSimpleLogClusterSingleReplica, single_replica_flashback) { SCN tmp_scn; LSN tmp_lsn; - // 提交1条日志后进行flashback + // Submit 1 log entry before flashback EXPECT_EQ(OB_SUCCESS, submit_log(leader, 1, leader_idx, 100)); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(leader, leader.palf_handle_impl_->sw_.get_max_lsn())); tmp_scn = leader.palf_handle_impl_->get_max_scn(); switch_append_to_flashback(leader, mode_version); EXPECT_EQ(OB_SUCCESS, leader.palf_handle_impl_->flashback(mode_version, SCN::minus(tmp_scn, 10), timeout_ts_us)); - // 预期日志起点为LSN(0) + // Expected log start point is LSN(0) EXPECT_EQ(LSN(0), leader.palf_handle_impl_->get_max_lsn()); EXPECT_EQ(SCN::minus(tmp_scn, 10), leader.palf_handle_impl_->get_max_scn()); EXPECT_EQ(LSN(0), leader.palf_handle_impl_->log_engine_.log_storage_.log_tail_); - - // flashback到PADDING日志 + // flashback to PADDING log switch_flashback_to_append(leader, mode_version); EXPECT_EQ(OB_SUCCESS, submit_log(leader, 31, leader_idx, log_entry_size)); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(leader, leader.palf_handle_impl_->sw_.get_max_lsn())); @@ -172,30 +175,30 @@ TEST_F(TestObSimpleLogClusterSingleReplica, single_replica_flashback) EXPECT_LT(remained_log_size, log_entry_size); int need_log_size = remained_log_size - 5*1024; PALF_LOG(INFO, "runlin trace print sw1", K(leader.palf_handle_impl_->sw_)); - // 保证末尾只剩小于1KB的空间 + // Ensure that only less than 1KB of space remains at the end EXPECT_EQ(OB_SUCCESS, submit_log(leader, 1, leader_idx, need_log_size)); PALF_LOG(INFO, "runlin trace print sw2", K(leader.palf_handle_impl_->sw_)); SCN mid_scn; LogEntryHeader header; - // 此时一共存在32条日志 + // At this point, there are a total of 32 logs EXPECT_EQ(OB_SUCCESS, get_middle_scn(32, leader, mid_scn, header)); EXPECT_EQ(OB_ITER_END, get_middle_scn(33, leader, mid_scn, header)); EXPECT_GT(LSN(PALF_BLOCK_SIZE), leader.palf_handle_impl_->sw_.get_max_lsn()); remained_log_size = LSN(PALF_BLOCK_SIZE) - leader.palf_handle_impl_->sw_.get_max_lsn(); EXPECT_LT(remained_log_size, 5*1024); EXPECT_GT(remained_log_size, 0); - // 写一条大小为5KB的日志 + // Write a log of size 5KB LSN padding_log_lsn = leader.get_palf_handle_impl()->get_max_lsn(); EXPECT_EQ(OB_SUCCESS, submit_log(leader, 1, leader_idx, 5*1024)); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(leader, leader.get_palf_handle_impl()->get_max_lsn())); - // 验证读取padding是否成功 + // Verify if reading padding was successful { share::SCN padding_scn = leader.get_palf_handle_impl()->get_max_scn(); padding_scn = padding_scn.minus(padding_scn, 1); read_padding_entry(leader, padding_scn, padding_log_lsn); } PALF_LOG(INFO, "runlin trace print sw3", K(leader.palf_handle_impl_->sw_)); - // Padding日志占用日志条数,因此存在34条日志 + // Padding log occupies the number of log entries, therefore there are 34 logs EXPECT_EQ(OB_SUCCESS, get_middle_scn(33, leader, mid_scn, header)); EXPECT_EQ(OB_SUCCESS, get_middle_scn(34, leader, mid_scn, header)); EXPECT_EQ(OB_ITER_END, get_middle_scn(35, leader, mid_scn, header)); @@ -203,25 +206,23 @@ TEST_F(TestObSimpleLogClusterSingleReplica, single_replica_flashback) max_scn = leader.palf_handle_impl_->sw_.get_max_scn(); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(leader, leader.palf_handle_impl_->get_max_lsn())); switch_append_to_flashback(leader, mode_version); - // flashback到padding日志尾部 + // flashback to padding log tail tmp_scn = leader.palf_handle_impl_->get_max_scn(); EXPECT_EQ(OB_SUCCESS, leader.palf_handle_impl_->flashback(mode_version, SCN::minus(tmp_scn, 1), timeout_ts_us)); PALF_LOG(INFO, "flashback to padding tail"); EXPECT_EQ(leader.palf_handle_impl_->get_max_lsn(), LSN(PALF_BLOCK_SIZE)); EXPECT_EQ(OB_ITER_END, read_log(leader)); - // flashback后存在33条日志(包含padding日志) + // flashback after there are 33 logs (including padding logs) EXPECT_EQ(OB_SUCCESS, get_middle_scn(33, leader, mid_scn, header)); EXPECT_EQ(OB_ITER_END, get_middle_scn(34, leader, mid_scn, header)); - - // 验证读取padding是否成功 + // Verify if reading padding was successful { share::SCN padding_scn = leader.get_palf_handle_impl()->get_max_scn(); padding_scn.minus(padding_scn, 1); PALF_LOG(INFO, "begin read_padding_entry", K(padding_scn), K(padding_log_lsn)); read_padding_entry(leader, padding_scn, padding_log_lsn); } - - // flashback到padding日志头部,磁盘上还有32条日志 + // flashback to padding log header, there are still 32 logs on disk tmp_scn = leader.palf_handle_impl_->get_max_scn(); EXPECT_EQ(OB_SUCCESS, leader.palf_handle_impl_->flashback(mode_version, SCN::minus(tmp_scn, 1), timeout_ts_us)); EXPECT_LT(leader.palf_handle_impl_->get_max_lsn(), LSN(PALF_BLOCK_SIZE)); @@ -248,10 +249,10 @@ TEST_F(TestObSimpleLogClusterSingleReplica, single_replica_flashback) switch_append_to_flashback(leader, mode_version); ref_scn.convert_for_tx(30000); EXPECT_EQ(OB_SUCCESS, leader.palf_handle_impl_->flashback(mode_version, ref_scn, timeout_ts_us)); - // 验证重复的flashback任务 + // Validate duplicate flashback tasks EXPECT_EQ(OB_SUCCESS, leader.palf_handle_impl_->inner_flashback(ref_scn)); EXPECT_EQ(tmp_lsn1, leader.palf_handle_impl_->log_engine_.log_storage_.log_tail_); - // 验证flashback时间戳比过小 + // Validate flashback timestamp is not too small ref_scn.convert_from_ts(1); EXPECT_EQ(OB_SUCCESS, leader.palf_handle_impl_->inner_flashback(ref_scn)); EXPECT_GT(tmp_lsn1, leader.palf_handle_impl_->log_engine_.log_storage_.log_tail_); @@ -261,9 +262,8 @@ TEST_F(TestObSimpleLogClusterSingleReplica, single_replica_flashback) EXPECT_EQ(OB_SUCCESS, submit_log(leader, 300, leader_idx)); wait_until_has_committed(leader, leader.palf_handle_impl_->sw_.get_max_lsn()); EXPECT_EQ(OB_ITER_END, read_log(leader)); - - // flashback到中间某条日志 - // 1. 比较log_storage和日位点和滑动窗口是否相同 + // flashback to a middle log entry + // 1. Compare log_storage and log position and sliding window whether they are the same switch_append_to_flashback(leader, mode_version); LogEntryHeader header_origin; @@ -279,12 +279,11 @@ TEST_F(TestObSimpleLogClusterSingleReplica, single_replica_flashback) EXPECT_EQ(new_log_tail, leader.palf_handle_impl_->sw_.committed_end_lsn_); EXPECT_EQ(max_scn, leader.palf_handle_impl_->sw_.last_slide_scn_); EXPECT_EQ(OB_ITER_END, read_log(leader)); - // 验证flashback后能否继续提交日志 + // Verify if log submission can continue after flashback EXPECT_EQ(OB_SUCCESS, submit_log(leader, 500, leader_idx)); wait_until_has_committed(leader, leader.palf_handle_impl_->sw_.get_max_lsn()); EXPECT_EQ(OB_ITER_END, read_log(leader)); - - // 再次执行flashback到上一次的flashback位点 + // Again execute flashback to the last flashback point switch_append_to_flashback(leader, mode_version); EXPECT_EQ(OB_SUCCESS, leader.palf_handle_impl_->flashback(mode_version, max_scn, timeout_ts_us)); switch_flashback_to_append(leader, mode_version); @@ -294,8 +293,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, single_replica_flashback) EXPECT_EQ(OB_SUCCESS, submit_log(leader, 500, leader_idx)); wait_until_has_committed(leader, leader.palf_handle_impl_->sw_.get_max_lsn()); EXPECT_EQ(OB_ITER_END, read_log(leader)); - - // 再次执行flashback到上一次的flashback后提交日志的某个时间点 + // Again execute flashback to the time point of a log submission after the previous flashback EXPECT_EQ(OB_SUCCESS, get_middle_scn(634, leader, max_scn, header_origin)); switch_append_to_flashback(leader, mode_version); EXPECT_EQ(OB_SUCCESS, leader.palf_handle_impl_->flashback(mode_version, max_scn, timeout_ts_us)); @@ -307,8 +305,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, single_replica_flashback) wait_until_has_committed(leader, leader.palf_handle_impl_->sw_.get_max_lsn()); EXPECT_EQ(OB_ITER_END, read_log(leader)); PALF_LOG(INFO, "flashback to middle success"); - - // flashback到某个更大的时间点 + // flashback to a larger point in time max_scn = leader.palf_handle_impl_->get_end_scn(); new_log_tail = leader.palf_handle_impl_->log_engine_.log_storage_.log_tail_; switch_append_to_flashback(leader, mode_version); @@ -337,8 +334,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, single_replica_flashback) EXPECT_EQ(new_log_tail, leader.palf_handle_impl_->sw_.committed_end_lsn_); EXPECT_EQ(OB_ITER_END, read_log(leader)); PALF_LOG(INFO, "flashback to max_scn success"); - - // 再次执行flashback到提交日志前的max_scn + // Again execute flashback to max_scn before the submission log EXPECT_EQ(OB_SUCCESS, submit_log(leader, 300, leader_idx)); wait_until_has_committed(leader, leader.palf_handle_impl_->sw_.get_max_lsn()); LSN curr_lsn = leader.palf_handle_impl_->get_end_lsn(); @@ -379,8 +375,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, single_replica_flashback) leader.palf_handle_impl_->state_mgr_.state_ = ObReplicaState::ACTIVE; dynamic_cast(get_cluster()[0]->get_palf_env())->log_loop_thread_.start(); switch_flashback_to_append(leader, mode_version); - - // 数据全部清空 + // All data cleared wait_until_has_committed(leader, leader.palf_handle_impl_->sw_.get_max_lsn()); switch_append_to_flashback(leader, mode_version); EXPECT_EQ(OB_SUCCESS, leader.palf_handle_impl_->flashback(mode_version, SCN::min_scn(), timeout_ts_us)); @@ -430,7 +425,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, single_replica_flashback_restart) } EXPECT_EQ(OB_SUCCESS, restart_paxos_groups()); { - // 验证重启场景 + // Validate restart scenario PalfHandleImplGuard new_leader; int64_t curr_mode_version = INVALID_PROPOSAL_ID; AccessMode curr_access_mode = AccessMode::INVALID_ACCESS_MODE; @@ -445,7 +440,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, single_replica_flashback_restart) LogStorage *log_storage = &new_leader.palf_handle_impl_->log_engine_.log_storage_; block_id_t max_block_id = log_storage->block_mgr_.max_block_id_; EXPECT_EQ(OB_SUCCESS, get_middle_scn(1329, new_leader, max_scn, header_new)); - // flashback跨文件场景重启 + // flashback cross-file scene restart EXPECT_EQ(OB_SUCCESS, submit_log(new_leader, 33, leader_idx, MAX_LOG_BODY_SIZE)); wait_until_has_committed(new_leader, new_leader.palf_handle_impl_->sw_.get_max_lsn()); EXPECT_LE(max_block_id, log_storage->block_mgr_.max_block_id_); @@ -461,8 +456,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, single_replica_flashback_restart) AccessMode curr_access_mode = AccessMode::INVALID_ACCESS_MODE; EXPECT_EQ(OB_SUCCESS, get_leader(id, new_leader, leader_idx)); EXPECT_EQ(OB_SUCCESS, new_leader.palf_handle_impl_->get_access_mode(curr_mode_version, curr_access_mode)); - - // flashback到某个文件的尾部 + // flashback to the end of a certain file EXPECT_EQ(OB_SUCCESS, submit_log(new_leader, 65, leader_idx, MAX_LOG_BODY_SIZE)); wait_until_has_committed(new_leader, new_leader.palf_handle_impl_->sw_.get_max_lsn()); switch_append_to_flashback(new_leader, mode_version); @@ -487,8 +481,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, single_replica_flashback_restart) EXPECT_EQ(OB_ITER_END, read_log(new_leader)); } EXPECT_EQ(OB_SUCCESS, restart_paxos_groups()); - - // 重启后继续提交日志 + // Restart and continue submitting logs { PalfHandleImplGuard new_leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, new_leader, leader_idx)); @@ -499,13 +492,13 @@ TEST_F(TestObSimpleLogClusterSingleReplica, single_replica_flashback_restart) wait_until_has_committed(new_leader, new_leader.palf_handle_impl_->sw_.get_max_lsn()); EXPECT_EQ(OB_ITER_END, read_log(new_leader)); switch_append_to_flashback(new_leader, mode_version); - // flashback到padding日志头后重启 + // flashback to padding log header and restart EXPECT_EQ(OB_SUCCESS, new_leader.palf_handle_impl_->flashback(mode_version, padding_scn.minus(padding_scn, 1), timeout_ts_us)); EXPECT_EQ(true, 0 != lsn_2_offset(new_leader.get_palf_handle_impl()->get_max_lsn(), PALF_BLOCK_SIZE)); new_leader.reset(); } EXPECT_EQ(OB_SUCCESS, restart_paxos_groups()); - // 重启提交日志,不产生padding日志 + // Restart submission log, do not generate padding log { PalfHandleImplGuard new_leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, new_leader, leader_idx)); @@ -530,7 +523,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, single_replica_flashback_restart) new_leader.reset(); } EXPECT_EQ(OB_SUCCESS, restart_paxos_groups()); - // 重启后继续提交日志 + // Restart and continue submitting logs { PalfHandleImplGuard new_leader; EXPECT_EQ(OB_SUCCESS, get_leader(id, new_leader, leader_idx)); @@ -575,7 +568,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_truncate_failed) EXPECT_EQ(OB_SUCCESS, submit_log(leader, 32, id, MAX_LOG_BODY_SIZE)); wait_lsn_until_flushed(leader.palf_handle_impl_->get_max_lsn(), leader); EXPECT_EQ(OB_ITER_END, read_log(leader)); - // 验证truncate文件尾后重启 + // Validate file tail after truncate and restart EXPECT_EQ(OB_SUCCESS, leader.palf_handle_impl_->log_engine_.truncate(LSN(PALF_BLOCK_SIZE))); EXPECT_EQ(LSN(PALF_BLOCK_SIZE), leader.palf_handle_impl_->log_engine_.log_storage_.log_tail_); leader.reset(); @@ -592,7 +585,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_meta) PalfHandleImplGuard leader; EXPECT_EQ(OB_SUCCESS, create_paxos_group(id, leader_idx, leader)); sleep(1); - // 测试meta文件刚好写满的重启场景 + // Test the restart scenario where the meta file is exactly full LogEngine *log_engine = &leader.palf_handle_impl_->log_engine_; LogStorage *log_meta_storage = &log_engine->log_meta_storage_; LSN log_meta_tail = log_meta_storage->log_tail_; @@ -650,20 +643,19 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator) EXPECT_EQ(OB_SUCCESS, create_paxos_group(id_raw_write, leader_idx, raw_write_leader)); EXPECT_EQ(OB_SUCCESS, change_access_mode_to_raw_write(raw_write_leader)); int64_t count = 5; - // 提交1024条日志,记录max_scn,用于后续next迭代验证,case1 + // Submit 1024 logs, record max_scn, used for subsequent next iteration verification, case1 for (int i = 0; i < count; i++) { EXPECT_EQ(OB_SUCCESS, submit_log(leader, 1, id, 4*1024)); EXPECT_EQ(OB_SUCCESS, wait_lsn_until_flushed(leader.palf_handle_impl_->get_max_lsn(), leader)); } max_scn_case1 = palf_handle_impl->get_max_scn(); - // 提交5条日志,case1成功后,执行case2 + // Submit 5 logs, case1 successful after, execute case2 for (int i = 0; i < count; i++) { EXPECT_EQ(OB_SUCCESS, submit_log(leader, 1, id, 4*1024)); EXPECT_EQ(OB_SUCCESS, wait_lsn_until_flushed(leader.palf_handle_impl_->get_max_lsn(), leader)); } max_scn_case2 = palf_handle_impl->get_max_scn(); - - // 提交5条日志, case3, 验证next(replayable_point_scn, &next_log_min_scn, &bool) + // Submit 5 logs, case3, verify next(replayable_point_scn, &next_log_min_scn, &bool) std::vector lsns; std::vector logts; const int64_t log_size = 500; @@ -710,50 +702,47 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator) iterator.init(LSN(0), get_file_end_lsn, get_mode_version, &raw_write_palf_handle_impl->log_engine_.log_storage_)); EXPECT_EQ(OB_SUCCESS, iterator.next(max_scn_case1)); count--; EXPECT_EQ(OB_ITER_END, iterator.next(SCN::base_scn())); - - // case0: 验证group iterator迭代日志功能 + // case0: validate group iterator log iteration functionality EXPECT_EQ(OB_ITER_END, read_group_log(raw_write_leader, LSN(0))); LSN curr_lsn = iterator.iterator_impl_.get_curr_read_lsn(); // case1: - // - 验证mode_version变化后,cache是否清空 - // - replayable_point_scn是否生效 - // 当mode version发生变化时,预期cache应该清空 - // raw模式下,当replayable_point_scn很小时,直接返回OB_ITER_END + // - Verify that the cache is cleared after mode_version changes + // - whether replayable_point_scn is effective + // When mode version changes, the expected cache should be cleared + // raw mode, when replayable_point_scn is very small, directly return OB_ITER_END PALF_LOG(INFO, "runlin trace case1", K(mode_version_v), K(*mode_version), K(max_scn_case1)); - // mode_version_v 为无效值时,预期不清空 + // mode_version_v is an invalid value, the expected behavior is not to clear mode_version_v = INVALID_PROPOSAL_ID; end_lsn_v = curr_lsn; EXPECT_FALSE(curr_lsn == iterator.iterator_storage_.end_lsn_); EXPECT_FALSE(curr_lsn == iterator.iterator_storage_.start_lsn_); EXPECT_EQ(OB_ITER_END, iterator.next(SCN::base_scn())); - - // mode_version_v 比inital_mode_version小,预期不清空 + // mode_version_v is smaller than inital_mode_version, expectation is not to clear mode_version_v = -1; EXPECT_FALSE(curr_lsn == iterator.iterator_storage_.end_lsn_); EXPECT_FALSE(curr_lsn == iterator.iterator_storage_.start_lsn_); EXPECT_EQ(OB_ITER_END, iterator.next(SCN::base_scn())); - - // 合理的mode_version_v,清空cache + // reasonable mode_version_v, clear cache mode_version_v = 100; end_lsn_v = curr_lsn; EXPECT_EQ(OB_ITER_END, iterator.next(SCN::base_scn())); - // cache清空,依赖上一次next操作 + // cache clear, depends on the last next operation EXPECT_EQ(curr_lsn, iterator.iterator_storage_.start_lsn_); EXPECT_EQ(curr_lsn, iterator.iterator_storage_.end_lsn_); PALF_LOG(INFO, "runlin trace", K(iterator), K(max_scn_case1), K(curr_lsn)); end_lsn_v = LSN(1000000000); - // 当replayable_point_scn为max_log_ts,预期max_log_ts前的日志可以吐出5条日志 + // When replayable_point_scn is max_log_ts, expect 5 logs to be output before max_log_ts EXPECT_EQ(OB_SUCCESS, iterator.next(max_scn_case1)); count--; while (count > 0) { EXPECT_EQ(OB_SUCCESS, iterator.next(max_scn_case1)); count--; } EXPECT_EQ(OB_ITER_END, iterator.next(max_scn_case1)); - // case2: next 功能是否正常 - // 尝试读取后续的5条日志 + // case2: next function is normal or not + // Try to read the next 5 logs count = 5; PALF_LOG(INFO, "runlin trace case2", K(iterator), K(max_scn_case2)); @@ -761,82 +750,80 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator) EXPECT_EQ(OB_SUCCESS, iterator.next(max_scn_case2)); count--; } - - // 此时的curr_entry已经是第三次提交日志的第一条日志日志(first_log) - // 由于该日志对应的时间戳比max_scn_case2大,因此不会吐出 - // NB: 这里测试时,遇到过以下情况:case3的第一次 next后的EXPECT_EQ: - // curr_entry变为first_log后,在后续的测试中,尝试把file_end_lsn设置到 - // fisrt_log之前,然后出现了一种情况,此时调用next(fist_log_ts, next_log_min_scn)后, - // next_log_min_scn被设置为first_scn+1,对外表现为:尽管存在first_log,但外部在 - // 没有看到first_log之前就已经next_log_min_scn一定大于first_scn + // At this point, curr_entry is already the first log (first_log) of the third commit log + // Since the timestamp of this log is greater than max_scn_case2, it will not be output + // NB: Here, during testing, we encountered the following situation: case3's first next after EXPECT_EQ: + // curr_entry becomes first_log after that, in subsequent tests, try setting file_end_lsn to + // before fisrt_log, then a situation occurred, at this point calling next(fist_log_ts, next_log_min_scn) afterwards, + // next_log_min_scn is set to first_scn+1, externally it appears as: although first_log exists, the external party sees that + // Before seeing first_log, next_log_min_scn must be greater than first_scn // - // 实际上,这种情况是不会出现的,因为file_end_lsn不会回退的 + // Actually, this situation will not occur because file_end_lsn will not retreat EXPECT_EQ(OB_ITER_END, iterator.next(max_scn_case2)); //case3: next(replayable_point_scn, &next_log_min_scn) PALF_LOG(INFO, "runlin trace case3", K(iterator), K(max_scn_case3), K(end_lsn_v), K(max_scn_case2)); SCN first_scn = logts[0]; - // 在使用next(replayable_point_scn, &next_log_min_scn)接口时 - // 我们禁止使用LogEntry的头作为迭代器终点 + // When using the next(replayable_point_scn, &next_log_min_scn) interface + // We prohibit using the head of LogEntry as the iterator endpoint LSN first_log_start_lsn = lsns[0] - sizeof(LogGroupEntryHeader); LSN first_log_end_lsn = lsns[0]+log_size+sizeof(LogEntryHeader); SCN next_log_min_scn; bool iterate_end_by_replayable_point = false; count = 5; - // 模拟提前达到文件终点, 没有读过新日志,因此next_log_min_scn为prev_entry_scn_+1 + // Simulate reaching the end of the file in advance, no new logs have been read, therefore next_log_min_scn is prev_entry_scn_ + 1 end_lsn_v = first_log_start_lsn - 1; CLOG_LOG(INFO, "runlin trace 1", K(iterator), K(end_lsn_v), KPC(end_lsn), K(max_scn_case2), K(first_scn)); EXPECT_EQ(OB_ITER_END, iterator.next(SCN::plus(first_scn, 10000), next_log_min_scn, iterate_end_by_replayable_point)); - // file_end_lsn尽管回退了,但curr_entry_已经没有被读取过, 因此next_log_min_scn依旧为first_scn + // Although file_end_lsn has been rolled back, curr_entry_ has not been read, so next_log_min_scn is still first_scn EXPECT_EQ(SCN::plus(iterator.iterator_impl_.prev_entry_scn_, 1), next_log_min_scn); EXPECT_EQ(iterate_end_by_replayable_point, false); CLOG_LOG(INFO, "runlin trace 3.1", K(iterator), K(end_lsn_v), KPC(end_lsn)); EXPECT_EQ(first_log_start_lsn, iterator.iterator_impl_.log_storage_->get_lsn(iterator.iterator_impl_.curr_read_pos_)); - - // 读取一条日志成功,next_log_min_scn会被重置 - // curr_entry为fisrt_log_ts对应的log + // Read a log successfully, next_log_min_scn will be reset + // curr_entry is the log corresponding to fisrt_log_ts end_lsn_v = first_log_end_lsn; CLOG_LOG(INFO, "runlin trace 2", K(iterator), K(end_lsn_v), KPC(end_lsn)); EXPECT_EQ(OB_SUCCESS, iterator.next(first_scn, next_log_min_scn, iterate_end_by_replayable_point)); count--; - // iterator 返回成功,next_log_min_scn应该为OB_INVALID_TIMESTAMP + // iterator returns successfully, next_log_min_scn should be OB_INVALID_TIMESTAMP EXPECT_EQ(next_log_min_scn.is_valid(), false); - // iterator中的prev_entry_scn_被设置为first_scn + // iterator's prev_entry_scn_ is set to first_scn EXPECT_EQ(iterator.iterator_impl_.prev_entry_scn_, first_scn); CLOG_LOG(INFO, "runlin trace 3", K(iterator), K(end_lsn_v), KPC(end_lsn)); { - // 模拟提前达到文件终点, 此时文件终点为file_log_end_lsn - // 预期next_log_min_scn为first_scn对应的日志+1 + // Simulate reaching the end of the file in advance, at which point the end of the file is file_log_end_lsn + // Expected next_log_min_scn to be the log corresponding to first_scn + 1 SCN second_scn = logts[1]; EXPECT_EQ(OB_ITER_END, iterator.next(second_scn, next_log_min_scn, iterate_end_by_replayable_point)); - // iterator返回OB_ITER_END,next_log_min_scn为first_scn+1 + // iterator returns OB_ITER_END, next_log_min_scn is first_scn + 1 EXPECT_EQ(next_log_min_scn, SCN::plus(first_scn, 1)); EXPECT_EQ(iterate_end_by_replayable_point, false); CLOG_LOG(INFO, "runlin trace 3", K(iterator), K(end_lsn_v), KPC(end_lsn), K(first_scn), K(second_scn)); - // 再次调用next,预期next_log_min_scn依旧为first_scn+1 + // Call next again, expect next_log_min_scn to still be first_scn + 1 EXPECT_EQ(OB_ITER_END, iterator.next(second_scn, next_log_min_scn, iterate_end_by_replayable_point)); - // iterator返回OB_ITER_END,next_log_min_scn为first_scn+1 + // iterator returns OB_ITER_END, next_log_min_scn is first_scn + 1 EXPECT_EQ(next_log_min_scn, SCN::plus(first_scn, 1)); } CLOG_LOG(INFO, "runlin trace 4", K(iterator), K(end_lsn_v), KPC(end_lsn)); SCN prev_next_success_scn; - // 模拟到达replayable_point_scn,此时文件终点为second log, 预期next_log_min_scn为replayable_point_scn+1 - // 同时replayable_point_scn < 缓存的日志时间戳 + // Simulate reaching replayable_point_scn, at this time the file end is second log, expected next_log_min_scn to be replayable_point_scn+1 + // simultaneously replayable_point_scn < cached log timestamp { SCN second_scn = logts[1]; SCN replayable_point_scn = SCN::minus(second_scn, 1); end_lsn_v = lsns[1]+log_size+sizeof(LogEntryHeader); EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(iterate_end_by_replayable_point, true); - // iterator返回OB_ITER_END,next_log_min_scn为replayable_point_scn + 1 + // iterator returns OB_ITER_END, next_log_min_scn is replayable_point_scn + 1 PALF_LOG(INFO, "runliun trace 4.1", K(replayable_point_scn), K(next_log_min_scn), K(iterator)); EXPECT_EQ(next_log_min_scn, SCN::plus(replayable_point_scn, 1)); - // 再次调用next,预期next_log_min_scn还是replayable_point_scn+1 + // Call next again, expect next_log_min_scn to still be replayable_point_scn+1 EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); - // iterator返回OB_ITER_END,next_log_min_scn为replayable_point_scn+1 + // iterator returns OB_ITER_END, next_log_min_scn is replayable_point_scn + 1 EXPECT_EQ(next_log_min_scn, SCN::plus(replayable_point_scn, 1)); EXPECT_EQ(iterate_end_by_replayable_point, true); EXPECT_EQ(OB_SUCCESS, iterator.next(second_scn, next_log_min_scn, iterate_end_by_replayable_point)); count--; @@ -844,31 +831,29 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator) prev_next_success_scn = iterator.iterator_impl_.prev_entry_scn_; EXPECT_EQ(prev_next_success_scn, second_scn); } - - // 模拟file end lsn不是group entry的终点 + // Simulate file end lsn is not the endpoint of group entry { - // 设置终点为第三条日志LogEntry对应的起点 + // Set the endpoint to the start point of the third LogEntry end_lsn_v = lsns[2]+10; - // 设置时间戳为第三条日志 + // Set timestamp to the third log SCN third_scn = logts[2]; SCN replayable_point_scn = SCN::plus(third_scn, 10); CLOG_LOG(INFO, "runlin trace 5.1", K(iterator), K(end_lsn_v), KPC(end_lsn), K(replayable_point_scn)); - // 此时内存中缓存的日志为第三条日志, iterator读取过新日志,但该日志由于end_lsn的原因不可读(此时,由于日志非受控回放,因此curr_read_pos_会被递推56) - // 因此next_log_min_scn会被设置为third_scn + // At this time, the log cached in memory is the third log, iterator has read new logs, but this log is unreadable due to end_lsn (at this point, since the log is not controlled replay, curr_read_pos_ will be advanced by 56) + // Therefore next_log_min_scn will be set to third_scn EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); CLOG_LOG(INFO, "runlin trace 5.1.1", K(iterator), K(next_log_min_scn), K(replayable_point_scn)); EXPECT_EQ(next_log_min_scn, third_scn); EXPECT_EQ(iterate_end_by_replayable_point, false); - - // 验证第三条日志由于受控回放无法吐出(replayable_point_scn回退是不可能出现的,为了测试故意模拟) + // Validate the third log entry as controlled replay cannot output (replayable_point_scn rollback should not occur, simulated intentionally for testing) replayable_point_scn = SCN::minus(third_scn, 4); EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); - // 由于replayable_point_scn与curr_entry_之间不可能有日志,同时replayable_point_scnget_max_lsn()); - - // raw write 变为 Append后,在写入一些日志 - // 测试raw write变apend后,迭代日志是否正常 + // raw write becomes Append after, then writes some logs + // Test raw write change to append, whether the iterative log is normal { std::vector logts_append; std::vector lsns_append; @@ -915,19 +898,17 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator) EXPECT_EQ(OB_SUCCESS, wait_lsn_until_flushed(raw_write_leader.palf_handle_impl_->get_max_lsn(), raw_write_leader)); PALF_LOG(INFO, "runlin trace 6.4", "raw_write_leader_lsn", raw_write_leader.palf_handle_impl_->get_max_lsn(), "new_leader_lsn", leader.palf_handle_impl_->get_max_lsn()); - - // case 7 end_lsn_v 为很大的值之后,让内存中有2M数据, 预期iterator next会由于受控回放失败,prev_entry_scn_不变 - // replayable_point_scn 为第一条日志的时间戳-2, next_log_min_scn 为append第一条LogEntry的时间戳 - // NB: 如果不将数据读到内存中来,可能会出现读数据报错OB_NEED_RETRY的问题。 + // case 7 after end_lsn_v becomes a very large value, let there be 2M of data in memory, expect iterator next to fail due to controlled replay failure, prev_entry_scn_ remains unchanged + // replayable_point_scn is the timestamp of the first log minus 2, next_log_min_scn is the timestamp when the first LogEntry is appended + // NB: If the data is not read into memory, there may be an error reading data with the issue OB_NEED_RETRY. end_lsn_v = LSN(1000000000); SCN replayable_point_scn = SCN::minus(logts_append[0], 2); EXPECT_EQ(OB_SUCCESS, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); count_append--; prev_next_success_scn = iterator.iterator_impl_.prev_entry_scn_; end_lsn_v = lsns_append[1]+2; - - // 此时curr_entry_为第二条日志, curr_entry有效但由于file end lsn不可读 - // 对于append 日志受控回放无效 + // At this point curr_entry_ is the second log, curr_entry is valid but file end lsn is unreadable + // For append log controlled replay is invalid replayable_point_scn = SCN::plus(raw_write_leader.palf_handle_impl_->get_max_scn(), 1000000); EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); PALF_LOG(INFO, "runlin trace 7.1", K(iterator), K(replayable_point_scn), K(end_lsn_v), K(logts_append[1]), K(replayable_point_scn)); @@ -939,59 +920,52 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator) EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(next_log_min_scn, logts_append[1]); EXPECT_EQ(prev_next_success_scn, iterator.iterator_impl_.prev_entry_scn_); - - // replayable_point_scn回退是一个不可能出现的情况, 但从iterator视角不能依赖这个 - // 验证replayable_point_scn回退到一个很小的值,预期next_log_min_scn为prev_next_success_scn+1 - // 模拟replayable_point_scn小于prev_entry_ + // replayable_point_scn rollback is an impossible situation, but from the iterator perspective, we cannot rely on this + // Verify replayable_point_scn rolls back to a very small value, expect next_log_min_scn to be prev_next_success_scn+1 + // Simulate replayable_point_scn less than prev_entry_ replayable_point_scn.convert_for_tx(100); PALF_LOG(INFO, "runlin trace 7.2", K(iterator), K(replayable_point_scn), K(end_lsn_v), K(logts_append[0])); EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(SCN::plus(prev_next_success_scn, 1), next_log_min_scn); EXPECT_EQ(prev_next_success_scn, iterator.iterator_impl_.prev_entry_scn_); EXPECT_EQ(iterate_end_by_replayable_point, false); - - // 在迭代一次,结果一样 + // Iterate once more, the result is the same EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(SCN::plus(prev_next_success_scn, 1), next_log_min_scn); EXPECT_EQ(prev_next_success_scn, iterator.iterator_impl_.prev_entry_scn_); - - // 验证replayable_point_scn的值为prev_next_success_scn和第二条append的日志之间, - // 预期next_log_min_scn为replayable_point_scn+1 - // 模拟replayable_point_scn位于[prev_entry_, curr_entry_] + // Verify that the value of replayable_point_scn is between prev_next_success_scn and the log of the second append, + // Expected next_log_min_scn to be replayable_point_scn + 1 + // Simulate replayable_point_scn located between [prev_entry_, curr_entry_] replayable_point_scn = SCN::minus(logts_append[1], 4); PALF_LOG(INFO, "runlin trace 7.3", K(iterator), K(replayable_point_scn), K(end_lsn_v), K(logts_append[1]), K(prev_next_success_scn)); EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(next_log_min_scn, SCN::plus(replayable_point_scn, 1)); - // 由于replayable_point_scn到curr_entry_之间没有日志,因此prev_entry_scn_会被推到replayable_point_scn + // Since there are no logs between replayable_point_scn and curr_entry_, prev_entry_scn_ will be pushed to replayable_point_scn EXPECT_EQ(replayable_point_scn, iterator.iterator_impl_.prev_entry_scn_); - - // 在迭代一次 + // In one iteration EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(next_log_min_scn, SCN::plus(replayable_point_scn, 1)); - // 由于replayable_point_scn到curr_entry_之间没有日志,因此prev_entry_scn_会被推到replayable_point_scn + // Since there are no logs between replayable_point_scn and curr_entry_, prev_entry_scn_ will be pushed to replayable_point_scn EXPECT_EQ(replayable_point_scn, iterator.iterator_impl_.prev_entry_scn_); - - // 验证迭代append日志成功, + // Verify that the iterative append log is successful, end_lsn_v = lsns_append[2]+2; replayable_point_scn = logts_append[0]; EXPECT_EQ(OB_SUCCESS, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(false, next_log_min_scn.is_valid()); EXPECT_EQ(logts_append[1], iterator.iterator_impl_.prev_entry_scn_); count_append--; prev_next_success_scn = logts_append[1]; - - // replayable_point_scn比较大,预期next_log_min_scn为logts_append[2] + // replayable_point_scn is large, expect next_log_min_scn to be logts_append[2] replayable_point_scn.convert_from_ts(ObTimeUtility::current_time() + 100000000); PALF_LOG(INFO, "runlin trace 7.4", K(iterator), K(replayable_point_scn), K(end_lsn_v), K(logts_append[2]), K(prev_next_success_scn)); EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(next_log_min_scn, logts_append[2]); - // 在迭代一次,结果一样 + // Iterate once more, the result is the same EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(next_log_min_scn, logts_append[2]); EXPECT_EQ(iterate_end_by_replayable_point, false); - - // 回退replayable_point_scn,预期next_log_min_scn为prev_next_success_scn+1 + // Rollback replayable_point_scn, expect next_log_min_scn to be prev_next_success_scn+1 replayable_point_scn.convert_for_tx(100); EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(SCN::plus(prev_next_success_scn, 1), next_log_min_scn); @@ -999,15 +973,14 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator) end_lsn_v = LSN(1000000000); replayable_point_scn.convert_from_ts(ObTimeUtility::current_time() + 100000000); - // 留一条日志 + // Log a message while (count_append > 1) { EXPECT_EQ(OB_SUCCESS, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(false, next_log_min_scn.is_valid()); prev_next_success_scn = iterator.iterator_impl_.prev_entry_scn_; count_append--; } - - // 验证append切回raw后是否正常工作 + // Verify that append switches back to raw and works normally { int64_t id3 = ATOMIC_AAF(&palf_id_, 1); std::vector logts_append; @@ -1027,16 +1000,15 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator) EXPECT_EQ(OB_SUCCESS, wait_lsn_until_flushed(raw_write_leader.palf_handle_impl_->get_max_lsn(), raw_write_leader)); PALF_LOG(INFO, "runlin trace 8.2", "raw_write_leader_lsn", raw_write_leader.palf_handle_impl_->get_max_lsn(), "new_leader_lsn", leader.palf_handle_impl_->get_max_lsn()); - - // replayable_point_scn偏小 + // replayable_point_scn is too small SCN replayable_point_scn; replayable_point_scn.convert_for_tx(100); PALF_LOG(INFO, "runlin trace 8.3", K(iterator), K(replayable_point_scn), K(end_lsn_v), K(logts_append[0]), K(prev_next_success_scn)); - // 迭代前一轮的日志,不需要递减count_append + // Log from the previous round, no need to decrement count_append EXPECT_EQ(OB_SUCCESS, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); prev_next_success_scn = iterator.iterator_impl_.prev_entry_scn_; - // 由于受控回放点不可读, next_log_min_scn应该为prev_next_success_scn+1 + // Since the controlled replay point is unreadable, next_log_min_scn should be prev_next_success_scn + 1 EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(SCN::plus(prev_next_success_scn, 1), next_log_min_scn); @@ -1044,10 +1016,9 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator) K(logts_append[0]), K(prev_next_success_scn)); EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(SCN::plus(prev_next_success_scn, 1), next_log_min_scn); - - // 推大受控回放点到第一条日志,但end_lsn_v也变为第一条日志的起点,此时会由于end_lsn_v不可读 - // 预期next_min_scn为replayable_point_scn. - // 由于这条日志在此前的next中,不需要受控回放,会推大curr_read_pos_到LogEntry头,再次next不需要读数据直接返回OB_ITER_END + // Push the controlled replay point to the first log, but end_lsn_v also becomes the start of the first log, at which point end_lsn_v will become unreadable + // Expected next_min_scn to be replayable_point_scn. + // Since this log was not controlled replay in the previous next, it will push curr_read_pos_ to the LogEntry header, the next next does not need to read data and will directly return OB_ITER_END end_lsn_v = lsns_append[0]+10; replayable_point_scn = logts_append[0]; PALF_LOG(INFO, "runlin trace 8.4", K(iterator), K(replayable_point_scn), K(end_lsn_v), @@ -1064,8 +1035,8 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator) PALF_LOG(INFO, "runlin trace 8.4.2", K(iterator), K(replayable_point_scn), K(end_lsn_v), K(logts_append[0]), K(prev_next_success_scn)); - // 模拟prev_entry_后没有日志,replayable_point_scn小于prev_entry_scn_, 后续日志都需要受控回放 - // replayable_point_scn回退是不会出现的事,此时next_min_scn会返回prev_entry_scn_+1 + // Simulate no log after prev_entry_, replayable_point_scn less than prev_entry_scn_, subsequent logs need to be controlled replay + // replayable_point_scn rollback will not happen, at this time next_min_scn will return prev_entry_scn_ + 1 replayable_point_scn = SCN::minus(prev_next_success_scn, 100); EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(SCN::plus(prev_next_success_scn, 1), next_log_min_scn); @@ -1073,9 +1044,8 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator) EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(SCN::plus(prev_next_success_scn, 1), next_log_min_scn); - - // 模拟prev_entry后有日志 - // 推大end_lsn_v到第二条日志的起点 + // Simulate logs after prev_entry + // Push end_lsn_v to the start of the second log end_lsn_v = lsns_append[1]+2; replayable_point_scn = logts_append[1]; PALF_LOG(INFO, "runlin trace 8.5", K(iterator), K(replayable_point_scn), K(end_lsn_v), @@ -1087,19 +1057,18 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator) PALF_LOG(INFO, "runlin trace 8.6", K(iterator), K(replayable_point_scn), K(end_lsn_v), K(logts_append[1]), K(prev_next_success_scn)); - // 模拟prev_entry_后有日志, 但不可见的情况 - // 此时会由于replayable_point_scn不吐出第二条日志 - // 模拟replayable_point_scn在prev_entry_之前的情况 + // Simulate the situation where there are logs after prev_entry_, but they are not visible + // At this point, the second log will not be output due to replayable_point_scn + // Simulate the situation where replayable_point_scn is before prev_entry_ replayable_point_scn.convert_for_tx(100); EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(SCN::plus(prev_next_success_scn, 1), next_log_min_scn); EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(SCN::plus(prev_next_success_scn, 1), next_log_min_scn); - - // 模拟replayable_point_scn在prev_entry_之后的情况, 由于prev_enty_后有日志,因此 - // prev_entry_到replayable_point_scn之间不可能有未读过的日志, - // 因此next_log_min_scn为replayable_point_scn + 1. + // Simulate the situation where replayable_point_scn is after prev_entry_, since there are logs after prev_entry_, therefore + // there cannot be any unread logs between prev_entry_ and replayable_point_scn, + // Therefore next_log_min_scn is replayable_point_scn + 1. replayable_point_scn = SCN::plus(prev_next_success_scn , 2); PALF_LOG(INFO, "runlin trace 8.7", K(iterator), K(replayable_point_scn), K(end_lsn_v), K(logts_append[1]), K(prev_next_success_scn)); @@ -1108,8 +1077,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator) EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(SCN::plus(replayable_point_scn, 1), next_log_min_scn); - - // 模拟replayable_point_scn在curr_entry之后的情况 + // Simulate the situation after curr_entry for replayable_point_scn replayable_point_scn.convert_from_ts(ObTimeUtility::current_time() + 100000000); PALF_LOG(INFO, "runlin trace 8.8", K(iterator), K(replayable_point_scn), K(end_lsn_v), K(logts_append[1]), K(prev_next_success_scn)); @@ -1124,8 +1092,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator) EXPECT_EQ(next_log_min_scn.is_valid(), false); EXPECT_EQ(iterator.iterator_impl_.prev_entry_scn_, logts_append[1]); prev_next_success_scn = iterator.iterator_impl_.prev_entry_scn_; - - // 验证受控回放 + // Validate controlled replay replayable_point_scn.convert_for_tx(100); EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_log_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(SCN::plus(prev_next_success_scn, 1), next_log_min_scn); @@ -1133,7 +1100,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator) } } } - // 验证重启 + // Validate restart restart_paxos_groups(); { PalfHandleImplGuard raw_write_leader; @@ -1220,14 +1187,13 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) SCN max_scn2 = leader.palf_handle_impl_->get_max_scn(); LSN end_pos_of_log2 = leader.palf_handle_impl_->get_max_lsn(); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(leader, leader.palf_handle_impl_->get_max_lsn())); - - // 提交几条日志到raw_write leader + // Submit a few logs to raw_write leader EXPECT_EQ(OB_ITER_END, read_and_submit_group_log(leader, raw_write_leader)); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(raw_write_leader, raw_write_leader.palf_handle_impl_->get_max_lsn())); PalfBufferIterator iterator; EXPECT_EQ(OB_SUCCESS, raw_write_leader.palf_handle_impl_->alloc_palf_buffer_iterator(LSN(0), iterator)); - // 迭代flashback之前的日志成功 + // Iteration of logs before flashback successful SCN next_min_scn; SCN tmp_scn; tmp_scn.val_ = 1000; bool iterate_end_by_replayable_point = false; @@ -1247,8 +1213,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) int64_t mode_version; switch_flashback_to_append(raw_write_leader, mode_version); - - // 磁盘上存在三条日志,一条日志已经迭代,另外一条日志没有迭代(raw_write),最后一条日志为Append + // There are three logs on the disk, one log has been iterated, another log has not been iterated (raw_write), and the last log is Append EXPECT_EQ(OB_SUCCESS, submit_log(raw_write_leader, 1, leader_idx, 333)); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(raw_write_leader, raw_write_leader.palf_handle_impl_->get_max_lsn())); @@ -1257,14 +1222,13 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) PALF_LOG(INFO, "runlin trace case2", K(iterator), K(max_scn3), "end_lsn:", raw_write_leader.palf_handle_impl_->get_end_lsn()); LSN iterator_end_lsn = iterator.iterator_storage_.end_lsn_; - // iterator内存中有几条日志,预期返回成功, 此时会清cache, 前一条日志的信息会被清除(raw_write日志) - // 迭代器游标预期依旧指向第一条日志的终点, 由于受控回放,返回iterate_end + // iterator memory contains how many logs, expect to return success, at this time cache will be cleared, the information of the previous log will be cleared (raw_write log) + // Iterator cursor is expected to still point to the end of the first log, due to controlled replay, return iterate_end EXPECT_EQ(OB_ITER_END, iterator.next( max_scn1, next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(end_pos_of_log1, iterator.iterator_impl_.log_storage_->get_lsn(iterator.iterator_impl_.curr_read_pos_)); EXPECT_EQ(true, iterator.iterator_impl_.curr_entry_is_raw_write_); - - // 需要从磁盘上将后面两日志读上来,但由于受控回放不会吐出 + // Need to read the last two logs from the disk, but controlled playback will not output // EXPECT_FALSE(iterator_end_lsn == iterator.iterator_storage_.end_lsn_); EXPECT_EQ(OB_SUCCESS, iterator.next(max_scn2, next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(false, iterate_end_by_replayable_point); @@ -1275,9 +1239,8 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) EXPECT_EQ(false, iterate_end_by_replayable_point); EXPECT_EQ(false, iterator.iterator_impl_.curr_entry_is_raw_write_); EXPECT_EQ(iterator.iterator_impl_.prev_entry_scn_, max_scn3); - - // raw_write_leader已经有三条日志, raw_write(1 log entry), raw_write(1), append(1), - // 模拟一条group entry 中有多条小日志 + // raw_write_leader already has three logs, raw_write(1 log entry), raw_write(1), append(1), + // Simulate a group entry with multiple small logs LSN last_lsn = raw_write_leader.palf_handle_impl_->get_max_lsn(); SCN last_scn = raw_write_leader.palf_handle_impl_->get_max_scn(); @@ -1308,9 +1271,8 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) } cond.cond_.signal(); - - // 验证从一条包含多条LogEntry中日志中flashback,iterator迭代到中间的LogEntry后,flashback位点前还有几条LogEntry - // LogGroup LogGroup LogGroup LogGroup LogGroup(9条小日志) + // Verify flashback from a log containing multiple LogEntries, after the iterator iterates to an intermediate LogEntry, how many LogEntries are before the flashback point + // LogGroup LogGroup LogGroup LogGroup LogGroup(9 small logs) EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(raw_write_leader, raw_write_leader.palf_handle_impl_->get_max_lsn())); { const int64_t id_new_raw_write = ATOMIC_AAF(&palf_id_, 1); @@ -1327,7 +1289,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) EXPECT_EQ(OB_SUCCESS, new_raw_write_leader.palf_handle_impl_->alloc_palf_group_buffer_iterator(LSN(0), group_iterator)); SCN replayable_point_scn(SCN::min_scn()); - // 验证replayable_point_scn为min_scn + // Verify replayable_point_scn is min_scn EXPECT_EQ(OB_ITER_END, buff_iterator.next(replayable_point_scn, next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(iterate_end_by_replayable_point, true); EXPECT_EQ(next_min_scn, SCN::plus(replayable_point_scn, 1)); @@ -1336,9 +1298,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) EXPECT_EQ(iterate_end_by_replayable_point, true); EXPECT_EQ(next_min_scn, SCN::plus(replayable_point_scn, 1)); EXPECT_EQ(group_iterator.iterator_impl_.prev_entry_scn_, replayable_point_scn); - - - // replayable_point_scn为第一条日志-1 + // replayable_point_scn is the first log - 1 replayable_point_scn = SCN::minus(max_scn1, 1); EXPECT_EQ(OB_ITER_END, buff_iterator.next(replayable_point_scn, next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(iterate_end_by_replayable_point, true); @@ -1348,8 +1308,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) EXPECT_EQ(iterate_end_by_replayable_point, true); EXPECT_EQ(next_min_scn, SCN::plus(replayable_point_scn, 1)); EXPECT_EQ(group_iterator.iterator_impl_.prev_entry_scn_, replayable_point_scn); - - // replayable_point_scn为第一条日志 + // replayable_point_scn is the first log entry replayable_point_scn = max_scn1; EXPECT_EQ(OB_SUCCESS, buff_iterator.next(replayable_point_scn, next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(iterate_end_by_replayable_point, false); @@ -1357,8 +1316,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) EXPECT_EQ(OB_SUCCESS, group_iterator.next(replayable_point_scn, next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(iterate_end_by_replayable_point, false); EXPECT_EQ(group_iterator.iterator_impl_.prev_entry_scn_, replayable_point_scn); - - // replayable_point_scn为第一条日志 + 1 + // replayable_point_scn is the first log + 1 replayable_point_scn = SCN::plus(max_scn1, 1); EXPECT_EQ(OB_ITER_END, buff_iterator.next(replayable_point_scn, next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(next_min_scn, SCN::plus(replayable_point_scn, 1)); @@ -1368,22 +1326,19 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) EXPECT_EQ(next_min_scn, SCN::plus(replayable_point_scn, 1)); EXPECT_EQ(iterate_end_by_replayable_point, true); EXPECT_EQ(group_iterator.iterator_impl_.prev_entry_scn_, replayable_point_scn); - - // 成功迭代第二条日志,第三条日志 + // Successful iteration of the second log, third log replayable_point_scn = last_scn; EXPECT_EQ(OB_SUCCESS, buff_iterator.next(replayable_point_scn)); EXPECT_EQ(OB_SUCCESS, group_iterator.next(replayable_point_scn)); EXPECT_EQ(OB_SUCCESS, buff_iterator.next(replayable_point_scn)); EXPECT_EQ(OB_SUCCESS, group_iterator.next(replayable_point_scn)); - - // 第四条日志一定是LogGroupEntry + // The fourth log must be a LogGroupEntry replayable_point_scn = scns[0]; EXPECT_EQ(OB_SUCCESS, buff_iterator.next(replayable_point_scn)); EXPECT_EQ(buff_iterator.iterator_impl_.prev_entry_scn_, replayable_point_scn); EXPECT_EQ(OB_SUCCESS, group_iterator.next(replayable_point_scn)); EXPECT_EQ(group_iterator.iterator_impl_.prev_entry_scn_, replayable_point_scn); - - // 迭代第五条LogGroupEntry的第一条LogEntry + // Iterate the first LogEntry of the fifth LogGroupEntry EXPECT_EQ(OB_ITER_END, buff_iterator.next(replayable_point_scn, next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(next_min_scn, SCN::plus(replayable_point_scn, 1)); EXPECT_EQ(iterate_end_by_replayable_point, true); @@ -1397,90 +1352,80 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) EXPECT_EQ(group_iterator.iterator_impl_.prev_entry_scn_, replayable_point_scn); EXPECT_NE(group_iterator.iterator_impl_.log_storage_->get_lsn( group_iterator.iterator_impl_.curr_read_pos_), lsns[1]); - - // 由于被受控回放,buff_iterator以及group_iterator都没有推进curr_read_pos_ + // Due to controlled replay, buff_iterator and group_iterator have not advanced curr_read_pos_ EXPECT_EQ(group_iterator.iterator_impl_.log_storage_->get_lsn( group_iterator.iterator_impl_.curr_read_pos_), buff_iterator.iterator_impl_.log_storage_->get_lsn( buff_iterator.iterator_impl_.curr_read_pos_)); - - // 成功迭代第五条LogGroupEntry的第一条LogEntry + // Successfully iterated the first LogEntry of the fifth LogGroupEntry replayable_point_scn = scns[1]; EXPECT_EQ(OB_SUCCESS, buff_iterator.next(replayable_point_scn, next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(buff_iterator.iterator_impl_.prev_entry_scn_, replayable_point_scn); EXPECT_EQ(buff_iterator.iterator_impl_.log_storage_->get_lsn( buff_iterator.iterator_impl_.curr_read_pos_), lsns[1]); - - // group iterator被受控回放, 但由于第五条日志的max_scn大于受控回放点,故受控回放 + // group iterator is controlled replay, but since the max_scn of the fifth log is greater than the controlled replay point, hence controlled replay EXPECT_EQ(OB_ITER_END, group_iterator.next(replayable_point_scn, next_min_scn, iterate_end_by_replayable_point)); - // 由于受控回放的group entry对应的min scn和replayable_point_scn一样,因此next_min_scn会被设置为replayable_point_scn + // Since the min scn and replayable_point_scn of the group entry for controlled replay are the same, next_min_scn will be set to replayable_point_scn EXPECT_EQ(next_min_scn, replayable_point_scn); EXPECT_EQ(iterate_end_by_replayable_point, true); EXPECT_EQ(group_iterator.iterator_impl_.prev_entry_scn_, scns[0]); EXPECT_NE(group_iterator.iterator_impl_.log_storage_->get_lsn( group_iterator.iterator_impl_.curr_read_pos_), lsns[1]); - - // 由于被第一条LogEntry受控回放,group_iterator没有推进curr_read_pos_, buff_iter推进了curr_read_pos_ + // Due to the first LogEntry being controlled replay, group_iterator did not advance curr_read_pos_, but buff_iter advanced curr_read_pos_ EXPECT_NE(group_iterator.iterator_impl_.log_storage_->get_lsn( group_iterator.iterator_impl_.curr_read_pos_), buff_iterator.iterator_impl_.log_storage_->get_lsn( buff_iterator.iterator_impl_.curr_read_pos_)); - - // buff_iterator的游标到了第五条group_entry的第一条小日志 - // grou_iterator的游标到了第五条group_entry开头 - // sncs[0] 第四条group entry,scns[1] - scns[9]是第二条 - // 第五条group entry的第五条小日志被flashback + // buff_iterator's cursor is at the first small log of the fifth group_entry + // grou_iterator's cursor is at the beginning of the fifth group_entry + // sncs[0] fourth group entry, scns[1] - scns[9] are the second + // The fifth small log of the fifth group entry was flashback EXPECT_EQ(OB_SUCCESS, new_raw_write_leader.palf_handle_impl_->inner_flashback(scns[4])); EXPECT_EQ(new_raw_write_leader.palf_handle_impl_->get_max_scn(), scns[4]); EXPECT_EQ(OB_SUCCESS, change_access_mode_to_append(new_raw_write_leader)); - // 提交一条group_entry - // 对于buff_iterator, 存在两条group_entry未读,一条raw_rwrite(包含4条小日志,游标停留在第一条小日志末尾),一条append - // 对于group_iterator, 存在三条group_entry未读,一条raw_rwrite(包含4条小日志,游标停留在group_entry头部),一条append + // submit a group_entry + // For buff_iterator, there are two unread group_entry, one raw_rwrite (including 4 small logs, cursor stops at the end of the first small log), one append + // For group_iterator, there are three unread group_entries, one raw_rwrite (containing 4 small logs, cursor is at the head of group_entry), one append EXPECT_EQ(OB_SUCCESS, submit_log(new_raw_write_leader, 1, leader_idx, 100)); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(new_raw_write_leader, new_raw_write_leader.palf_handle_impl_->get_max_lsn())); - - // 对于buff_iterator - // lsns[2]为第二条小日志开头,即第一条小日志末尾 - // 验证游标起始位置为第一条小日志头部 - // next 返回iterate是否清空cache - // 迭代raw_write写入的小日志 - // 迭代append写入的小日志 + // For buff_iterator + // lsns[2] is the start of the second small log, i.e., the end of the first small log + // Verify the cursor starting position is at the header of the first small log + // next returns whether iterate clears the cache + // Iterate over small logs written by raw_write + // iteration append write small log PALF_LOG(INFO, "rulin trace 1", K(lsns[2]), K(lsns[1]), K(lsns[0]), K(buff_iterator)); EXPECT_EQ(buff_iterator.iterator_impl_.log_storage_->get_lsn(buff_iterator.iterator_impl_.curr_read_pos_), lsns[1]); EXPECT_EQ(OB_ITER_END, buff_iterator.next(SCN::min_scn(), next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(true, iterate_end_by_replayable_point); EXPECT_EQ(next_min_scn, SCN::plus(buff_iterator.iterator_impl_.prev_entry_scn_, 1)); EXPECT_EQ(0, buff_iterator.iterator_impl_.curr_read_pos_); - // 迭代第二条日志 + // Iterate the second log EXPECT_EQ(OB_SUCCESS, buff_iterator.next(SCN::max_scn())); - // 迭代第三条日志 + // Iterate third log EXPECT_EQ(OB_SUCCESS, buff_iterator.next(SCN::max_scn())); - // 迭代第四条日志 + // Iterate fourth log EXPECT_EQ(OB_SUCCESS, buff_iterator.next(SCN::max_scn())); - - // 迭代第五条日志(迭代新的GroupENtry, 非受控回放) + // Iterate fifth log (iterate new GroupEntry, non-controlled replay) EXPECT_EQ(OB_SUCCESS, buff_iterator.next(SCN::min_scn())); EXPECT_EQ(OB_ITER_END, buff_iterator.next(SCN::min_scn())); - - // 对于group_iterator - // 验证游标起始位置为raw_write日志开头 - // next 返回iterate是否清空cache - // 迭代raw_write写入的大日志 - // 迭代append写入的大日志 + // For group_iterator + // Verify that the cursor start position is at the beginning of the raw_write log + // next returns whether iterate clears the cache + // Iterate over large logs written by raw_write + // iteration append write large log PALF_LOG(INFO, "rulin trace 2", K(lsns[2]), K(lsns[1]), K(lsns[0]), K(group_iterator)); EXPECT_EQ(group_iterator.iterator_impl_.log_storage_->get_lsn(group_iterator.iterator_impl_.curr_read_pos_), lsns[1] - sizeof(LogGroupEntryHeader)); EXPECT_EQ(OB_ITER_END, group_iterator.next(SCN::min_scn(), next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(true, iterate_end_by_replayable_point); EXPECT_EQ(next_min_scn, SCN::plus(group_iterator.iterator_impl_.prev_entry_scn_, 1)); - - // 迭代raw_write日志 + // Iterate raw_write log EXPECT_EQ(OB_SUCCESS, group_iterator.next(SCN::max_scn())); EXPECT_EQ(OB_SUCCESS, group_iterator.next(SCN::max_scn())); EXPECT_EQ(OB_ITER_END, group_iterator.next(SCN::max_scn())); } - - // 验证从一条包含多条LogEntry中日志中flashback,iterator迭代到中间的LogEntry后,flashback位点前没有LogEntry - // LogGroup LogGroup LogGroup LogGroup LogGroup(9条小日志) + // Verify flashback from a log containing multiple LogEntries, after the iterator iterates to an intermediate LogEntry, there are no LogEntries before the flashback point + // LogGroup LogGroup LogGroup LogGroup LogGroup(9 small logs) EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(raw_write_leader, raw_write_leader.palf_handle_impl_->get_max_lsn())); { const int64_t id_new_raw_write = ATOMIC_AAF(&palf_id_, 1); @@ -1495,8 +1440,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) EXPECT_EQ(OB_SUCCESS, new_raw_write_leader.palf_handle_impl_->alloc_palf_buffer_iterator(LSN(0), buff_iterator)); EXPECT_EQ(OB_SUCCESS, new_raw_write_leader.palf_handle_impl_->alloc_palf_group_buffer_iterator(LSN(0), group_iterator)); - - // 成功迭代第一条日志,第二条日志,第三条日志 + // Successfully iterated the first log, second log, third log SCN replayable_point_scn(last_scn); EXPECT_EQ(OB_SUCCESS, buff_iterator.next(replayable_point_scn, next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(OB_SUCCESS, group_iterator.next(replayable_point_scn, next_min_scn, iterate_end_by_replayable_point)); @@ -1506,15 +1450,13 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) EXPECT_EQ(OB_SUCCESS, buff_iterator.next(replayable_point_scn)); EXPECT_EQ(OB_SUCCESS, group_iterator.next(replayable_point_scn)); - - // 第四条日志一定是LogGroupEntry + // The fourth log must be a LogGroupEntry replayable_point_scn = scns[0]; EXPECT_EQ(OB_SUCCESS, buff_iterator.next(replayable_point_scn)); EXPECT_EQ(buff_iterator.iterator_impl_.prev_entry_scn_, replayable_point_scn); EXPECT_EQ(OB_SUCCESS, group_iterator.next(replayable_point_scn)); EXPECT_EQ(group_iterator.iterator_impl_.prev_entry_scn_, replayable_point_scn); - - // 迭代第五条LogGroupEntry的第一条LogEntry + // Iterate the first LogEntry of the fifth LogGroupEntry EXPECT_EQ(OB_ITER_END, buff_iterator.next(replayable_point_scn, next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(next_min_scn, SCN::plus(replayable_point_scn, 1)); EXPECT_EQ(iterate_end_by_replayable_point, true); @@ -1528,90 +1470,80 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) EXPECT_EQ(group_iterator.iterator_impl_.prev_entry_scn_, replayable_point_scn); EXPECT_NE(group_iterator.iterator_impl_.log_storage_->get_lsn( group_iterator.iterator_impl_.curr_read_pos_), lsns[1]); - - // 由于被受控回放,buff_iterator以及group_iterator都没有推进curr_read_pos_ + // Due to controlled replay, buff_iterator and group_iterator have not advanced curr_read_pos_ EXPECT_EQ(group_iterator.iterator_impl_.log_storage_->get_lsn( group_iterator.iterator_impl_.curr_read_pos_), buff_iterator.iterator_impl_.log_storage_->get_lsn( buff_iterator.iterator_impl_.curr_read_pos_)); - - // 成功迭代第五条LogGroupEntry的第一条LogEntry + // Successfully iterated the first LogEntry of the fifth LogGroupEntry replayable_point_scn = scns[1]; EXPECT_EQ(OB_SUCCESS, buff_iterator.next(replayable_point_scn, next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(buff_iterator.iterator_impl_.prev_entry_scn_, replayable_point_scn); EXPECT_EQ(buff_iterator.iterator_impl_.log_storage_->get_lsn( buff_iterator.iterator_impl_.curr_read_pos_), lsns[1]); - - // group iterator被受控回放, 但由于第五条日志的max_scn大于受控回放点,故受控回放 + // group iterator is controlled replay, but since the max_scn of the fifth log is greater than the controlled replay point, hence controlled replay EXPECT_EQ(OB_ITER_END, group_iterator.next(replayable_point_scn, next_min_scn, iterate_end_by_replayable_point)); - // 由于受控回放的group entry对应的min scn和replayable_point_scn一样,因此next_min_scn会被设置为replayable_point_scn + // Since the min scn and replayable_point_scn of the group entry for controlled replay are the same, next_min_scn will be set to replayable_point_scn EXPECT_EQ(next_min_scn, replayable_point_scn); EXPECT_EQ(iterate_end_by_replayable_point, true); EXPECT_EQ(group_iterator.iterator_impl_.prev_entry_scn_, scns[0]); EXPECT_NE(group_iterator.iterator_impl_.log_storage_->get_lsn( group_iterator.iterator_impl_.curr_read_pos_), lsns[1]); - - // 由于被第一条LogEntry受控回放,group_iterator没有推进curr_read_pos_, buff_iter推进了curr_read_pos_ + // Due to the first LogEntry being controlled replay, group_iterator did not advance curr_read_pos_, but buff_iter advanced curr_read_pos_ EXPECT_NE(group_iterator.iterator_impl_.log_storage_->get_lsn( group_iterator.iterator_impl_.curr_read_pos_), buff_iterator.iterator_impl_.log_storage_->get_lsn( buff_iterator.iterator_impl_.curr_read_pos_)); - - // 迭代日志发现需要受控回放 + // Iteration log discovery requires controlled replay EXPECT_EQ(OB_ITER_END, buff_iterator.next(scns[1], next_min_scn, iterate_end_by_replayable_point)); - - // buff_iterator的游标到了第五条group_entry的第一条小日志末尾 - // grou_iterator的游标到了第五条group_entry开头 - // sncs[0] 第四条group entry,scns[1] - scns[9]是第二条 - // 第五条group entry的第二条小日志被flashback + // buff_iterator's cursor reached the end of the first small log in the fifth group_entry + // grou_iterator's cursor is at the beginning of the fifth group_entry + // sncs[0] fourth group entry, scns[1] - scns[9] are the second + // The second small log of the fifth group entry was flashback EXPECT_EQ(OB_SUCCESS, new_raw_write_leader.palf_handle_impl_->inner_flashback(scns[2])); EXPECT_EQ(new_raw_write_leader.palf_handle_impl_->get_max_scn(), scns[2]); EXPECT_EQ(OB_SUCCESS, change_access_mode_to_append(new_raw_write_leader)); - // 提交一条group_entry - // 对于buff_iterator, 存在两条group_entry未读,一条raw_rwrite(包含4条小日志,游标停留在第一条小日志末尾),一条append - // 对于group_iterator, 存在三条group_entry未读,一条raw_rwrite(包含4条小日志,游标停留在group_entry头部),一条append + // submit a group_entry + // For buff_iterator, there are two unread group_entry, one raw_rwrite (including 4 small logs, cursor stops at the end of the first small log), one append + // For group_iterator, there are three unread group_entries, one raw_rwrite (containing 4 small logs, cursor is at the head of group_entry), one append EXPECT_EQ(OB_SUCCESS, submit_log(new_raw_write_leader, 1, leader_idx, 100)); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(new_raw_write_leader, new_raw_write_leader.palf_handle_impl_->get_max_lsn())); - - // 对于buff_iterator - // lsns[2]为第二条小日志开头,即第一条小日志末尾 - // 验证游标起始位置为第一条小日志头部 - // next 返回iterate是否清空cache - // 迭代raw_write写入的小日志 - // 迭代append写入的小日志 + // For buff_iterator + // lsns[2] is the start of the second small log, i.e., the end of the first small log + // Verify the cursor starting position is at the header of the first small log + // next returns whether iterate clears the cache + // Iterate over small logs written by raw_write + // iteration append write small log PALF_LOG(INFO, "rulin trace 3", K(lsns[2]), K(lsns[1]), K(lsns[0]), K(buff_iterator)); EXPECT_EQ(buff_iterator.iterator_impl_.log_storage_->get_lsn(buff_iterator.iterator_impl_.curr_read_pos_), lsns[2]); EXPECT_EQ(OB_ITER_END, buff_iterator.next(SCN::min_scn(), next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(true, iterate_end_by_replayable_point); EXPECT_EQ(next_min_scn, SCN::plus(buff_iterator.iterator_impl_.prev_entry_scn_, 1)); EXPECT_EQ(0, buff_iterator.iterator_impl_.curr_read_pos_); - // 迭代第二条小日志 + // Iterate the second small log EXPECT_EQ(OB_SUCCESS, buff_iterator.next(SCN::max_scn())); - // 迭代新写入的LogGroupEntry, 不需要受控回放 + // Iterate over newly written LogGroupEntry, no controlled replay needed EXPECT_EQ(OB_SUCCESS, buff_iterator.next(SCN::min_scn())); EXPECT_EQ(OB_ITER_END, buff_iterator.next(SCN::min_scn())); - - // 对于group_iterator - // 验证游标起始位置为raw_write日志开头 - // next 返回iterate是否清空cache - // 迭代raw_write写入的大日志 - // 迭代append写入的大日志 + // For group_iterator + // Verify that the cursor starting position is at the beginning of the raw_write log + // next returns whether iterate clears the cache + // Iterate over large logs written by raw_write + // iteration append write large log PALF_LOG(INFO, "rulin trace 4", K(lsns[2]), K(lsns[1]), K(lsns[0]), K(group_iterator)); EXPECT_EQ(group_iterator.iterator_impl_.log_storage_->get_lsn(group_iterator.iterator_impl_.curr_read_pos_), lsns[1] - sizeof(LogGroupEntryHeader)); EXPECT_EQ(OB_ITER_END, group_iterator.next(SCN::min_scn(), next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(true, iterate_end_by_replayable_point); EXPECT_EQ(next_min_scn, SCN::plus(group_iterator.iterator_impl_.prev_entry_scn_, 1)); - - // 迭代raw_write日志 + // Iterate raw_write log EXPECT_EQ(OB_SUCCESS, group_iterator.next(SCN::max_scn())); - // 迭代新的GruopEntry + // Iterate new GroupEntry EXPECT_EQ(OB_SUCCESS, group_iterator.next(SCN::min_scn())); EXPECT_EQ(OB_ITER_END, group_iterator.next(SCN::min_scn())); } - - // 验证一条LogGroupEntry需要受控回放,buff iterator不能更新accumlate_checksum和curr_read_pos_ - // LogGroup LogGroup LogGroup LogGroup LogGroup(9条小日志) + // Verify that a LogGroupEntry requires controlled replay, buff iterator should not update accumulate_checksum and curr_read_pos_ + // LogGroup LogGroup LogGroup LogGroup LogGroup(9 small logs) // last_scn scns[0] scns[1]... { const int64_t id_new_raw_write = ATOMIC_AAF(&palf_id_, 1); @@ -1633,24 +1565,21 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) replayable_point_scn = scns[0]; EXPECT_EQ(OB_SUCCESS, iterator.next(replayable_point_scn)); - // scns[1]对应的日志无法吐出 + // The log corresponding to scns[1] cannot be output EXPECT_EQ(OB_ITER_END, iterator.next(replayable_point_scn, next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(next_min_scn, SCN::plus(scns[0], 1)); EXPECT_EQ(iterator.iterator_impl_.prev_entry_scn_, scns[0]); - - // flashback到scns[0] + // flashback to scns[0] EXPECT_EQ(OB_SUCCESS, new_raw_write_leader.palf_handle_impl_->inner_flashback(scns[0])); EXPECT_EQ(OB_SUCCESS, change_access_mode_to_append(new_raw_write_leader)); EXPECT_EQ(OB_SUCCESS, submit_log(new_raw_write_leader, 1, leader_idx, 100)); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(new_raw_write_leader, new_raw_write_leader.palf_handle_impl_->get_max_lsn())); - - // scns[0]对应的日志为raw write, 被flashback了, iterator停在scns[0]的末尾 - // 迭代新写入的日志成功 + // scns[0] corresponding log is raw write, was flashbacked, iterator stops at the end of scns[0] + // Iteration of newly written logs successful EXPECT_EQ(OB_SUCCESS, iterator.next(SCN::min_scn(), next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(OB_ITER_END, iterator.next(SCN::min_scn())); } - - // 验证一条padding LogGroupEntry需要受控回放 + // Validate that a padding LogGroupEntry requires controlled replay { const int64_t append_id = ATOMIC_AAF(&palf_id_, 1); PalfHandleImplGuard append_leader; @@ -1684,10 +1613,9 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) EXPECT_EQ(true, iterate_end_by_replayable_point); EXPECT_EQ(OB_ITER_END, group_buff_iterator.next(share::SCN::min_scn(), next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(true, iterate_end_by_replayable_point); - - // 一共有33条日志,包括padding + // There are a total of 33 logs, including padding SCN replayable_point_scn = padding_scn.minus(padding_scn, 1); - // 直到padding日志受控回放 + // Until padding log controlled replay int ret = OB_SUCCESS; while (OB_SUCC(buff_iterator.next(replayable_point_scn, next_min_scn, iterate_end_by_replayable_point))) { } @@ -1709,7 +1637,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) EXPECT_EQ(false, buff_iterator.iterator_impl_.curr_entry_is_padding_); EXPECT_EQ(false, group_buff_iterator.iterator_impl_.curr_entry_is_padding_); - // flashback到padding日志尾 + // flashback to padding log tail EXPECT_EQ(OB_SUCCESS, raw_write_leader.get_palf_handle_impl()->flashback(mode_version, padding_scn, timeout_ts_us)); EXPECT_EQ(OB_SUCCESS, buff_iterator.next(padding_scn, next_min_scn, iterate_end_by_replayable_point)); LogEntry padding_log_entry; @@ -1726,12 +1654,12 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_iterator_with_flashback) EXPECT_EQ(OB_SUCCESS, group_buff_iterator.get_entry(padding_group_entry, padding_group_lsn)); EXPECT_EQ(true, padding_group_entry.check_integrity()); EXPECT_EQ(true, padding_group_entry.header_.is_padding_log()); - // 对于LogGruopEntry的iterator,在construct_padding_log_entry_后,不会重置padding状态 + // For the iterator of LogGruopEntry, after construct_padding_log_entry_, the padding state will not be reset EXPECT_EQ(true, group_buff_iterator.iterator_impl_.padding_entry_scn_.is_valid()); EXPECT_EQ(padding_log_entry.header_.scn_, padding_group_entry.header_.max_scn_); - // flashback到padding日志头 + // flashback to padding log header EXPECT_EQ(OB_SUCCESS, raw_write_leader.get_palf_handle_impl()->flashback(mode_version, padding_scn.minus(padding_scn, 1), timeout_ts_us)); - // 预期是由于文件长度导致的OB_ITER_END + // The expectation is that OB_ITER_END is caused by the file length EXPECT_EQ(OB_ITER_END, buff_iterator_padding_start.next(padding_scn, next_min_scn, iterate_end_by_replayable_point)); EXPECT_EQ(false, iterate_end_by_replayable_point); EXPECT_GE(next_min_scn, buff_iterator_padding_start.iterator_impl_.prev_entry_scn_); @@ -1762,7 +1690,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_raw_read) palf_env_impl->get_options(opts); opts.enable_log_cache_ = true; palf_env_impl->update_options(opts); - // 提交100条日志, 每条日志大小为30K. + // Submit 100 logs, each log size is 30K. { char *read_buf = read_buf_ptr; int64_t nbytes = read_buf_ptr_len; @@ -1774,8 +1702,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_raw_read) const LSN invalid_lsn(1); char *invalid_read_buf = read_buf_ptr + 1; const int64_t invalid_nbytes = 1; - - // 非DIO对齐度 + // Non-DIO alignment palf::LogIOContext io_ctx(palf::LogIOUser::META_INFO); EXPECT_EQ(OB_INVALID_ARGUMENT, leader.palf_handle_impl_->raw_read( invalid_lsn, invalid_read_buf, invalid_nbytes, out_read_size, io_ctx)); @@ -1788,23 +1715,19 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_raw_read) EXPECT_EQ(OB_INVALID_ARGUMENT, leader.palf_handle_impl_->raw_read( LSN(PALF_INITIAL_LSN_VAL), read_buf, invalid_nbytes, out_read_size, io_ctx)); PALF_LOG(INFO, "raw read success"); - - // 读取成功 + // Read successful EXPECT_EQ(OB_SUCCESS, leader.palf_handle_impl_->raw_read(LSN(PALF_INITIAL_LSN_VAL), read_buf, PALF_BLOCK_SIZE, out_read_size, io_ctx)); EXPECT_LE(out_read_size, PALF_BLOCK_SIZE); EXPECT_EQ(out_read_size, curr_real_size); - - // 读取长度超过end_lsn + // Read length exceeds end_lsn PALF_LOG(INFO, "raw read return OB_ERR_OUT_OF_UPPER_BOUND"); LSN out_of_upper_bound(PALF_BLOCK_SIZE); EXPECT_EQ(OB_ERR_OUT_OF_UPPER_BOUND, leader.palf_handle_impl_->raw_read( out_of_upper_bound, read_buf, PALF_BLOCK_SIZE, out_read_size, io_ctx)); - - // 模拟生成2个文件 + // Simulate generating 2 files EXPECT_EQ(OB_SUCCESS, submit_log(leader, 40, leader_idx, MAX_LOG_BODY_SIZE)); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(leader, leader.palf_handle_impl_->get_max_lsn())); - - // 模拟跨文件读 + // Simulate cross-file read PALF_LOG(INFO, "raw read cross file"); LSN curr_read_lsn(lower_align(PALF_BLOCK_SIZE/2, LOG_DIO_ALIGN_SIZE)); int64_t expected_read_size = LSN(PALF_BLOCK_SIZE) - curr_read_lsn; @@ -1818,8 +1741,7 @@ TEST_F(TestObSimpleLogClusterSingleReplica, test_raw_read) // curr_read_lsn, read_buf, expected_read_size, out_read_size, io_ctx)); EXPECT_EQ(OB_SUCCESS, leader.palf_handle_impl_->delete_block(0)); - - // 模拟lower_bound + // simulate lower_bound PALF_LOG(INFO, "raw read return OB_ERR_OUT_OF_LOWER_BOUND"); LSN out_of_lower_bound(PALF_INITIAL_LSN_VAL); EXPECT_EQ(OB_ERR_OUT_OF_LOWER_BOUND, leader.palf_handle_impl_->raw_read(out_of_lower_bound, read_buf, PALF_BLOCK_SIZE, out_read_size, io_ctx)); diff --git a/mittest/logservice/test_ob_simple_log_throttling.cpp b/mittest/logservice/test_ob_simple_log_throttling.cpp index ade783a48..e5cdfabe2 100644 --- a/mittest/logservice/test_ob_simple_log_throttling.cpp +++ b/mittest/logservice/test_ob_simple_log_throttling.cpp @@ -1,16 +1,20 @@ // owner: zjf225077 // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/logservice/test_ob_simple_log_throttling_arb.cpp b/mittest/logservice/test_ob_simple_log_throttling_arb.cpp index 66c7c0757..a9f19fb09 100644 --- a/mittest/logservice/test_ob_simple_log_throttling_arb.cpp +++ b/mittest/logservice/test_ob_simple_log_throttling_arb.cpp @@ -1,15 +1,21 @@ // owner: zjf225077 // owner group: log -// Copyright (c) 2021 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define private public #include "env/ob_simple_log_cluster_env.h" #undef private @@ -522,8 +528,7 @@ TEST_F(TestObSimpleLogThrottleArb, test_4f1a_degrade_upgrade) int64_t end_ts = common::ObClockGenerator::getClock(); int64_t used_time = end_ts - begin_ts; PALF_LOG(INFO, " [CASE] 4f1a degrade", K(used_time)); - - // 确保lease过期,验证loc_cb是否可以找到leader拉日志 + // Ensure lease expiration, verify if loc_cb can find leader to pull logs sleep(5); unblock_all_net(another_f2_idx); unblock_all_net(another_f3_idx); diff --git a/mittest/logservice/test_ob_simple_log_throttling_member_change.cpp b/mittest/logservice/test_ob_simple_log_throttling_member_change.cpp index 8a5c5c58a..0548da685 100644 --- a/mittest/logservice/test_ob_simple_log_throttling_member_change.cpp +++ b/mittest/logservice/test_ob_simple_log_throttling_member_change.cpp @@ -1,16 +1,20 @@ // owner: zjf225077 // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/logservice/test_ob_simple_log_truncate.cpp b/mittest/logservice/test_ob_simple_log_truncate.cpp index 0082feda5..eb10ccf81 100644 --- a/mittest/logservice/test_ob_simple_log_truncate.cpp +++ b/mittest/logservice/test_ob_simple_log_truncate.cpp @@ -1,16 +1,20 @@ // owner: zjf225077 // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public @@ -116,13 +120,13 @@ TEST_F(TestObSimpleLogClusterTruncate, truncate_log) set_rpc_loss(leader_idx, follower_1, 50); // drop 50% packet from leader -> follower_4 set_rpc_loss(leader_idx, follower_4, 90); - // follower_4 -> leader 单向断网, 阻断fetch log + // follower_4 -> leader one-way network disconnection, block fetch log block_net(follower_4, leader_idx, true); - // follower_1 -> leader 单向断网, 阻断fetch log + // follower_1 -> leader one-way network disconnection, block fetch log block_net(follower_1, leader_idx, true); PALF_LOG(INFO, "begin submit_log", K(leader_idx)); - // 保证只有leader副本拥有日志 + // Ensure only the leader replica has the log wanted_group_log_size = 1 * 1024 * 1024; log_count = 16; EXPECT_EQ(OB_SUCCESS, submit_log(leader, log_count, leader_idx, wanted_group_log_size)); @@ -130,7 +134,7 @@ TEST_F(TestObSimpleLogClusterTruncate, truncate_log) EXPECT_EQ(OB_ITER_END, read_log(leader)); PALF_LOG(INFO, "before sleep 15s", K(leader_idx)); - // election 自动切主 + // election auto role switch sleep(15); int64_t new_leader_idx = 0; PalfHandleImplGuard new_leader; diff --git a/mittest/logservice/test_ob_simple_shared_log_file_upload_mgr.cpp b/mittest/logservice/test_ob_simple_shared_log_file_upload_mgr.cpp index 5c54e93ae..695ba1102 100644 --- a/mittest/logservice/test_ob_simple_shared_log_file_upload_mgr.cpp +++ b/mittest/logservice/test_ob_simple_shared_log_file_upload_mgr.cpp @@ -2,15 +2,19 @@ // owner group: log /* - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/logservice/test_ob_simple_shared_log_garbage_collector.cpp b/mittest/logservice/test_ob_simple_shared_log_garbage_collector.cpp index eeea59559..f3898822c 100755 --- a/mittest/logservice/test_ob_simple_shared_log_garbage_collector.cpp +++ b/mittest/logservice/test_ob_simple_shared_log_garbage_collector.cpp @@ -1,15 +1,21 @@ // owner: zjf225077 // owner group: log -// Copyright (c) 2021 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define private public #include "env/ob_simple_log_cluster_env.h" #ifdef OB_BUILD_SHARED_STORAGE diff --git a/mittest/logservice/test_ob_simple_shared_log_single_replica.cpp b/mittest/logservice/test_ob_simple_shared_log_single_replica.cpp index 86be4adb3..089f47f62 100644 --- a/mittest/logservice/test_ob_simple_shared_log_single_replica.cpp +++ b/mittest/logservice/test_ob_simple_shared_log_single_replica.cpp @@ -2,15 +2,19 @@ // owner group: log /* - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public @@ -194,7 +198,7 @@ TEST_F(TestObSimpleSharedLogSingleReplica, test_shared_log_interface) EXPECT_EQ(OB_SUCCESS, ObSharedLogUtils::delete_blocks(MTL_ID(), ObLSID(id), 0, 1)); block_id_t oldest_block; EXPECT_EQ(OB_ENTRY_NOT_EXIST, ObSharedLogUtils::get_oldest_block(MTL_ID(), ObLSID(id), oldest_block)); - // LSN(0)时,会产生默认的PalfBaseInfo + // When LSN(0), the default PalfBaseInfo will be generated EXPECT_EQ(OB_SUCCESS, log_handler.get_palf_base_info(LSN(PALF_INITIAL_LSN_VAL), base_info)); EXPECT_EQ(OB_ERR_OUT_OF_LOWER_BOUND, log_handler.get_palf_base_info(LSN(PALF_BLOCK_SIZE), base_info)); @@ -384,7 +388,7 @@ TEST_F(TestObSimpleSharedLogSingleReplica, test_shared_log_interface) EXPECT_EQ(curr_lsn,leader.palf_handle_impl_->get_max_lsn()); EXPECT_EQ(curr_base_info.prev_log_info_, default_palf_base_info.prev_log_info_); EXPECT_EQ(OB_ERR_OUT_OF_LOWER_BOUND, log_handler.locate_by_lsn_coarsely(curr_lsn, locate_scn)); - // palf内部会将传入的lsn替换为committed_end_lsn + // palf internally will replace the incoming lsn with committed_end_lsn EXPECT_EQ(OB_ERR_OUT_OF_LOWER_BOUND, log_handler.locate_by_lsn_coarsely(curr_lsn+2*PALF_BLOCK_SIZE, locate_scn)); EXPECT_EQ(OB_SUCCESS, submit_log_with_expected_size(leader, id, 3)); EXPECT_EQ(OB_SUCCESS, wait_until_has_committed(leader, leader.palf_handle_impl_->get_max_lsn())); diff --git a/mittest/mtlenv/mock_gts_source.h b/mittest/mtlenv/mock_gts_source.h index 95424eb79..6ad98a213 100644 --- a/mittest/mtlenv/mock_gts_source.h +++ b/mittest/mtlenv/mock_gts_source.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_TRANSACTION_OB_LTS_SOURCE_ diff --git a/mittest/mtlenv/mock_tenant_module_env.h b/mittest/mtlenv/mock_tenant_module_env.h index 019a6656d..1bbe321ee 100644 --- a/mittest/mtlenv/mock_tenant_module_env.h +++ b/mittest/mtlenv/mock_tenant_module_env.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -112,6 +116,7 @@ #include "observer/table/common/ob_table_query_session_mgr.h" #include "lib/roaringbitmap/ob_rb_memory_mgr.h" #include "rpc/obrpc/ob_rpc_net_handler.h" +#include "observer/omt/ob_tenant_ai_service.h" namespace oceanbase { @@ -380,6 +385,7 @@ class MockTenantModuleEnv share::ObCgroupCtrl cgroup_ctrl_; obrpc::ObBatchRpc batch_rpc_; omt::ObMultiTenant multi_tenant_; + transaction::ObWeakReadService weak_read_service_; MockObService ob_service_; share::ObLocationService location_service_; share::schema::ObMultiVersionSchemaService &schema_service_; @@ -508,8 +514,7 @@ int MockTenantModuleEnv::init_dir() } else if (OB_FAIL(mkdir(sstable_dir_.c_str(), 0777))) { } else if (OB_FAIL(mkdir(slog_dir_.c_str(), 0777))) { } - - // 因为改变了工作目录,设置为绝对路径 + // Because the working directory has changed, set to absolute path for (int i=0;i 0) { @@ -627,6 +632,7 @@ void MockTenantModuleEnv::init_gctx_gconf() GCTX.net_frame_ = &net_frame_; GCTX.ob_service_ = &ob_service_; GCTX.omt_ = &multi_tenant_; + GCTX.weak_read_service_ = &weak_read_service_; GCTX.sql_engine_ = &sql_engine_; GCTX.cgroup_ctrl_ = &cgroup_ctrl_; GCTX.session_mgr_ = &session_mgr_; @@ -716,7 +722,7 @@ int MockTenantModuleEnv::init_before_start_mtl() STORAGE_LOG(WARN, "fail to init env", K(ret)); } else if (OB_FAIL(TMA_MGR_INSTANCE.init())) { STORAGE_LOG(WARN, "fail to init env", K(ret)); - } else if (OB_FAIL(OB_FILE_SYSTEM_ROUTER.get_instance().init(env_dir_.c_str()))) { + } else if (OB_FAIL(OB_FILE_SYSTEM_ROUTER.get_instance().init(env_dir_.c_str(), clog_dir_.c_str()))) { STORAGE_LOG(WARN, "fail to init env", K(ret)); #ifdef OB_BUILD_SHARED_STORAGE } else if (GCTX.is_shared_storage_mode() && OB_FAIL(init_device_config())) { @@ -740,6 +746,10 @@ int MockTenantModuleEnv::init_before_start_mtl() STORAGE_LOG(ERROR, "init server checkpoint slog handler fail", K(ret)); } else if (OB_FAIL(multi_tenant_.init(self_addr_, &sql_proxy_, false))) { STORAGE_LOG(WARN, "fail to init env", K(ret)); + } else if (OB_FAIL(weak_read_service_.init(net_frame_.get_req_transport()))) { + STORAGE_LOG(WARN, "init weak_read_service failed", KR(ret)); + } else if (FAILEDx(weak_read_service_.start())) { + STORAGE_LOG(WARN, "fail to start weak read service", KR(ret)); } else if (OB_FAIL(ObTsMgr::get_instance().init(self_addr_, schema_service_, location_service_, net_frame_.get_req_transport()))) { STORAGE_LOG(WARN, "fail to init env", K(ret)); @@ -760,9 +770,8 @@ int MockTenantModuleEnv::init_before_start_mtl() } else if (OB_FAIL(LOG_IO_DEVICE_WRAPPER.init(clog_dir_.c_str(), 8, 128, &OB_IO_MANAGER, &ObDeviceManager::get_instance()))) { STORAGE_LOG(ERROR, "init log_io_device_wrapper fail", KR(ret)); } else { - obrpc::ObRpcNetHandler::CLUSTER_ID = 1; oceanbase::palf::election::INIT_TS = 1; - // 忽略cgroup的报错 + // Ignore cgroup error cgroup_ctrl_.init(); ObTsMgr::get_instance_inner() = &ts_mgr_; GCTX.sql_proxy_ = &sql_proxy_; @@ -852,6 +861,7 @@ int MockTenantModuleEnv::init() MTL_BIND2(mtl_new_default, observer::ObTenantQueryRespTimeCollector::mtl_init,nullptr, nullptr, nullptr, observer::ObTenantQueryRespTimeCollector::mtl_destroy); MTL_BIND2(mtl_new_default, table::ObTableClientInfoMgr::mtl_init, mtl_start_default, mtl_stop_default, mtl_wait_default, mtl_destroy_default); MTL_BIND2(mtl_new_default, observer::ObTableQueryASyncMgr::mtl_init, mtl_start_default, mtl_stop_default, mtl_wait_default, mtl_destroy_default); + MTL_BIND2(mtl_new_default, omt::ObTenantAiService::mtl_init, mtl_start_default, mtl_stop_default, mtl_wait_default, mtl_destroy_default); } if (OB_FAIL(ret)) { } else if (OB_FAIL(GMEMCONF.reload_config(config_))) { @@ -948,13 +958,13 @@ void MockTenantModuleEnv::destroy() if (server_fd_ > 0) { close(server_fd_); } - // 没有解决模块退出顺序问题,直接强退 + // No solution to the module exit order problem, force quit //int fail_cnt= ::testing::UnitTest::GetInstance()->failed_test_case_count(); //_Exit(fail_cnt); if (destroyed_) { return; } - // 释放租户上下文 + // Release tenant context guard_.release(); startup_accel_handler_.destroy(); @@ -962,6 +972,9 @@ void MockTenantModuleEnv::destroy() multi_tenant_.stop(); multi_tenant_.wait(); multi_tenant_.destroy(); + weak_read_service_.stop(); + weak_read_service_.wait(); + weak_read_service_.destroy(); ObKVGlobalCache::get_instance().destroy(); SERVER_STORAGE_META_SERVICE.destroy(); diff --git a/mittest/mtlenv/storage/access/test_block_cache.cpp b/mittest/mtlenv/storage/access/test_block_cache.cpp index 0d9fd545f..f5dec35b8 100644 --- a/mittest/mtlenv/storage/access/test_block_cache.cpp +++ b/mittest/mtlenv/storage/access/test_block_cache.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/mtlenv/storage/access/test_cg_group_by_scanner.cpp b/mittest/mtlenv/storage/access/test_cg_group_by_scanner.cpp index d89259377..40b5baeab 100644 --- a/mittest/mtlenv/storage/access/test_cg_group_by_scanner.cpp +++ b/mittest/mtlenv/storage/access/test_cg_group_by_scanner.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/mtlenv/storage/access/test_cg_scanner.cpp b/mittest/mtlenv/storage/access/test_cg_scanner.cpp index f865be0a6..3fd9d4ca9 100644 --- a/mittest/mtlenv/storage/access/test_cg_scanner.cpp +++ b/mittest/mtlenv/storage/access/test_cg_scanner.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/mtlenv/storage/access/test_co_merge.cpp b/mittest/mtlenv/storage/access/test_co_merge.cpp index f13d8f590..180b26259 100644 --- a/mittest/mtlenv/storage/access/test_co_merge.cpp +++ b/mittest/mtlenv/storage/access/test_co_merge.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/access/test_co_prefetcher.cpp b/mittest/mtlenv/storage/access/test_co_prefetcher.cpp index c1c80afc0..392e3060e 100644 --- a/mittest/mtlenv/storage/access/test_co_prefetcher.cpp +++ b/mittest/mtlenv/storage/access/test_co_prefetcher.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE #define private public diff --git a/mittest/mtlenv/storage/access/test_co_sstable_row_scanner.cpp b/mittest/mtlenv/storage/access/test_co_sstable_row_scanner.cpp index ef0f6d7cc..dd7d9200d 100644 --- a/mittest/mtlenv/storage/access/test_co_sstable_row_scanner.cpp +++ b/mittest/mtlenv/storage/access/test_co_sstable_row_scanner.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE #define private public diff --git a/mittest/mtlenv/storage/access/test_co_sstable_row_scanner_delete_insert.cpp b/mittest/mtlenv/storage/access/test_co_sstable_row_scanner_delete_insert.cpp index b80c1d60c..653d52f10 100644 --- a/mittest/mtlenv/storage/access/test_co_sstable_row_scanner_delete_insert.cpp +++ b/mittest/mtlenv/storage/access/test_co_sstable_row_scanner_delete_insert.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE #include diff --git a/mittest/mtlenv/storage/access/test_cs_cg_group_by_scanner.cpp b/mittest/mtlenv/storage/access/test_cs_cg_group_by_scanner.cpp index 00e1b0fde..86ff97add 100644 --- a/mittest/mtlenv/storage/access/test_cs_cg_group_by_scanner.cpp +++ b/mittest/mtlenv/storage/access/test_cs_cg_group_by_scanner.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/mtlenv/storage/access/test_delete_insert_cs_scan.cpp b/mittest/mtlenv/storage/access/test_delete_insert_cs_scan.cpp index c57c87540..15dfcb14c 100644 --- a/mittest/mtlenv/storage/access/test_delete_insert_cs_scan.cpp +++ b/mittest/mtlenv/storage/access/test_delete_insert_cs_scan.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/access/test_delete_insert_minor_merge.cpp b/mittest/mtlenv/storage/access/test_delete_insert_minor_merge.cpp index b0c06f7db..309089a84 100644 --- a/mittest/mtlenv/storage/access/test_delete_insert_minor_merge.cpp +++ b/mittest/mtlenv/storage/access/test_delete_insert_minor_merge.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/access/test_delete_insert_row_scan.cpp b/mittest/mtlenv/storage/access/test_delete_insert_row_scan.cpp index 75f404725..ee118b02c 100644 --- a/mittest/mtlenv/storage/access/test_delete_insert_row_scan.cpp +++ b/mittest/mtlenv/storage/access/test_delete_insert_row_scan.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/access/test_merge_basic.h b/mittest/mtlenv/storage/access/test_merge_basic.h index fa060b40c..8a837558b 100644 --- a/mittest/mtlenv/storage/access/test_merge_basic.h +++ b/mittest/mtlenv/storage/access/test_merge_basic.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_TEST_MERGE_BASIC_H_ #define OB_TEST_MERGE_BASIC_H_ diff --git a/mittest/mtlenv/storage/access/test_multi_version_delete_insert_blockscan.cpp b/mittest/mtlenv/storage/access/test_multi_version_delete_insert_blockscan.cpp index 9b0be05fc..9db85799c 100644 --- a/mittest/mtlenv/storage/access/test_multi_version_delete_insert_blockscan.cpp +++ b/mittest/mtlenv/storage/access/test_multi_version_delete_insert_blockscan.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/access/test_multi_version_merge_recycle.cpp b/mittest/mtlenv/storage/access/test_multi_version_merge_recycle.cpp index 14c52c890..8482e5207 100644 --- a/mittest/mtlenv/storage/access/test_multi_version_merge_recycle.cpp +++ b/mittest/mtlenv/storage/access/test_multi_version_merge_recycle.cpp @@ -1,15 +1,21 @@ // owner: dengzhi.ldz // owner group: storage -// Copyright (c) 2021 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #include diff --git a/mittest/mtlenv/storage/access/test_multi_version_sstable_delete_insert_merge.cpp b/mittest/mtlenv/storage/access/test_multi_version_sstable_delete_insert_merge.cpp index 3a9182782..3a66ddf2e 100644 --- a/mittest/mtlenv/storage/access/test_multi_version_sstable_delete_insert_merge.cpp +++ b/mittest/mtlenv/storage/access/test_multi_version_sstable_delete_insert_merge.cpp @@ -1,16 +1,20 @@ // owner: zhanghuidong.zhd // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/access/test_multi_version_sstable_merge.cpp b/mittest/mtlenv/storage/access/test_multi_version_sstable_merge.cpp index ff18b5e89..7222a8e00 100644 --- a/mittest/mtlenv/storage/access/test_multi_version_sstable_merge.cpp +++ b/mittest/mtlenv/storage/access/test_multi_version_sstable_merge.cpp @@ -1,16 +1,20 @@ // owner: dengzhi.ldz // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/access/test_multi_version_sstable_single_get.cpp b/mittest/mtlenv/storage/access/test_multi_version_sstable_single_get.cpp index 685853f51..e27101caa 100644 --- a/mittest/mtlenv/storage/access/test_multi_version_sstable_single_get.cpp +++ b/mittest/mtlenv/storage/access/test_multi_version_sstable_single_get.cpp @@ -1,16 +1,20 @@ // owner: dengzhi.ldz // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/mtlenv/storage/access/test_pushdown_aggregate.cpp b/mittest/mtlenv/storage/access/test_pushdown_aggregate.cpp index 9f80dfd91..c2da29728 100644 --- a/mittest/mtlenv/storage/access/test_pushdown_aggregate.cpp +++ b/mittest/mtlenv/storage/access/test_pushdown_aggregate.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/access/test_sstable_row_getter.cpp b/mittest/mtlenv/storage/access/test_sstable_row_getter.cpp index fa3cec201..ff5ec3397 100644 --- a/mittest/mtlenv/storage/access/test_sstable_row_getter.cpp +++ b/mittest/mtlenv/storage/access/test_sstable_row_getter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/mtlenv/storage/access/test_sstable_row_multi_getter.cpp b/mittest/mtlenv/storage/access/test_sstable_row_multi_getter.cpp index b792ad039..745f5372a 100644 --- a/mittest/mtlenv/storage/access/test_sstable_row_multi_getter.cpp +++ b/mittest/mtlenv/storage/access/test_sstable_row_multi_getter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/mtlenv/storage/access/test_sstable_row_multi_scanner.cpp b/mittest/mtlenv/storage/access/test_sstable_row_multi_scanner.cpp index cfdb207c5..5f91b6035 100644 --- a/mittest/mtlenv/storage/access/test_sstable_row_multi_scanner.cpp +++ b/mittest/mtlenv/storage/access/test_sstable_row_multi_scanner.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/mtlenv/storage/access/test_sstable_row_scanner.cpp b/mittest/mtlenv/storage/access/test_sstable_row_scanner.cpp index c8d068d2b..43c4a24d9 100644 --- a/mittest/mtlenv/storage/access/test_sstable_row_scanner.cpp +++ b/mittest/mtlenv/storage/access/test_sstable_row_scanner.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/mtlenv/storage/access/test_sstable_row_whole_scanner.cpp b/mittest/mtlenv/storage/access/test_sstable_row_whole_scanner.cpp index 3860bc12e..323e06480 100644 --- a/mittest/mtlenv/storage/access/test_sstable_row_whole_scanner.cpp +++ b/mittest/mtlenv/storage/access/test_sstable_row_whole_scanner.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/mtlenv/storage/blocksstable/CMakeLists.txt b/mittest/mtlenv/storage/blocksstable/CMakeLists.txt index 1ae8a0ba3..2c17686d5 100644 --- a/mittest/mtlenv/storage/blocksstable/CMakeLists.txt +++ b/mittest/mtlenv/storage/blocksstable/CMakeLists.txt @@ -7,6 +7,7 @@ storage_dml_unittest(test_index_block_row_scanner) storage_dml_unittest(test_index_tree) storage_dml_unittest(test_index_dumper) storage_dml_unittest(test_macro_meta_temp_store) +storage_dml_unittest(test_sstable_index_scanner) storage_dml_unittest(test_sstable_sec_meta_iterator) storage_dml_unittest(test_sstable_macro_block_header) storage_dml_unittest(test_shared_macro_block) diff --git a/mittest/mtlenv/storage/blocksstable/ob_index_block_data_prepare.h b/mittest/mtlenv/storage/blocksstable/ob_index_block_data_prepare.h index a610079b8..bdc8d06e0 100644 --- a/mittest/mtlenv/storage/blocksstable/ob_index_block_data_prepare.h +++ b/mittest/mtlenv/storage/blocksstable/ob_index_block_data_prepare.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_INDEX_BLOCK_DATA_PREPARE_H_ diff --git a/mittest/mtlenv/storage/blocksstable/test_bloom_filter_cache.cpp b/mittest/mtlenv/storage/blocksstable/test_bloom_filter_cache.cpp index 78075e861..185348dd2 100644 --- a/mittest/mtlenv/storage/blocksstable/test_bloom_filter_cache.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_bloom_filter_cache.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/blocksstable/test_cg_sstable.cpp b/mittest/mtlenv/storage/blocksstable/test_cg_sstable.cpp index c018b40e0..29068db9c 100644 --- a/mittest/mtlenv/storage/blocksstable/test_cg_sstable.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_cg_sstable.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public #define protected public diff --git a/mittest/mtlenv/storage/blocksstable/test_clustered_index_writer.cpp b/mittest/mtlenv/storage/blocksstable/test_clustered_index_writer.cpp index a9f3e8f62..00cbec05a 100644 --- a/mittest/mtlenv/storage/blocksstable/test_clustered_index_writer.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_clustered_index_writer.cpp @@ -1,16 +1,20 @@ // owner: baichangmin.bcm // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/mtlenv/storage/blocksstable/test_dag_macro_writer.cpp b/mittest/mtlenv/storage/blocksstable/test_dag_macro_writer.cpp index 088e6376f..f7dd37ede 100644 --- a/mittest/mtlenv/storage/blocksstable/test_dag_macro_writer.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_dag_macro_writer.cpp @@ -1,16 +1,20 @@ // owner: zs475329 // owner group: storage -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/mtlenv/storage/blocksstable/test_ddl_merge_row_multi_scanner.cpp b/mittest/mtlenv/storage/blocksstable/test_ddl_merge_row_multi_scanner.cpp index 561414db8..73079fa31 100644 --- a/mittest/mtlenv/storage/blocksstable/test_ddl_merge_row_multi_scanner.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_ddl_merge_row_multi_scanner.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public diff --git a/mittest/mtlenv/storage/blocksstable/test_ddl_merge_row_scanner.cpp b/mittest/mtlenv/storage/blocksstable/test_ddl_merge_row_scanner.cpp index 955c1115d..cc8162f27 100644 --- a/mittest/mtlenv/storage/blocksstable/test_ddl_merge_row_scanner.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_ddl_merge_row_scanner.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/mtlenv/storage/blocksstable/test_direct_load.cpp b/mittest/mtlenv/storage/blocksstable/test_direct_load.cpp index 9b1066652..ee4877f90 100644 --- a/mittest/mtlenv/storage/blocksstable/test_direct_load.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_direct_load.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/blocksstable/test_index_block_row_scanner.cpp b/mittest/mtlenv/storage/blocksstable/test_index_block_row_scanner.cpp index 9e495e5e1..3b808f02a 100755 --- a/mittest/mtlenv/storage/blocksstable/test_index_block_row_scanner.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_index_block_row_scanner.cpp @@ -1,16 +1,20 @@ // owner: saitong.zst // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/blocksstable/test_index_block_row_struct.cpp b/mittest/mtlenv/storage/blocksstable/test_index_block_row_struct.cpp index 02d8039bd..025ed1d6c 100644 --- a/mittest/mtlenv/storage/blocksstable/test_index_block_row_struct.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_index_block_row_struct.cpp @@ -1,16 +1,20 @@ // owner: baichangmin.bcm // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/blocksstable/test_index_block_tree_cursor.cpp b/mittest/mtlenv/storage/blocksstable/test_index_block_tree_cursor.cpp index 67ff338ed..0dd03a57e 100644 --- a/mittest/mtlenv/storage/blocksstable/test_index_block_tree_cursor.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_index_block_tree_cursor.cpp @@ -1,16 +1,20 @@ // owner: saitong.zst // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/mtlenv/storage/blocksstable/test_index_dumper.cpp b/mittest/mtlenv/storage/blocksstable/test_index_dumper.cpp index 4cf6f9f05..ace0dc869 100644 --- a/mittest/mtlenv/storage/blocksstable/test_index_dumper.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_index_dumper.cpp @@ -1,16 +1,20 @@ // owner: baichangmin.bcm // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/mtlenv/storage/blocksstable/test_index_tree.cpp b/mittest/mtlenv/storage/blocksstable/test_index_tree.cpp index b1f047f77..096b55617 100644 --- a/mittest/mtlenv/storage/blocksstable/test_index_tree.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_index_tree.cpp @@ -1,16 +1,20 @@ // owner: baichangmin.bcm // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/mtlenv/storage/blocksstable/test_macro_block_bloom_filter.cpp b/mittest/mtlenv/storage/blocksstable/test_macro_block_bloom_filter.cpp index 43f18d568..bddc77948 100644 --- a/mittest/mtlenv/storage/blocksstable/test_macro_block_bloom_filter.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_macro_block_bloom_filter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE @@ -392,7 +396,7 @@ TEST_F(TestMacroBlockBloomFilter, test_serialize_0) mb_bf.row_count_ = 1; val = mb_bf.get_serialize_size(); ASSERT_NE(val, 0); - // TODO(baichangmin): 补齐 false positive prob 不达标以后的 serialize size + // TODO(baichangmin): complete the serialize size after false positive prob does not meet the standard } TEST_F(TestMacroBlockBloomFilter, test_serialize_1) @@ -569,4 +573,4 @@ int main(int argc, char **argv) STORAGE_LOG(INFO, "begin unittest: test_macro_block_bloom_filter"); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/mtlenv/storage/blocksstable/test_macro_block_row_bare_iterator.cpp b/mittest/mtlenv/storage/blocksstable/test_macro_block_row_bare_iterator.cpp index 51ac93799..937e1620a 100644 --- a/mittest/mtlenv/storage/blocksstable/test_macro_block_row_bare_iterator.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_macro_block_row_bare_iterator.cpp @@ -1,16 +1,20 @@ // owner: zs475329 // owner group: storage -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/mtlenv/storage/blocksstable/test_macro_meta_temp_store.cpp b/mittest/mtlenv/storage/blocksstable/test_macro_meta_temp_store.cpp index 1d1e11666..4d4c1459c 100644 --- a/mittest/mtlenv/storage/blocksstable/test_macro_meta_temp_store.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_macro_meta_temp_store.cpp @@ -1,16 +1,20 @@ // owner: saitong.zst // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/blocksstable/test_merge_cg_scanner.cpp b/mittest/mtlenv/storage/blocksstable/test_merge_cg_scanner.cpp index 770b65571..11ff89408 100644 --- a/mittest/mtlenv/storage/blocksstable/test_merge_cg_scanner.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_merge_cg_scanner.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/blocksstable/test_micro_hash_index.cpp b/mittest/mtlenv/storage/blocksstable/test_micro_hash_index.cpp index c5ecf4deb..e68dcfa2b 100644 --- a/mittest/mtlenv/storage/blocksstable/test_micro_hash_index.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_micro_hash_index.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/blocksstable/test_ob_block_writer_concurrent_guard.cpp b/mittest/mtlenv/storage/blocksstable/test_ob_block_writer_concurrent_guard.cpp index a1e259112..b58bc778a 100644 --- a/mittest/mtlenv/storage/blocksstable/test_ob_block_writer_concurrent_guard.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_ob_block_writer_concurrent_guard.cpp @@ -1,16 +1,20 @@ // owner: zs475329 // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE @@ -587,4 +591,4 @@ int main(int argc, char **argv) srand(time(NULL)); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/mtlenv/storage/blocksstable/test_shared_macro_block.cpp b/mittest/mtlenv/storage/blocksstable/test_shared_macro_block.cpp index 0c747a686..039a20a0b 100644 --- a/mittest/mtlenv/storage/blocksstable/test_shared_macro_block.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_shared_macro_block.cpp @@ -1,16 +1,20 @@ // owner: gaishun.gs // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/blocksstable/test_skip_index_sortedness.cpp b/mittest/mtlenv/storage/blocksstable/test_skip_index_sortedness.cpp index 779da8354..bb713fa0e 100644 --- a/mittest/mtlenv/storage/blocksstable/test_skip_index_sortedness.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_skip_index_sortedness.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/blocksstable/test_sstable_index_scanner.cpp b/mittest/mtlenv/storage/blocksstable/test_sstable_index_scanner.cpp new file mode 100644 index 000000000..af2369c6c --- /dev/null +++ b/mittest/mtlenv/storage/blocksstable/test_sstable_index_scanner.cpp @@ -0,0 +1,304 @@ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ + +#define USING_LOG_PREFIX STORAGE + +#include "mtlenv/storage/blocksstable/ob_index_block_data_prepare.h" +#include "storage/blocksstable/index_block/ob_sstable_index_scanner.h" + +namespace oceanbase +{ +using namespace storage; +using namespace common; +namespace blocksstable +{ + +class TestSSTableIndexScanner : public TestIndexBlockDataPrepare +{ +public: + TestSSTableIndexScanner() + : TestIndexBlockDataPrepare("Test sstable index scanner", ObMergeType::MAJOR_MERGE, true) + {} + virtual ~TestSSTableIndexScanner() {} + + virtual void SetUp(); + // virtual void TearDown(); + + void prepare_scan_param( + const bool scan_root_level, + ObSSTableIndexScanParam &scan_param, + ObFixedArray &skip_index_projector); + void generate_range(const int64_t start_seed, const int64_t end_seed, ObDatumRange &range); + void generate_key(const int64_t seed, ObDatumRowkey &key); + void test_range_scan(const ObDatumRange &range, ObSSTableIndexScanner &index_scanner); +private: + ObArenaAllocator datum_alloc_; + ObDatumRow start_key_buf_; + ObDatumRow end_key_buf_; + ObDatumRow rowkey_buf_; +}; + +void TestSSTableIndexScanner::SetUp() +{ + TestIndexBlockDataPrepare::SetUp(); + ASSERT_EQ(OB_SUCCESS, start_key_buf_.init(datum_alloc_, TEST_COLUMN_CNT)); + ASSERT_EQ(OB_SUCCESS, end_key_buf_.init(datum_alloc_, TEST_COLUMN_CNT)); + ASSERT_EQ(OB_SUCCESS, rowkey_buf_.init(datum_alloc_, TEST_COLUMN_CNT)); +} + +void TestSSTableIndexScanner::generate_range( + const int64_t start_seed, + const int64_t end_seed, + ObDatumRange &range) +{ + ASSERT_EQ(OB_SUCCESS, row_generate_.get_next_row(start_seed, start_key_buf_)); + ASSERT_EQ(OB_SUCCESS, row_generate_.get_next_row(end_seed, end_key_buf_)); + range.start_key_.assign(start_key_buf_.storage_datums_, TEST_ROWKEY_COLUMN_CNT); + range.end_key_.assign(end_key_buf_.storage_datums_, TEST_ROWKEY_COLUMN_CNT); + range.border_flag_.set_inclusive_start(); + range.border_flag_.set_inclusive_end(); +} + +void TestSSTableIndexScanner::generate_key(const int64_t seed, ObDatumRowkey &key) +{ + ASSERT_EQ(OB_SUCCESS, row_generate_.get_next_row(seed, rowkey_buf_)); + key.assign(rowkey_buf_.storage_datums_, TEST_ROWKEY_COLUMN_CNT); +} + +void TestSSTableIndexScanner::prepare_scan_param( + const bool scan_root_level, + ObSSTableIndexScanParam &scan_param, + ObFixedArray &skip_index_projector) +{ + prepare_query_param(false); + scan_param.query_flag_.set_use_block_cache(); + scan_param.index_read_info_ = &read_info_; + skip_index_projector.init(0); + int64_t full_column_count = 0; + ASSERT_EQ(OB_SUCCESS, table_schema_.get_store_column_count(full_column_count, true)); + const int64_t proj_cnt = 2 * full_column_count; + skip_index_projector.set_allocator(&allocator_); + ASSERT_EQ(OB_SUCCESS, skip_index_projector.init(proj_cnt)); + for (int64_t i = 0; i < full_column_count; ++i) { + ObSkipIndexColMeta col_meta; + col_meta.col_idx_ = i; + col_meta.col_type_ = ObSkipIndexColType::SK_IDX_MIN; + ASSERT_EQ(OB_SUCCESS, skip_index_projector.push_back(col_meta)); + col_meta.col_type_ = ObSkipIndexColType::SK_IDX_MAX; + ASSERT_EQ(OB_SUCCESS, skip_index_projector.push_back(col_meta)); + } + scan_param.skip_index_projector_ = &skip_index_projector; + if (scan_root_level) { + scan_param.scan_level_ = ObSSTableIndexScanParam::ScanLevel::ROOT; + } else { + scan_param.scan_level_ = ObSSTableIndexScanParam::ScanLevel::LEAF; + } +} + +void TestSSTableIndexScanner::test_range_scan(const ObDatumRange &range, ObSSTableIndexScanner &index_scanner) +{ + bool is_last_iter_endkey_beyond_range = false; + const ObSSTableIndexRow *index_row = nullptr; + const ObStorageDatumUtils &datum_utils = read_info_.get_datum_utils(); + int tmp_ret = OB_SUCCESS; + while (OB_SUCCESS == tmp_ret) { + tmp_ret = index_scanner.get_next(index_row); + if (OB_SUCCESS == tmp_ret) { + int start_cmp_ret = 0; + int end_cmp_ret = 0; + ASSERT_EQ(OB_SUCCESS, index_row->endkey_->compare(range.start_key_, datum_utils, start_cmp_ret)); + ASSERT_EQ(OB_SUCCESS, index_row->endkey_->compare(range.end_key_, datum_utils, end_cmp_ret)); + ASSERT_TRUE(start_cmp_ret > 0); + if (end_cmp_ret > 0) { + ASSERT_FALSE(is_last_iter_endkey_beyond_range); + is_last_iter_endkey_beyond_range = true; + } + } else { + ASSERT_EQ(OB_ITER_END, tmp_ret); + } + } +} + +TEST_F(TestSSTableIndexScanner, test_basic_scan_functionality) +{ + ObArenaAllocator tmp_arena; + ObDatumRange range; + range.set_whole_range(); + + ObSSTableIndexScanParam scan_param; + ObFixedArray proj; + prepare_scan_param(false, scan_param, proj); + + + ObSSTableIndexScanner index_scanner; + ASSERT_EQ(OB_SUCCESS, index_scanner.init(range, scan_param, sstable_, tmp_arena)); + int tmp_ret = OB_SUCCESS; + int iter_cnt = 0; + while (OB_SUCCESS == tmp_ret) { + const ObSSTableIndexRow *index_row = nullptr; + tmp_ret = index_scanner.get_next(index_row); + if (tmp_ret != OB_SUCCESS) { + ASSERT_EQ(OB_ITER_END, tmp_ret); + } else { + ASSERT_TRUE(nullptr != index_row); + ASSERT_EQ(index_row->skip_index_row_.get_column_count(), scan_param.skip_index_projector_->count()); + iter_cnt++; + LOG_INFO("print index row", KPC(index_row->endkey_), K(index_row->skip_index_row_)); + } + } + ASSERT_TRUE(iter_cnt > 0); + + index_scanner.reset(); + scan_param.scan_level_ = ObSSTableIndexScanParam::ScanLevel::ROOT; + ASSERT_EQ(OB_SUCCESS, index_scanner.init(range, scan_param, sstable_, tmp_arena)); + tmp_ret = OB_SUCCESS; + iter_cnt = 0; + while (OB_SUCCESS == tmp_ret) { + const ObSSTableIndexRow *index_row = nullptr; + tmp_ret = index_scanner.get_next(index_row); + if (tmp_ret != OB_SUCCESS) { + ASSERT_EQ(OB_ITER_END, tmp_ret); + } else { + ASSERT_TRUE(nullptr != index_row); + iter_cnt++; + LOG_INFO("print index row", KPC(index_row->endkey_), K(index_row->skip_index_row_)); + } + } + ASSERT_TRUE(iter_cnt > 0); +} + +TEST_F(TestSSTableIndexScanner, test_range_with_advance) +{ + ObArenaAllocator tmp_arena; + ObDatumRange range; + + ObSSTableIndexScanParam scan_param; + ObFixedArray proj; + prepare_scan_param(false, scan_param, proj); + + ObSSTableIndexScanner index_scanner; + int tmp_ret = OB_SUCCESS; + + // test range scan + generate_range(min_row_seed_, max_row_seed_, range); + ASSERT_EQ(OB_SUCCESS, index_scanner.init(range, scan_param, sstable_, tmp_arena)); + test_range_scan(range, index_scanner); + + index_scanner.reset(); + scan_param.scan_level_ = ObSSTableIndexScanParam::ScanLevel::ROOT; + ASSERT_EQ(OB_SUCCESS, index_scanner.init(range, scan_param, sstable_, tmp_arena)); + test_range_scan(range, index_scanner); + + generate_range(max_row_seed_ / 2, max_row_seed_, range); + index_scanner.reset(); + scan_param.scan_level_ = ObSSTableIndexScanParam::ScanLevel::LEAF; + ASSERT_EQ(OB_SUCCESS, index_scanner.init(range, scan_param, sstable_, tmp_arena)); + test_range_scan(range, index_scanner); + + index_scanner.reset(); + scan_param.scan_level_ = ObSSTableIndexScanParam::ScanLevel::ROOT; + ASSERT_EQ(OB_SUCCESS, index_scanner.init(range, scan_param, sstable_, tmp_arena)); + test_range_scan(range, index_scanner); + + generate_range(min_row_seed_, max_row_seed_ / 2, range); + index_scanner.reset(); + scan_param.scan_level_ = ObSSTableIndexScanParam::ScanLevel::LEAF; + ASSERT_EQ(OB_SUCCESS, index_scanner.init(range, scan_param, sstable_, tmp_arena)); + test_range_scan(range, index_scanner); + + index_scanner.reset(); + scan_param.scan_level_ = ObSSTableIndexScanParam::ScanLevel::ROOT; + ASSERT_EQ(OB_SUCCESS, index_scanner.init(range, scan_param, sstable_, tmp_arena)); + test_range_scan(range, index_scanner); + + generate_range(max_row_seed_ / 3, (max_row_seed_ * 2)/ 3, range); + index_scanner.reset(); + scan_param.scan_level_ = ObSSTableIndexScanParam::ScanLevel::LEAF; + ASSERT_EQ(OB_SUCCESS, index_scanner.init(range, scan_param, sstable_, tmp_arena)); + test_range_scan(range, index_scanner); + + index_scanner.reset(); + scan_param.scan_level_ = ObSSTableIndexScanParam::ScanLevel::ROOT; + ASSERT_EQ(OB_SUCCESS, index_scanner.init(range, scan_param, sstable_, tmp_arena)); + test_range_scan(range, index_scanner); + + // test advance to interface + // normal advance + LOG_INFO("start test advance to interface"); + + ObDatumRowkey advance_key; + const ObSSTableIndexRow *index_row = nullptr; + int cmp_ret = 0; + generate_range(min_row_seed_, max_row_seed_, range); + index_scanner.reset(); + generate_key(max_row_seed_ / 2, advance_key); + scan_param.scan_level_ = ObSSTableIndexScanParam::ScanLevel::LEAF; + ASSERT_EQ(OB_SUCCESS, index_scanner.init(range, scan_param, sstable_, tmp_arena)); + ASSERT_EQ(OB_SUCCESS, index_scanner.get_next(index_row)); + ASSERT_EQ(OB_SUCCESS, index_scanner.advance_to(advance_key, true)); + ASSERT_EQ(OB_SUCCESS, index_scanner.get_next(index_row)); + ASSERT_EQ(OB_SUCCESS, index_row->endkey_->compare(advance_key, read_info_.get_datum_utils(), cmp_ret)); + LOG_INFO("print advance key", K(advance_key), KPC(index_row->endkey_)); + ASSERT_TRUE(cmp_ret >= 0); + + generate_key(max_row_seed_, advance_key); + ASSERT_EQ(OB_SUCCESS, index_scanner.advance_to(advance_key, true)); + ASSERT_EQ(OB_SUCCESS, index_scanner.get_next(index_row)); + cmp_ret = 0; + ASSERT_EQ(OB_SUCCESS, index_row->endkey_->compare(advance_key, read_info_.get_datum_utils(), cmp_ret)); + ASSERT_TRUE(cmp_ret >= 0); + + generate_key(max_row_seed_ + 1, advance_key); + ASSERT_EQ(OB_SUCCESS, index_scanner.advance_to(advance_key, true)); + ASSERT_EQ(OB_ITER_END, index_scanner.get_next(index_row)); + + index_scanner.reset(); + scan_param.scan_level_ = ObSSTableIndexScanParam::ScanLevel::LEAF; + ASSERT_EQ(OB_SUCCESS, index_scanner.init(range, scan_param, sstable_, tmp_arena)); + generate_key(min_row_seed_, advance_key); + ASSERT_EQ(OB_SUCCESS, index_scanner.advance_to(advance_key, true)); + ASSERT_EQ(OB_SUCCESS, index_scanner.get_next(index_row)); + generate_key(max_row_seed_, advance_key); + ASSERT_EQ(OB_SUCCESS, index_scanner.advance_to(advance_key, true)); + ASSERT_EQ(OB_SUCCESS, index_scanner.get_next(index_row)); + ASSERT_EQ(OB_ITER_END, index_scanner.get_next(index_row)); + + index_scanner.reset(); + generate_range(max_row_seed_ / 2, max_row_seed_, range); + scan_param.scan_level_ = ObSSTableIndexScanParam::ScanLevel::LEAF; + ASSERT_EQ(OB_SUCCESS, index_scanner.init(range, scan_param, sstable_, tmp_arena)); + generate_key(min_row_seed_, advance_key); + ASSERT_EQ(OB_SUCCESS, index_scanner.get_next(index_row)); + ObDatumRowkey iter_endkey; + cmp_ret = 0; + ASSERT_EQ(OB_SUCCESS, index_row->endkey_->deep_copy(iter_endkey, tmp_arena)); +#ifndef OB_BUILD_PACKAGE + ASSERT_EQ(OB_INVALID_ARGUMENT, index_scanner.advance_to(advance_key, true)); +#endif +} + + +} // namespace blocksstable +} // namespace oceanbase + +int main(int argc, char **argv) +{ + system("rm -f test_sstable_index_scanner.log*"); + OB_LOGGER.set_file_name("test_sstable_index_scanner.log", true, true); + oceanbase::common::ObLogger::get_logger().set_log_level("INFO"); + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/mittest/mtlenv/storage/blocksstable/test_sstable_macro_block_header.cpp b/mittest/mtlenv/storage/blocksstable/test_sstable_macro_block_header.cpp index ccb74a940..709f6a20e 100644 --- a/mittest/mtlenv/storage/blocksstable/test_sstable_macro_block_header.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_sstable_macro_block_header.cpp @@ -1,16 +1,20 @@ // owner: baichangmin.bcm // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/blocksstable/test_sstable_sec_meta_iterator.cpp b/mittest/mtlenv/storage/blocksstable/test_sstable_sec_meta_iterator.cpp index 50e68c6d3..3fdfeb422 100644 --- a/mittest/mtlenv/storage/blocksstable/test_sstable_sec_meta_iterator.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_sstable_sec_meta_iterator.cpp @@ -1,16 +1,20 @@ // owner: saitong.zst // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/blocksstable/test_truncate_info_kv_cache.cpp b/mittest/mtlenv/storage/blocksstable/test_truncate_info_kv_cache.cpp index 7a569495d..05e6bf720 100644 --- a/mittest/mtlenv/storage/blocksstable/test_truncate_info_kv_cache.cpp +++ b/mittest/mtlenv/storage/blocksstable/test_truncate_info_kv_cache.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -168,4 +172,4 @@ int main(int argc, char **argv) oceanbase::common::ObLogger::get_logger().set_log_level("INFO"); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/mtlenv/storage/checkpoint/test_checkpoint_executor.cpp b/mittest/mtlenv/storage/checkpoint/test_checkpoint_executor.cpp index 4a3c0cfd1..0f8d707cb 100644 --- a/mittest/mtlenv/storage/checkpoint/test_checkpoint_executor.cpp +++ b/mittest/mtlenv/storage/checkpoint/test_checkpoint_executor.cpp @@ -1,16 +1,20 @@ // owner: gengli.wzy // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/checkpoint/test_data_checkpoint.cpp b/mittest/mtlenv/storage/checkpoint/test_data_checkpoint.cpp index bf7fc1358..bcca7c015 100644 --- a/mittest/mtlenv/storage/checkpoint/test_data_checkpoint.cpp +++ b/mittest/mtlenv/storage/checkpoint/test_data_checkpoint.cpp @@ -1,16 +1,20 @@ // owner: gengli.wzy // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define protected public diff --git a/mittest/mtlenv/storage/checkpoint/test_lock_memtable_checkpoint.cpp b/mittest/mtlenv/storage/checkpoint/test_lock_memtable_checkpoint.cpp index cbce7e74d..2b13d81f5 100644 --- a/mittest/mtlenv/storage/checkpoint/test_lock_memtable_checkpoint.cpp +++ b/mittest/mtlenv/storage/checkpoint/test_lock_memtable_checkpoint.cpp @@ -1,16 +1,20 @@ // owner: yichang.yyf // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX TABLELOCK #define protected public diff --git a/mittest/mtlenv/storage/medium_info_common.h b/mittest/mtlenv/storage/medium_info_common.h index 8bac57a52..d62ed4004 100644 --- a/mittest/mtlenv/storage/medium_info_common.h +++ b/mittest/mtlenv/storage/medium_info_common.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_UNITTEST_MEDIUM_INFO_COMMON diff --git a/mittest/mtlenv/storage/medium_info_helper.h b/mittest/mtlenv/storage/medium_info_helper.h index 99cb4258d..766a53aeb 100644 --- a/mittest/mtlenv/storage/medium_info_helper.h +++ b/mittest/mtlenv/storage/medium_info_helper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_UNITTEST_MEDIUM_INFO_HELPER diff --git a/mittest/mtlenv/storage/tablet_memtable/test_direct_load_memtable.cpp b/mittest/mtlenv/storage/tablet_memtable/test_direct_load_memtable.cpp index c7a293879..04b96ca0f 100644 --- a/mittest/mtlenv/storage/tablet_memtable/test_direct_load_memtable.cpp +++ b/mittest/mtlenv/storage/tablet_memtable/test_direct_load_memtable.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/tenant_snapshot/test_ls_snapshot_mgr.cpp b/mittest/mtlenv/storage/tenant_snapshot/test_ls_snapshot_mgr.cpp index fcde5f447..0cea48236 100644 --- a/mittest/mtlenv/storage/tenant_snapshot/test_ls_snapshot_mgr.cpp +++ b/mittest/mtlenv/storage/tenant_snapshot/test_ls_snapshot_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/mtlenv/storage/tenant_snapshot/test_tenant_snapshot_def.cpp b/mittest/mtlenv/storage/tenant_snapshot/test_tenant_snapshot_def.cpp index fc47fa196..66c662875 100644 --- a/mittest/mtlenv/storage/tenant_snapshot/test_tenant_snapshot_def.cpp +++ b/mittest/mtlenv/storage/tenant_snapshot/test_tenant_snapshot_def.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/mtlenv/storage/tenant_snapshot/test_tenant_snapshot_mgr.cpp b/mittest/mtlenv/storage/tenant_snapshot/test_tenant_snapshot_mgr.cpp index b4f18ded7..bf069d7d0 100644 --- a/mittest/mtlenv/storage/tenant_snapshot/test_tenant_snapshot_mgr.cpp +++ b/mittest/mtlenv/storage/tenant_snapshot/test_tenant_snapshot_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/mtlenv/storage/test_auto_partition_estimate.cpp b/mittest/mtlenv/storage/test_auto_partition_estimate.cpp index 8894104e7..930da60c4 100644 --- a/mittest/mtlenv/storage/test_auto_partition_estimate.cpp +++ b/mittest/mtlenv/storage/test_auto_partition_estimate.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/test_auto_partition_get_read_tables.cpp b/mittest/mtlenv/storage/test_auto_partition_get_read_tables.cpp index 95588c581..7b265a276 100644 --- a/mittest/mtlenv/storage/test_auto_partition_get_read_tables.cpp +++ b/mittest/mtlenv/storage/test_auto_partition_get_read_tables.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/test_auto_partition_scan_table.cpp b/mittest/mtlenv/storage/test_auto_partition_scan_table.cpp index 54aabc7ae..05ab3bac5 100644 --- a/mittest/mtlenv/storage/test_auto_partition_scan_table.cpp +++ b/mittest/mtlenv/storage/test_auto_partition_scan_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -21,14 +25,14 @@ /* - 0. 用主表模拟局部索引表扫描,两者差别在于主表会进行范围切割,局部索引表会进行 行过滤 - 1. 创建分区 - 2. 设置分区为split状态,把自己设置为局部索引,并且把origin tablet id设置为自己 - 3. 启动table_scan - 4. 预期逻辑 - 1)同时获取origin table的tables ; - 2)不会cut range; - 3)根据当前tablet id 过滤数据,当然当前代码里分裂后的schema没有变更,计算分区方式也没有改变,因此数据全部符合 + 0. Use the main table to simulate a local index table scan, the difference being that the main table performs range cutting, while the local index table performs row filtering + 1. Create partition + 2. Set partition to split state, set yourself as a local index, and set the origin tablet id to yourself + 3. Start table_scan + 4. Expected logic + 1) Simultaneously obtain tables from the origin table ; + 2) Will not cut range; + 3) Filter data based on the current tablet id, of course, the schema has not changed after splitting in the current code, and the partition calculation method has not changed, so all data fits */ namespace oceanbase diff --git a/mittest/mtlenv/storage/test_auto_partition_split_range.cpp b/mittest/mtlenv/storage/test_auto_partition_split_range.cpp index 11dbb00a4..df419bcd4 100644 --- a/mittest/mtlenv/storage/test_auto_partition_split_range.cpp +++ b/mittest/mtlenv/storage/test_auto_partition_split_range.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public @@ -438,7 +442,7 @@ TEST_F(FakeObTableScanRange, test_empty_split_range) ASSERT_EQ(OB_SUCCESS, ret); ret = do_split_datum_range(split_start_val, split_end_val); // error - ASSERT_EQ(OB_INVALID_ARGUMENT, ret); // empty key is invalid, return -4016 + ASSERT_EQ(OB_INVALID_ARGUMENT, ret); // empty key is invalid, return -4016 } // only set split start key diff --git a/mittest/mtlenv/storage/test_ddl_create_tablet.cpp b/mittest/mtlenv/storage/test_ddl_create_tablet.cpp index 6aea16799..efa9cd8eb 100644 --- a/mittest/mtlenv/storage/test_ddl_create_tablet.cpp +++ b/mittest/mtlenv/storage/test_ddl_create_tablet.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/mtlenv/storage/test_empty_shell_handler.cpp b/mittest/mtlenv/storage/test_empty_shell_handler.cpp index 6b5de68f2..50226b5f2 100644 --- a/mittest/mtlenv/storage/test_empty_shell_handler.cpp +++ b/mittest/mtlenv/storage/test_empty_shell_handler.cpp @@ -1,16 +1,20 @@ // owner: gaishun.gs // owner group: storage -/** - * Copyright (c) 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/test_index_sstable_estimator.cpp b/mittest/mtlenv/storage/test_index_sstable_estimator.cpp index 981b94d8a..8f8157254 100644 --- a/mittest/mtlenv/storage/test_index_sstable_estimator.cpp +++ b/mittest/mtlenv/storage/test_index_sstable_estimator.cpp @@ -1,16 +1,20 @@ // owner: yht146439 // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define protected public diff --git a/mittest/mtlenv/storage/test_index_sstable_multi_estimator.cpp b/mittest/mtlenv/storage/test_index_sstable_multi_estimator.cpp index 5507ecace..7f9bf211e 100644 --- a/mittest/mtlenv/storage/test_index_sstable_multi_estimator.cpp +++ b/mittest/mtlenv/storage/test_index_sstable_multi_estimator.cpp @@ -1,16 +1,20 @@ // owner: peihan.dph // owner group: sql3 -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define protected public diff --git a/mittest/mtlenv/storage/test_lob_manager.cpp b/mittest/mtlenv/storage/test_lob_manager.cpp index 04a5f7663..b61a70715 100644 --- a/mittest/mtlenv/storage/test_lob_manager.cpp +++ b/mittest/mtlenv/storage/test_lob_manager.cpp @@ -1,16 +1,20 @@ // owner: luohongdi.lhd // owner group: storage2 -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE @@ -947,12 +951,12 @@ TEST_F(TestLobManager, basic) // do ... // // ObObj str1; - // str1.set_varchar("发生什么事了"); + // str1.set_varchar("What happened"); // str1.set_collation_type(CS_TYPE_UTF8MB4_GENERAL_CI); // ObString data; // str1.get_string(data); // // test for charset lob - // // check "生什么事" + // // check "what happened" // size_t st = ObCharset::charpos(CS_TYPE_UTF8MB4_GENERAL_CI, data.ptr(), data.length(), 1); // size_t len = ObCharset::charpos(CS_TYPE_UTF8MB4_GENERAL_CI, data.ptr() + st, data.length() - st, 4); // char buf[100]; @@ -1260,7 +1264,7 @@ TEST_F(TestLobManager, inrow_bin_test) param.offset_ = 0; param.len_ = 900; ASSERT_EQ(OB_SUCCESS, mgr->query(param, query_str)); - // 对应关系 + // Corresponding relationship // query [0,50] [50,100] [100,250] // tmpbuf [0,50] [400,450] [250,400] ASSERT_EQ(250, query_str.length()); @@ -1277,7 +1281,7 @@ TEST_F(TestLobManager, inrow_bin_test) param.offset_ = 0; param.len_ = 900; ASSERT_EQ(OB_SUCCESS, mgr->query(param, query_str)); - // 对应关系 + // Corresponding relationship // query [0,50] [50,100] [100,200] [200,300] // tmpbuf [0,50] [400,450] [250,350] [800,900] ASSERT_EQ(300, query_str.length()); @@ -1295,7 +1299,7 @@ TEST_F(TestLobManager, inrow_bin_test) param.offset_ = 0; param.len_ = 2000; ASSERT_EQ(OB_SUCCESS, mgr->query(param, query_str)); - // 对应关系 + // correspondence relationship // query [0,50] [50,100] [100,200] [200,300] [300,1000] [1000,1100] // tmpbuf [0,50] [400,450] [250,350] [800,900] [0x00] [600,700] ASSERT_EQ(1100, query_str.length()); @@ -1456,7 +1460,7 @@ TEST_F(TestLobManager, inrow_tmp_full_locator) param.offset_ = 0; param.len_ = 900; ASSERT_EQ(OB_SUCCESS, mgr->query(param, query_str)); - // 对应关系 + // correspondence relationship // query [0,50] [50,100] [100,250] // tmpbuf [0,50] [400,450] [250,400] ASSERT_EQ(250, query_str.length()); @@ -1473,7 +1477,7 @@ TEST_F(TestLobManager, inrow_tmp_full_locator) param.offset_ = 0; param.len_ = 900; ASSERT_EQ(OB_SUCCESS, mgr->query(param, query_str)); - // 对应关系 + // correspondence relationship // query [0,50] [50,100] [100,200] [200,300] // tmpbuf [0,50] [400,450] [250,350] [800,900] ASSERT_EQ(300, query_str.length()); @@ -1491,7 +1495,7 @@ TEST_F(TestLobManager, inrow_tmp_full_locator) param.offset_ = 0; param.len_ = 2000; ASSERT_EQ(OB_SUCCESS, mgr->query(param, query_str)); - // 对应关系 + // Corresponding relationship // query [0,50] [50,100] [100,200] [200,300] [300,1000] [1000,1100] // tmpbuf [0,50] [400,450] [250,350] [800,900] [0x00] [600,700] ASSERT_EQ(1100, query_str.length()); @@ -1603,7 +1607,7 @@ TEST_F(TestLobManager, inrow_tmp_delta_locator) param.offset_ = 0; param.len_ = 900; ASSERT_EQ(OB_SUCCESS, mgr->query(param, query_str)); - // 对应关系 + // Corresponding relationship // query [0,50] [50,100] [100,250] // tmpbuf [0,50] [400,450] [250,400] ASSERT_EQ(250, query_str.length()); @@ -1629,7 +1633,7 @@ TEST_F(TestLobManager, inrow_tmp_delta_locator) param.offset_ = 0; param.len_ = 900; ASSERT_EQ(OB_SUCCESS, mgr->query(param, query_str)); - // 对应关系 + // correspondence relationship // query [0,50] [50,100] [100,200] [200,300] // tmpbuf [0,50] [400,450] [250,350] [800,900] ASSERT_EQ(300, query_str.length()); @@ -1658,7 +1662,7 @@ TEST_F(TestLobManager, inrow_tmp_delta_locator) param.offset_ = 0; param.len_ = 2000; ASSERT_EQ(OB_SUCCESS, mgr->query(param, query_str)); - // 对应关系 + // correspondence relationship // query [0,50] [50,100] [100,200] [200,300] [300,1000] [1000,1100] // tmpbuf [0,50] [400,450] [250,350] [800,900] [0x00] [600,700] ASSERT_EQ(1100, query_str.length()); diff --git a/mittest/mtlenv/storage/test_lob_meta_iterator.cpp b/mittest/mtlenv/storage/test_lob_meta_iterator.cpp index ec2e3e30b..3d5645c3c 100644 --- a/mittest/mtlenv/storage/test_lob_meta_iterator.cpp +++ b/mittest/mtlenv/storage/test_lob_meta_iterator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/mittest/mtlenv/storage/test_ls_migration_param.cpp b/mittest/mtlenv/storage/test_ls_migration_param.cpp index 481e2429f..442012dfd 100644 --- a/mittest/mtlenv/storage/test_ls_migration_param.cpp +++ b/mittest/mtlenv/storage/test_ls_migration_param.cpp @@ -1,16 +1,20 @@ // owner: jiahua.cjh // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/mtlenv/storage/test_ls_restore_task_mgr.cpp b/mittest/mtlenv/storage/test_ls_restore_task_mgr.cpp index 78f9edc1b..a9c49fa61 100644 --- a/mittest/mtlenv/storage/test_ls_restore_task_mgr.cpp +++ b/mittest/mtlenv/storage/test_ls_restore_task_mgr.cpp @@ -1,16 +1,20 @@ // owner: wangxiaohui.wxh // owner group: physical_backup -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RS diff --git a/mittest/mtlenv/storage/test_ls_service.cpp b/mittest/mtlenv/storage/test_ls_service.cpp index 6e84e875b..9e790de13 100644 --- a/mittest/mtlenv/storage/test_ls_service.cpp +++ b/mittest/mtlenv/storage/test_ls_service.cpp @@ -1,16 +1,20 @@ // owner: cxf262476 // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/mtlenv/storage/test_ls_tablet_info_writer_and_reader.cpp b/mittest/mtlenv/storage/test_ls_tablet_info_writer_and_reader.cpp index c4c809e74..d174505c0 100644 --- a/mittest/mtlenv/storage/test_ls_tablet_info_writer_and_reader.cpp +++ b/mittest/mtlenv/storage/test_ls_tablet_info_writer_and_reader.cpp @@ -1,16 +1,20 @@ // owner: wangxiaohui.wxh // owner group: physical_backup -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/mtlenv/storage/test_ls_tablet_service.cpp b/mittest/mtlenv/storage/test_ls_tablet_service.cpp index 819ed017f..5e034f620 100644 --- a/mittest/mtlenv/storage/test_ls_tablet_service.cpp +++ b/mittest/mtlenv/storage/test_ls_tablet_service.cpp @@ -1,16 +1,20 @@ // owner: yunshan.tys // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/test_mds_compat.cpp b/mittest/mtlenv/storage/test_mds_compat.cpp index 17d43d185..5ca9a7654 100644 --- a/mittest/mtlenv/storage/test_mds_compat.cpp +++ b/mittest/mtlenv/storage/test_mds_compat.cpp @@ -1,16 +1,20 @@ // owner: gaishun.gs // owner group: storage -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/test_mds_data_read_write.cpp b/mittest/mtlenv/storage/test_mds_data_read_write.cpp index 9faf2f755..a1081ab0f 100644 --- a/mittest/mtlenv/storage/test_mds_data_read_write.cpp +++ b/mittest/mtlenv/storage/test_mds_data_read_write.cpp @@ -1,16 +1,20 @@ // owner: gaishun.gs // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -489,4 +493,4 @@ int main(int argc, char **argv) OB_LOGGER.set_file_name("test_mds_data_read_write.log", true); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/mtlenv/storage/test_mds_table_scan.cpp b/mittest/mtlenv/storage/test_mds_table_scan.cpp index e8c18229c..b3ee85e78 100644 --- a/mittest/mtlenv/storage/test_mds_table_scan.cpp +++ b/mittest/mtlenv/storage/test_mds_table_scan.cpp @@ -1,16 +1,20 @@ // owner: gaishun.gs // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -1381,4 +1385,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/mtlenv/storage/test_medium_info_iterator.cpp b/mittest/mtlenv/storage/test_medium_info_iterator.cpp index bde58bb77..5417cfd04 100644 --- a/mittest/mtlenv/storage/test_medium_info_iterator.cpp +++ b/mittest/mtlenv/storage/test_medium_info_iterator.cpp @@ -1,16 +1,20 @@ // owner: jiahua.cjh // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -503,4 +507,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/mtlenv/storage/test_medium_info_reader.cpp b/mittest/mtlenv/storage/test_medium_info_reader.cpp index feaf4c517..74338d591 100644 --- a/mittest/mtlenv/storage/test_medium_info_reader.cpp +++ b/mittest/mtlenv/storage/test_medium_info_reader.cpp @@ -1,16 +1,20 @@ // owner: jiahua.cjh // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/test_memtable_v2.cpp b/mittest/mtlenv/storage/test_memtable_v2.cpp index b631fc236..94c15e9dd 100644 --- a/mittest/mtlenv/storage/test_memtable_v2.cpp +++ b/mittest/mtlenv/storage/test_memtable_v2.cpp @@ -1,16 +1,20 @@ // owner: handora.qc // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -3713,8 +3717,6 @@ int main(int argc, char **argv) { system("rm -rf test_memtable.log*"); OB_LOGGER.set_file_name("test_memtable.log", true, false, - "test_memtable.log", - "test_memtable.log", "test_memtable.log"); OB_LOGGER.set_log_level("INFO"); STORAGE_LOG(INFO, "begin unittest: test simple memtable"); diff --git a/mittest/mtlenv/storage/test_meta_snapshot.cpp b/mittest/mtlenv/storage/test_meta_snapshot.cpp index f864bcc87..51761a9cc 100644 --- a/mittest/mtlenv/storage/test_meta_snapshot.cpp +++ b/mittest/mtlenv/storage/test_meta_snapshot.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/mittest/mtlenv/storage/test_migration_tablet_param.cpp b/mittest/mtlenv/storage/test_migration_tablet_param.cpp index 9f76045f1..97ee38408 100644 --- a/mittest/mtlenv/storage/test_migration_tablet_param.cpp +++ b/mittest/mtlenv/storage/test_migration_tablet_param.cpp @@ -1,16 +1,20 @@ // owner: jiahua.cjh // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/test_physical_copy_task.cpp b/mittest/mtlenv/storage/test_physical_copy_task.cpp index ac5b9d29f..ed8c3eb10 100644 --- a/mittest/mtlenv/storage/test_physical_copy_task.cpp +++ b/mittest/mtlenv/storage/test_physical_copy_task.cpp @@ -1,16 +1,20 @@ // owner: muwei.ym // owner group: storage_ha -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/mittest/mtlenv/storage/test_shared_block_reader_writer.cpp b/mittest/mtlenv/storage/test_shared_block_reader_writer.cpp index c0ad2ede9..07678e21c 100644 --- a/mittest/mtlenv/storage/test_shared_block_reader_writer.cpp +++ b/mittest/mtlenv/storage/test_shared_block_reader_writer.cpp @@ -1,16 +1,20 @@ // owner: gaishun.gs // owner group: storage -/** - * Copyright (c) 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define protected public diff --git a/mittest/mtlenv/storage/test_speed_limit.cpp b/mittest/mtlenv/storage/test_speed_limit.cpp index 689c775a8..41e4c923a 100644 --- a/mittest/mtlenv/storage/test_speed_limit.cpp +++ b/mittest/mtlenv/storage/test_speed_limit.cpp @@ -1,16 +1,20 @@ // owner: gengli.wzy // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -301,4 +305,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/mtlenv/storage/test_table_scan_pure_data_table.cpp b/mittest/mtlenv/storage/test_table_scan_pure_data_table.cpp index 071fd4206..09263ae58 100644 --- a/mittest/mtlenv/storage/test_table_scan_pure_data_table.cpp +++ b/mittest/mtlenv/storage/test_table_scan_pure_data_table.cpp @@ -1,16 +1,20 @@ // owner: gaishun.gs // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE @@ -68,8 +72,6 @@ void TestTableScanPureDataTable::SetUpTestCase() { uint64_t version = cal_version(4, 3, 0, 0); ASSERT_EQ(OB_SUCCESS, ObClusterVersion::get_instance().init(version)); - ASSERT_EQ(OB_SUCCESS, omt::ObTenantConfigMgr::get_instance().add_tenant_config(MTL_ID())); - ObClusterVersion::get_instance().tenant_config_mgr_ = &omt::ObTenantConfigMgr::get_instance(); ASSERT_EQ(OB_SUCCESS, MockTenantModuleEnv::get_instance().init()); // MTL(transaction::ObTransService*)->tx_desc_mgr_.tx_id_allocator_ = diff --git a/mittest/mtlenv/storage/test_tablet_aggregated_info.cpp b/mittest/mtlenv/storage/test_tablet_aggregated_info.cpp index faf9dadfa..594f720e1 100644 --- a/mittest/mtlenv/storage/test_tablet_aggregated_info.cpp +++ b/mittest/mtlenv/storage/test_tablet_aggregated_info.cpp @@ -1,16 +1,20 @@ // owner: gaishun.gs // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ @@ -97,4 +101,4 @@ int main(int argc, char **argv) oceanbase::common::ObClusterVersion::get_instance().init(CLUSTER_VERSION_1_0_0_0); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/mtlenv/storage/test_tablet_block_id_list.cpp b/mittest/mtlenv/storage/test_tablet_block_id_list.cpp index 9a0be9575..2ae82bf0f 100644 --- a/mittest/mtlenv/storage/test_tablet_block_id_list.cpp +++ b/mittest/mtlenv/storage/test_tablet_block_id_list.cpp @@ -1,16 +1,20 @@ // owner: gaishun.gs // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE @@ -496,4 +500,4 @@ int main(int argc, char **argv) oceanbase::common::ObClusterVersion::get_instance().init(CLUSTER_VERSION_1_0_0_0); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/mtlenv/storage/test_tablet_create_delete_helper.cpp b/mittest/mtlenv/storage/test_tablet_create_delete_helper.cpp index 608d5bdc6..51426473a 100644 --- a/mittest/mtlenv/storage/test_tablet_create_delete_helper.cpp +++ b/mittest/mtlenv/storage/test_tablet_create_delete_helper.cpp @@ -1,16 +1,20 @@ // owner: gaishun.gs // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/test_tablet_mds_data.cpp b/mittest/mtlenv/storage/test_tablet_mds_data.cpp index 960930492..96e2adb6f 100644 --- a/mittest/mtlenv/storage/test_tablet_mds_data.cpp +++ b/mittest/mtlenv/storage/test_tablet_mds_data.cpp @@ -1,16 +1,20 @@ // owner: gaishun.gs // owner group: storage -/** - * Copyright (c) 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -150,4 +154,4 @@ int main(int argc, char **argv) OB_LOGGER.set_file_name("test_tablet_mds_data.log", true); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/mtlenv/storage/test_tablet_member_load_and_free.cpp b/mittest/mtlenv/storage/test_tablet_member_load_and_free.cpp index 9674e6262..d5ee06e0a 100644 --- a/mittest/mtlenv/storage/test_tablet_member_load_and_free.cpp +++ b/mittest/mtlenv/storage/test_tablet_member_load_and_free.cpp @@ -1,16 +1,20 @@ // owner: gaishun.gs // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/mittest/mtlenv/storage/test_tablet_status_cache.cpp b/mittest/mtlenv/storage/test_tablet_status_cache.cpp index 8e52f4dd1..2bfdf65dd 100644 --- a/mittest/mtlenv/storage/test_tablet_status_cache.cpp +++ b/mittest/mtlenv/storage/test_tablet_status_cache.cpp @@ -1,16 +1,20 @@ // owner: gaishun.gs // owner group: storage -/** - * Copyright (c) 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/test_tenant_meta_mem_mgr.cpp b/mittest/mtlenv/storage/test_tenant_meta_mem_mgr.cpp index d36e51705..5c01c6487 100644 --- a/mittest/mtlenv/storage/test_tenant_meta_mem_mgr.cpp +++ b/mittest/mtlenv/storage/test_tenant_meta_mem_mgr.cpp @@ -1,16 +1,20 @@ // owner: yunshan.tys // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/test_tenant_module_env.cpp b/mittest/mtlenv/storage/test_tenant_module_env.cpp index 9dc7948b5..97b85c30b 100644 --- a/mittest/mtlenv/storage/test_tenant_module_env.cpp +++ b/mittest/mtlenv/storage/test_tenant_module_env.cpp @@ -1,16 +1,20 @@ // owner: lana.lgx // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "../mock_tenant_module_env.h" diff --git a/mittest/mtlenv/storage/test_trans.cpp b/mittest/mtlenv/storage/test_trans.cpp index 7b87fd71e..6a28958de 100644 --- a/mittest/mtlenv/storage/test_trans.cpp +++ b/mittest/mtlenv/storage/test_trans.cpp @@ -1,16 +1,20 @@ // owner: handora.qc // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE @@ -96,10 +100,8 @@ class TestTrans : public ::testing::Test static void SetUpTestCase() { LOG_INFO("SetUpTestCase"); - ASSERT_EQ(OB_SUCCESS, omt::ObTenantConfigMgr::get_instance().add_tenant_config(MTL_ID())); uint64_t version = cal_version(4, 3, 0, 0); ASSERT_EQ(OB_SUCCESS, ObClusterVersion::get_instance().init(version)); - ObClusterVersion::get_instance().tenant_config_mgr_ = &omt::ObTenantConfigMgr::get_instance(); ASSERT_EQ(OB_SUCCESS, MockTenantModuleEnv::get_instance().init()); SERVER_STORAGE_META_SERVICE.is_started_ = true; @@ -547,7 +549,7 @@ TEST_F(TestTrans, remove_ls) int main(int argc, char **argv) { system("rm -rf test_trans.log*"); - OB_LOGGER.set_file_name("test_trans.log",true, false, "test_trans.log", "test_trans.log"); + OB_LOGGER.set_file_name("test_trans.log",true, false); OB_LOGGER.set_log_level("DEBUG"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); diff --git a/mittest/mtlenv/storage/test_transfer_barrier.cpp b/mittest/mtlenv/storage/test_transfer_barrier.cpp index a5d4eda06..f969e93b9 100644 --- a/mittest/mtlenv/storage/test_transfer_barrier.cpp +++ b/mittest/mtlenv/storage/test_transfer_barrier.cpp @@ -1,16 +1,20 @@ // owner: muwei.ym // owner group: storage_ha -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/mtlenv/storage/test_truncate_info_reader.cpp b/mittest/mtlenv/storage/test_truncate_info_reader.cpp index c5d817fce..7d38e6b43 100644 --- a/mittest/mtlenv/storage/test_truncate_info_reader.cpp +++ b/mittest/mtlenv/storage/test_truncate_info_reader.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include #define private public diff --git a/mittest/mtlenv/storage/test_write_tablet_slog.cpp b/mittest/mtlenv/storage/test_write_tablet_slog.cpp index 327c7f898..9710e5527 100644 --- a/mittest/mtlenv/storage/test_write_tablet_slog.cpp +++ b/mittest/mtlenv/storage/test_write_tablet_slog.cpp @@ -1,16 +1,20 @@ // owner: gaishun.gs // owner group: storage -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "mtlenv/mock_tenant_module_env.h" diff --git a/mittest/mtlenv/storage/tmp_file/mock_ob_tmp_file.h b/mittest/mtlenv/storage/tmp_file/mock_ob_tmp_file.h index 14b6d8650..a6d49cf49 100644 --- a/mittest/mtlenv/storage/tmp_file/mock_ob_tmp_file.h +++ b/mittest/mtlenv/storage/tmp_file/mock_ob_tmp_file.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_TMP_FILE_FLUSH_MGR_TEST_HELPER_ @@ -88,7 +92,7 @@ class MockSharedNothingTmpFile : public ObSharedNothingTmpFile { public: // TODO: generate_data_xxx - // TODO: 在MockIO里存一份错误码 + // TODO: Store a copy of the error code in MockIO int generate_meta_flush_info( ObTmpFileFlushTask &flush_task, ObTmpFileFlushInfo &info, @@ -402,4 +406,4 @@ int MockSNTenantTmpFileManager::open(int64_t &fd, const int64_t &dir_id, const c } } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/mittest/mtlenv/storage/tmp_file/mock_ob_tmp_file_util.h b/mittest/mtlenv/storage/tmp_file/mock_ob_tmp_file_util.h index fc1df2178..4a1bc7184 100644 --- a/mittest/mtlenv/storage/tmp_file/mock_ob_tmp_file_util.h +++ b/mittest/mtlenv/storage/tmp_file/mock_ob_tmp_file_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef MOCK_OB_TMP_FILE_UTIL_H_ @@ -210,4 +214,4 @@ void MockTmpFileUtil::check_wbp_free_list(ObTmpWriteBufferPool &wbp) #define MockIO (MockTmpFileUtil::get_instance()) } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/mittest/mtlenv/storage/tmp_file/ob_tmp_file_test_helper.h b/mittest/mtlenv/storage/tmp_file/ob_tmp_file_test_helper.h index c1951553d..3bad31e94 100644 --- a/mittest/mtlenv/storage/tmp_file/ob_tmp_file_test_helper.h +++ b/mittest/mtlenv/storage/tmp_file/ob_tmp_file_test_helper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_TMP_FILE_TEST_HELPER_ diff --git a/mittest/mtlenv/storage/tmp_file/test_tmp_file.cpp b/mittest/mtlenv/storage/tmp_file/test_tmp_file.cpp index a89438150..617fd4e8d 100644 --- a/mittest/mtlenv/storage/tmp_file/test_tmp_file.cpp +++ b/mittest/mtlenv/storage/tmp_file/test_tmp_file.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "mittest/mtlenv/storage/tmp_file/ob_tmp_file_test_helper.h" diff --git a/mittest/mtlenv/storage/tmp_file/test_tmp_file_block_manager.cpp b/mittest/mtlenv/storage/tmp_file/test_tmp_file_block_manager.cpp index 6c549c87a..262cd34d7 100644 --- a/mittest/mtlenv/storage/tmp_file/test_tmp_file_block_manager.cpp +++ b/mittest/mtlenv/storage/tmp_file/test_tmp_file_block_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -589,4 +593,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/mtlenv/storage/tmp_file/test_tmp_file_buffer_pool.cpp b/mittest/mtlenv/storage/tmp_file/test_tmp_file_buffer_pool.cpp index fb5a0e712..48167e569 100644 --- a/mittest/mtlenv/storage/tmp_file/test_tmp_file_buffer_pool.cpp +++ b/mittest/mtlenv/storage/tmp_file/test_tmp_file_buffer_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "mittest/mtlenv/storage/tmp_file/ob_tmp_file_test_helper.h" #include "mittest/mtlenv/storage/tmp_file/mock_ob_tmp_file.h" @@ -584,26 +588,21 @@ TEST_F(TestBufferPool, test_alloc_page_limit) int64_t fd = 0; const int64_t ALLOC_PAGE_NUM = wbp.get_max_page_num() / 2; WBPTestHelper wbp_test(fd, wbp); - - // 分配 50% 的 data page + // Allocate 50% of the data page ret = wbp_test.alloc_data_pages(ALLOC_PAGE_NUM); ASSERT_EQ(OB_SUCCESS, ret); - - // 再分配 50% 的 data page,超过 MAX_DATA_PAGE_USAGE_RATIO(default 0.9) 后 - // 会触发 OB_ALLOCATE_TMP_FILE_PAGE_FAILED,分配页面失败 + // Reallocate 50% of the data page, after exceeding MAX_DATA_PAGE_USAGE_RATIO (default 0.9) + // Will trigger OB_ALLOCATE_TMP_FILE_PAGE_FAILED, allocation page failed ret = wbp_test.alloc_data_pages(ALLOC_PAGE_NUM); ASSERT_EQ(ret, OB_ALLOCATE_TMP_FILE_PAGE_FAILED); - - // 此时仍可分配少量 meta page + // At this point, a small number of meta pages can still be allocated const int ALLOC_META_NUM = 20; ret = wbp_test.alloc_meta_pages(ALLOC_META_NUM); ASSERT_EQ(OB_SUCCESS, ret); - - // 分配 meta page 到buffer pool上限 + // Allocate meta page to buffer pool upper limit ret = wbp_test.alloc_meta_pages(wbp.get_max_page_num()); ASSERT_EQ(OB_ALLOCATE_TMP_FILE_PAGE_FAILED, ret); - - // data page释放后,可以继续分配meta page + // data page released, can continue to allocate meta page ret = wbp_test.free_all_pages(); ASSERT_EQ(OB_SUCCESS, ret); @@ -865,8 +864,7 @@ TEST_F(TestBufferPool, test_buffer_pool_auto_shrinking) } EXPECT_EQ(wbp.fat_.size(), ObTmpWriteBufferPool::BLOCK_PAGE_NUMS * 1); LOG_INFO("auto shrinking case 2", K(wbp.capacity_), K(wbp.used_page_num_), K(wbp.fat_.size())); - - // 3. 4MB的wbp自动缩容 + // 3. 4MB of wbp auto shrink ret = wbp_test.alloc_data_pages(ObTmpWriteBufferPool::BLOCK_PAGE_NUMS * 2); ASSERT_EQ(OB_SUCCESS, ret); ASSERT_EQ(ObTmpWriteBufferPool::BLOCK_PAGE_NUMS * 2, wbp.used_page_num_); @@ -1011,8 +1009,7 @@ TEST_F(TestBufferPool, test_buffer_pool_shrink_range_boundary) ASSERT_EQ(false, wbp.shrink_ctx_.is_valid()); MockIO.check_wbp_free_list(wbp); } - -// 检查缩容期间,free page水位线变化时,预留free meta page数量是否符合预期 +// Check the number of reserved free meta pages is as expected when the free page watermark changes during shrinkage TEST_F(TestBufferPool, test_buffer_pool_free_page_when_shrinking) { int ret = OB_SUCCESS; @@ -1059,7 +1056,7 @@ TEST_F(TestBufferPool, test_buffer_pool_free_page_when_shrinking) ret = wbp_test.free_all_pages(); ASSERT_EQ(OB_SUCCESS, ret); - // 验证先分配data到上限后,仍能分配10%的meta page + // Verify that after allocating data up to the limit, 10% of meta pages can still be allocated ret = wbp_test.alloc_data_pages(WBP_MAX_PAGE_NUM, notify_dirty); // data: -> 85% EXPECT_EQ(OB_ALLOCATE_TMP_FILE_PAGE_FAILED, ret); ret = wbp_test.alloc_meta_pages(ALLOC_META_PAGE_NUM, notify_dirty); // meta: -> 10% @@ -1114,7 +1111,7 @@ TEST_F(TestBufferPool, test_buffer_pool_free_page_when_shrinking) ret = wbp_test.free_all_pages(); ASSERT_EQ(OB_SUCCESS, ret); - // 脏页减少到5%时,not_alloc_range能覆盖整个shrink_range + // Dirty pages reduced to 5%, not_alloc_range can cover the entire shrink_range ret = wbp_test.alloc_data_pages(WBP_MAX_PAGE_NUM, notify_dirty); // data: -> 20% EXPECT_EQ(OB_ALLOCATE_TMP_FILE_PAGE_FAILED, ret); ret = wbp_test.alloc_meta_pages(WBP_MAX_PAGE_NUM, notify_dirty); // meta: -> 10% @@ -1134,7 +1131,7 @@ TEST_F(TestBufferPool, test_buffer_pool_free_page_when_shrinking) ret = wbp_test.free_all_pages(); ASSERT_EQ(OB_SUCCESS, ret); - // shrink_range内页面无法再被分配,并且可以推动缩容完成 + // Pages within shrink_range cannot be allocated anymore, and can push the resizing to complete ret = wbp_test.alloc_meta_pages(WBP_MAX_PAGE_NUM, notify_dirty); // meta: -> 7.5% (wbp shrinking target size) EXPECT_EQ(OB_ALLOCATE_TMP_FILE_PAGE_FAILED, ret); EXPECT_EQ(WBP_MAX_PAGE_NUM * 0.075, wbp.meta_page_cnt_); diff --git a/mittest/mtlenv/storage/tmp_file/test_tmp_file_buffer_pool_entry_array.cpp b/mittest/mtlenv/storage/tmp_file/test_tmp_file_buffer_pool_entry_array.cpp index 128116cec..259065081 100644 --- a/mittest/mtlenv/storage/tmp_file/test_tmp_file_buffer_pool_entry_array.cpp +++ b/mittest/mtlenv/storage/tmp_file/test_tmp_file_buffer_pool_entry_array.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/mittest/mtlenv/storage/tmp_file/test_tmp_file_flush_list.cpp b/mittest/mtlenv/storage/tmp_file/test_tmp_file_flush_list.cpp index f5c69caad..9086a69e5 100644 --- a/mittest/mtlenv/storage/tmp_file/test_tmp_file_flush_list.cpp +++ b/mittest/mtlenv/storage/tmp_file/test_tmp_file_flush_list.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE @@ -73,7 +77,7 @@ class TestFlushListIterator : public ::testing::Test private: char *random_buf_; const int64_t write_size_ = 4 * 1024 * 1024; // 4MB - unordered_map mock_dirty_record_; // 记录模拟生成的脏页数据代替实际写入文件 + unordered_map mock_dirty_record_; // record simulated generated dirty page data instead of actual write to file }; void get_file_range_by_state(const FlushCtxState state, int64_t &low, int64_t &high) @@ -328,8 +332,7 @@ TEST_F(TestFlushListIterator, test_iter_data_basic) vector file_handles; int total_file_num = 0; const int64_t FILE_NUM = 10; - - // 创建文件,根据层级生成模拟的脏页数量 + // Create file, generate simulated dirty page count based on hierarchy int64_t total_file_cnt = 0; for (int64_t t = FlushCtxState::FSM_F1; t < FlushCtxState::FSM_FINISHED; ++t) { file_handles.clear(); @@ -348,8 +351,7 @@ TEST_F(TestFlushListIterator, test_iter_data_basic) ObTmpFileFlushListIterator iter; ret = iter.init(&flush_prio_mgr); ASSERT_EQ(OB_SUCCESS, ret); - - // 遍历所有刷盘层级是否能取出该层级所有文件 + // Traverse all flush levels to see if all files at that level can be retrieved int64_t iter_file_cnt = 0; for (int64_t t = FlushCtxState::FSM_F1; t < FlushCtxState::FSM_FINISHED; ++t) { for (int64_t i = 0; OB_SUCC(ret) && i < FILE_NUM * 5; ++i) { @@ -376,8 +378,7 @@ TEST_F(TestFlushListIterator, test_iter_prev_stage) vector file_handles; int total_file_num = 0; const int64_t FILE_NUM = 10; - - // 创建文件,根据层级生成模拟的脏页数量 + // Create file, generate simulated dirty page count based on hierarchy int64_t total_file_cnt = 0; for (int64_t t = FlushCtxState::FSM_F1; t < FlushCtxState::FSM_FINISHED; ++t) { file_handles.clear(); @@ -397,8 +398,7 @@ TEST_F(TestFlushListIterator, test_iter_prev_stage) ObTmpFileFlushListIterator iter; ret = iter.init(&flush_prio_mgr); ASSERT_EQ(OB_SUCCESS, ret); - - // 直接开始遍历F3直至OB_ITER_END + // Directly start traversing F3 until OB_ITER_END for (int64_t i = 0; OB_SUCC(ret) && i < FILE_NUM * 10; ++i) { tmp_file::ObSNTmpFileHandle file_handle; ret = iter.next(FlushCtxState::FSM_F3, file_handle); @@ -408,14 +408,12 @@ TEST_F(TestFlushListIterator, test_iter_prev_stage) } } ASSERT_EQ(OB_ITER_END, ret); - - // 切换到下一层级后,无法再遍历之前的层级 + // Switch to the next level, you can no longer traverse the previous levels tmp_file::ObSNTmpFileHandle file_handle; ret = iter.next(FlushCtxState::FSM_F1, file_handle); ASSERT_EQ(OB_ERR_UNEXPECTED, ret); } - -// 某个文件从iterator返回、使用之后重新插回,如果迭代层级没有变更应该能被iterator重新取出 +// A file returned from iterator, after use should be reinserted, if the iteration level has not changed it should be retrievable by the iterator again TEST_F(TestFlushListIterator, test_iter_reinsert_file) { int ret = OB_SUCCESS; @@ -425,8 +423,7 @@ TEST_F(TestFlushListIterator, test_iter_reinsert_file) vector file_handles; int total_file_num = 0; const int64_t FILE_NUM = 10; - - // 创建文件,根据层级生成模拟的脏页数量 + // Create file, generate simulated dirty page count based on hierarchy int64_t total_file_cnt = 0; create_files(FlushCtxState::FSM_F1, FILE_NUM, flush_prio_mgr, file_handles); for (int64_t i = 0; i < file_handles.size(); ++i) { @@ -442,8 +439,7 @@ TEST_F(TestFlushListIterator, test_iter_reinsert_file) ObTmpFileFlushListIterator iter; ret = iter.init(&flush_prio_mgr); ASSERT_EQ(OB_SUCCESS, ret); - - // 通过iterator取出所有文件 + // Retrieve all files through iterator int64_t iter_file_cnt = 0; for (int64_t t = FlushCtxState::FSM_F1; t < FlushCtxState::FSM_FINISHED; ++t) { for (int64_t i = 0; OB_SUCC(ret) && i < FILE_NUM * 5; ++i) { @@ -480,8 +476,7 @@ TEST_F(TestFlushListIterator, test_flush_list_remove) ASSERT_EQ(OB_SUCCESS, ret); vector file_handles; const int64_t FILE_NUM = 10; - - // 创建文件,根据层级生成模拟的脏页数量 + // Create file, generate simulated dirty page count based on hierarchy int64_t total_file_cnt = 0; for (int64_t t = FlushCtxState::FSM_F1; t < FlushCtxState::FSM_FINISHED; ++t) { vector tmp_file_handles; @@ -497,8 +492,7 @@ TEST_F(TestFlushListIterator, test_flush_list_remove) } file_handles.insert(file_handles.end(), tmp_file_handles.begin(), tmp_file_handles.end()); } - - // 从文件链表中删除文件 + // Remove file from file list const int64_t rand_remove_cnt = ObRandom::rand(1, file_handles.size()); for (int64_t i = 0; i < rand_remove_cnt; ++i) { tmp_file::ObSNTmpFileHandle file_handle = file_handles.at(i); @@ -541,12 +535,10 @@ TEST_F(TestFlushListIterator, test_flush_list_update) vector file_handles; int total_file_num = 0; const int64_t FILE_NUM = 10; - - // 创建文件,根据层级生成模拟的脏页数量 + // Create file, generate simulated dirty page count based on hierarchy int64_t total_file_cnt = 0; create_files(FlushCtxState::FSM_F1, FILE_NUM, flush_prio_mgr, file_handles); - - // 0.插入文件0~4 + // 0.Insert files 0~4 for (int64_t i = 0; i < file_handles.size() / 2; ++i) { tmp_file::ObSNTmpFileHandle file_handle = file_handles.at(i); ASSERT_NE(file_handle.get(), nullptr); @@ -556,8 +548,7 @@ TEST_F(TestFlushListIterator, test_flush_list_update) ASSERT_EQ(OB_SUCCESS, ret); total_file_cnt += 1; } - - // 1. 更新不在链表中的文件 + // 1. Update files not in the list for (int64_t i = file_handles.size() / 2; i < file_handles.size(); ++i) { tmp_file::ObSNTmpFileHandle file_handle = file_handles.at(i); ObSharedNothingTmpFile &tmp_file = *file_handle.get(); @@ -565,8 +556,7 @@ TEST_F(TestFlushListIterator, test_flush_list_update) ret = flush_prio_mgr.update_data_flush_list(tmp_file, dirty_record.dirty_data_size_); ASSERT_EQ(OB_ERR_UNEXPECTED, ret); } - - // 2. 对层级没有变动的文件进行更新 + // 2. Update files without changes in hierarchy for (int64_t i = 0; i < file_handles.size() / 2; ++i) { tmp_file::ObSNTmpFileHandle file_handle = file_handles.at(i); ObSharedNothingTmpFile &tmp_file = *file_handle.get(); @@ -574,8 +564,7 @@ TEST_F(TestFlushListIterator, test_flush_list_update) ret = flush_prio_mgr.update_data_flush_list(tmp_file, dirty_record.dirty_data_size_); ASSERT_EQ(OB_SUCCESS, ret); } - - // 3. 更新到新的层级 + // 3. Update to the new level for (int64_t i = 0; i < file_handles.size() / 2; ++i) { tmp_file::ObSNTmpFileHandle file_handle = file_handles.at(i); ObSharedNothingTmpFile &tmp_file = *file_handle.get(); @@ -584,8 +573,7 @@ TEST_F(TestFlushListIterator, test_flush_list_update) ret = flush_prio_mgr.update_data_flush_list(tmp_file, dirty_record.dirty_data_size_); ASSERT_EQ(OB_SUCCESS, ret); } - - // 4. 插入文件5~10 + // 4. Insert files 5~10 for (int64_t i = file_handles.size() / 2; i < file_handles.size(); ++i) { tmp_file::ObSNTmpFileHandle file_handle = file_handles.at(i); ASSERT_NE(file_handle.get(), nullptr); @@ -599,16 +587,14 @@ TEST_F(TestFlushListIterator, test_flush_list_update) ObTmpFileFlushListIterator iter; ret = iter.init(&flush_prio_mgr); ASSERT_EQ(OB_SUCCESS, ret); - - // 5. F1中可以取出5个文件 + // 5. 5 files can be retrieved from F1 for (int64_t i = 0; i < file_handles.size() / 2; ++i) { tmp_file::ObSNTmpFileHandle file_handle; ret = iter.next(FlushCtxState::FSM_F1, file_handle); ASSERT_EQ(OB_SUCCESS, ret); ASSERT_NE(file_handle.get(), nullptr); } - - // 6. F5中可以取出5个更新后的文件 + // 6. F5 can retrieve 5 updated files for (int64_t i = 0; i < file_handles.size() / 2; ++i) { tmp_file::ObSNTmpFileHandle file_handle; ret = iter.next(FlushCtxState::FSM_F3, file_handle); @@ -646,8 +632,7 @@ TEST_F(TestFlushListIterator, test_flush_list_reinsert_after_use) ret = flush_prio_mgr.insert_data_flush_list(tmp_file, dirty_record.dirty_data_size_); ASSERT_EQ(OB_SUCCESS, ret); } - - // 取出迭代器dir中一半的文件 + // Take half of the files from iterator dir const int64_t USED_FILE_CNT = file_handles.size() / 2; for (int64_t i = 0; i < USED_FILE_CNT; ++i) { tmp_file::ObSNTmpFileHandle file_handle; @@ -656,13 +641,11 @@ TEST_F(TestFlushListIterator, test_flush_list_reinsert_after_use) ASSERT_NE(file_handle.get(), nullptr); printf("use file %ld\n", file_handle.get()->get_fd()); } - - // 迭代器中剩余文件重新插回flush_prio_mgr + // Remaining files in the iterator are reinserted into flush_prio_mgr iter.destroy(); ret = iter.init(&flush_prio_mgr); ASSERT_EQ(OB_SUCCESS, ret); - - // 重新初始化迭代器,通过迭代器取出剩余文件 + // Reinitialize iterator, retrieve remaining files through iterator int64_t remain_file_cnt = 0; while (OB_SUCC(ret)) { tmp_file::ObSNTmpFileHandle file_handle; diff --git a/mittest/mtlenv/storage/tmp_file/test_tmp_file_flush_manager.cpp b/mittest/mtlenv/storage/tmp_file/test_tmp_file_flush_manager.cpp index 76b2a8dc7..9579110e4 100644 --- a/mittest/mtlenv/storage/tmp_file/test_tmp_file_flush_manager.cpp +++ b/mittest/mtlenv/storage/tmp_file/test_tmp_file_flush_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase–– - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "mittest/mtlenv/storage/tmp_file/ob_tmp_file_test_helper.h" @@ -443,7 +447,7 @@ TEST_F(TestTmpFileFlushMgr, test_delete_file_when_flushing) // start a thread to remove deleting tmp file in retry list bool has_stop = false; - std::thread t(do_async_flush, MTL_CTX(), std::ref(flush_tg), std::ref(has_stop)); // TODO: 可以用async mode来替代 + std::thread t(do_async_flush, MTL_CTX(), std::ref(flush_tg), std::ref(has_stop)); // TODO: can use async mode to replace // remove file 2, expect remove complete immediately int64_t fd_2 = tmp_file_handles.at(2).get()->fd_; @@ -909,8 +913,7 @@ TEST_F(TestTmpFileFlushMgr, test_reinsert_item_into_meta_tree) ObTmpWriteBufferPool &wbp = pc_ctrl.write_buffer_pool_; ObTmpFileFlushTG &flush_tg = pc_ctrl.mock_swap_tg_.flush_tg_ref_; wbp.default_wbp_memory_limit_ = BIG_WBP_MEM_LIMIT * 2; - - // 1. 产生data和meta的刷盘任务,所有IO都卡住 + // 1. Generate the brush disk task for data and meta, all IOs are blocked MockIO.set_wait_mode(MockTmpFileUtil::MOCK_WAIT_IO_MODE::MOCK_ALL_IO_TIMEOUT); pc_ctrl.set_flush_all_data(true); @@ -930,8 +933,7 @@ TEST_F(TestTmpFileFlushMgr, test_reinsert_item_into_meta_tree) EXPECT_EQ(37, flush_tg.flushing_block_num_); // 36 data task + 1 meta task(13 meta pages) EXPECT_TRUE(wbp.meta_page_cnt_ > 0); EXPECT_TRUE(wbp.dirty_meta_page_cnt_ == 0); - - // 2. data IO 全部完成,重新插入data刷盘链表;再次触发data刷盘 + // 2. data IO all completed, reinsert data flush linked list; trigger data flush again io_info.size_ = 8 * 1024 * 1024; ret = MTL(ObTenantTmpFileManager *)->write(MTL_ID(), io_info); ASSERT_EQ(OB_SUCCESS, ret); @@ -942,8 +944,7 @@ TEST_F(TestTmpFileFlushMgr, test_reinsert_item_into_meta_tree) wbp.print_statistics(); LOG_INFO("file status 2", KPC(file_handle.get())); EXPECT_EQ(nullptr, file_handle.get()->data_flush_node_.get_next()); - - // 3. meta IO未完成的情况下不能再次刷到meta + // 3. meta IO not completed, meta cannot be brushed again flush_tg.do_work_(); LOG_INFO("flush info 3", K(flush_tg)); wbp.print_statistics(); @@ -951,8 +952,7 @@ TEST_F(TestTmpFileFlushMgr, test_reinsert_item_into_meta_tree) // add one meta pages at level 0, level 1 rightmost meta page becomes dirty EXPECT_EQ(wbp.write_back_meta_cnt_, 12); ASSERT_EQ(OB_SUCCESS, MockIO.get_generate_error_code()); - - // 4. IO恢复,结束流程 + // 4. IO recovery, end process MockIO.set_wait_mode(MockTmpFileUtil::MOCK_WAIT_IO_MODE::NORMAL); for (int32_t i = 0; i < 10; ++i) { flush_tg.do_work_(); diff --git a/mittest/mtlenv/storage/tmp_file/test_tmp_file_meta_tree.cpp b/mittest/mtlenv/storage/tmp_file/test_tmp_file_meta_tree.cpp index 129bc3fd6..bac4f205c 100644 --- a/mittest/mtlenv/storage/tmp_file/test_tmp_file_meta_tree.cpp +++ b/mittest/mtlenv/storage/tmp_file/test_tmp_file_meta_tree.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/storage/tmp_file/test_tmp_file_write_buffer_pool_index_cache.cpp b/mittest/mtlenv/storage/tmp_file/test_tmp_file_write_buffer_pool_index_cache.cpp index 827727d98..b0b326de1 100644 --- a/mittest/mtlenv/storage/tmp_file/test_tmp_file_write_buffer_pool_index_cache.cpp +++ b/mittest/mtlenv/storage/tmp_file/test_tmp_file_write_buffer_pool_index_cache.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -876,4 +880,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/mtlenv/tablelock/table_lock_common_env.h b/mittest/mtlenv/tablelock/table_lock_common_env.h index fe23221ab..40d6dce3a 100644 --- a/mittest/mtlenv/tablelock/table_lock_common_env.h +++ b/mittest/mtlenv/tablelock/table_lock_common_env.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_STORAGE_TABLELOCK_OB_TABLE_LOCK_COMMON_ENV_ diff --git a/mittest/mtlenv/tablelock/table_lock_tx_common_env.h b/mittest/mtlenv/tablelock/table_lock_tx_common_env.h index f0e97419f..95cef35ed 100644 --- a/mittest/mtlenv/tablelock/table_lock_tx_common_env.h +++ b/mittest/mtlenv/tablelock/table_lock_tx_common_env.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_STORAGE_TABLELOCK_OB_TABLE_LOCK_TX_COMMON_ENV_ diff --git a/mittest/mtlenv/tablelock/test_lock_memtable.cpp b/mittest/mtlenv/tablelock/test_lock_memtable.cpp index a3b6326a8..bda6bb726 100644 --- a/mittest/mtlenv/tablelock/test_lock_memtable.cpp +++ b/mittest/mtlenv/tablelock/test_lock_memtable.cpp @@ -1,16 +1,20 @@ // owner: cxf262476 // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX TABLELOCK diff --git a/mittest/mtlenv/tablelock/test_lock_table_callback.cpp b/mittest/mtlenv/tablelock/test_lock_table_callback.cpp index 889390f12..478b136e4 100644 --- a/mittest/mtlenv/tablelock/test_lock_table_callback.cpp +++ b/mittest/mtlenv/tablelock/test_lock_table_callback.cpp @@ -1,16 +1,20 @@ // owner: cxf262476 // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX TABLELOCK diff --git a/mittest/mtlenv/tablelock/test_mem_ctx_table_lock.cpp b/mittest/mtlenv/tablelock/test_mem_ctx_table_lock.cpp index 38b75c078..2207de898 100644 --- a/mittest/mtlenv/tablelock/test_mem_ctx_table_lock.cpp +++ b/mittest/mtlenv/tablelock/test_mem_ctx_table_lock.cpp @@ -1,16 +1,20 @@ // owner: cxf262476 // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX TABLELOCK diff --git a/mittest/mtlenv/tablelock/test_obj_lock.cpp b/mittest/mtlenv/tablelock/test_obj_lock.cpp index 448225a3e..97b94a119 100644 --- a/mittest/mtlenv/tablelock/test_obj_lock.cpp +++ b/mittest/mtlenv/tablelock/test_obj_lock.cpp @@ -1,16 +1,20 @@ // owner: cxf262476 // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX TABLELOCK diff --git a/mittest/mtlenv/tablelock/test_obj_lock_map.cpp b/mittest/mtlenv/tablelock/test_obj_lock_map.cpp index 97cb79bd6..271bf3e67 100644 --- a/mittest/mtlenv/tablelock/test_obj_lock_map.cpp +++ b/mittest/mtlenv/tablelock/test_obj_lock_map.cpp @@ -1,16 +1,20 @@ // owner: cxf262476 // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX TABLELOCK diff --git a/mittest/mtlenv/tablelock/test_table_lock_flush.cpp b/mittest/mtlenv/tablelock/test_table_lock_flush.cpp index cb752e7f4..7f2ff22a2 100644 --- a/mittest/mtlenv/tablelock/test_table_lock_flush.cpp +++ b/mittest/mtlenv/tablelock/test_table_lock_flush.cpp @@ -1,16 +1,20 @@ // owner: cxf262476 // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/mtlenv/test_buffer_ctx_node.cpp b/mittest/mtlenv/test_buffer_ctx_node.cpp index b89776a73..d49555cf3 100644 --- a/mittest/mtlenv/test_buffer_ctx_node.cpp +++ b/mittest/mtlenv/test_buffer_ctx_node.cpp @@ -1,16 +1,20 @@ // owner: zk250686 // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define UNITTEST_DEBUG diff --git a/mittest/mtlenv/test_htable_lock.cpp b/mittest/mtlenv/test_htable_lock.cpp index bbfd4e179..e5510e6c8 100644 --- a/mittest/mtlenv/test_htable_lock.cpp +++ b/mittest/mtlenv/test_htable_lock.cpp @@ -1,16 +1,20 @@ // owner: shenyunlong.syl // owner group: shenzhen -/** - * Copyright (c) 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/test_ob_election_priority.cpp b/mittest/mtlenv/test_ob_election_priority.cpp index 134b66e4c..920e05f08 100644 --- a/mittest/mtlenv/test_ob_election_priority.cpp +++ b/mittest/mtlenv/test_ob_election_priority.cpp @@ -1,16 +1,20 @@ // owner: liuhanyi.lhy // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/mtlenv/test_session_serde.cpp b/mittest/mtlenv/test_session_serde.cpp index e0d8a84c9..98341ff36 100644 --- a/mittest/mtlenv/test_session_serde.cpp +++ b/mittest/mtlenv/test_session_serde.cpp @@ -1,16 +1,20 @@ // owner: yunxing.cyx // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL diff --git a/mittest/mtlenv/test_tx_data_table.cpp b/mittest/mtlenv/test_tx_data_table.cpp index 582dd52b6..3f14e525e 100644 --- a/mittest/mtlenv/test_tx_data_table.cpp +++ b/mittest/mtlenv/test_tx_data_table.cpp @@ -1,16 +1,20 @@ // owner: gengli.wzy // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ @@ -645,8 +649,7 @@ void TestTxDataTable::do_repeat_insert_test() { ObTxData *tx_data = nullptr; transaction::ObTransID tx_id; - - // 插入10000个tx data,但都是同一个txid的rollback to,所以最后只会保留一个 + // Insert 10000 tx data, but all are the same txid rollback to, so only one will be retained in the end for (int i = 1; i <= 10000; i++) { tx_id = transaction::ObTransID(269381); tx_data = nullptr; @@ -671,8 +674,7 @@ void TestTxDataTable::do_repeat_insert_test() { ASSERT_EQ(OB_SUCCESS, tx_data_table_.insert(tx_data)); } - - // 插入了4个tx data + // inserted 4 tx data for (int i = 1; i <= 4; i++) { tx_id = transaction::ObTransID(269381 + i); tx_data = nullptr; @@ -693,18 +695,16 @@ void TestTxDataTable::do_repeat_insert_test() { ObTxDataMemtable *frozen_memtable = nullptr; ObTxDataMemtable *active_memtable = nullptr; check_freeze_(memtable_mgr, frozen_memtable, active_memtable); - // 预处理会产生一个特殊行的tx data + // Preprocessing will generate a special row of tx data ASSERT_EQ(OB_SUCCESS, frozen_memtable->pre_process_for_merge()); - - // 总计有6个合法的tx data待转储。此时如果试图切7个区间,函数不会报错,但是返回结果里只有一个range + // There are a total of 6 valid tx data to be dumped. At this time, if you attempt to split into 7 intervals, the function will not return an error, but there will only be one range in the result ObStoreRange input_range; input_range.set_whole_range(); ObSEArray range_array; ASSERT_EQ(OB_SUCCESS, frozen_memtable->get_split_ranges(input_range, 7, range_array)); ASSERT_EQ(1, range_array.count()); STORAGE_LOG(INFO, "output range", K(range_array)); - - // 如果试图切6个区间,能顺利切出6个range + // If you try to slice into 6 intervals, it can smoothly slice out 6 ranges range_array.reuse(); ASSERT_EQ(OB_SUCCESS, frozen_memtable->get_split_ranges(input_range, 6, range_array)); ASSERT_EQ(6, range_array.count()); diff --git a/mittest/mtlenv/test_vector_index_adaptor.cpp b/mittest/mtlenv/test_vector_index_adaptor.cpp index 9fb324f75..1034c130e 100644 --- a/mittest/mtlenv/test_vector_index_adaptor.cpp +++ b/mittest/mtlenv/test_vector_index_adaptor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE @@ -74,7 +78,7 @@ class TestVectorIndexAdaptor : public ::testing::Test { void* ObArenaAllocator_malloc_adapter(size_t size, ObArenaAllocator* allocator) { - // 调用 ObArenaAllocator 的 alloc 方法并转换 size + // Call the alloc method of ObArenaAllocator and convert size return allocator->alloc(static_cast(size)); } @@ -616,7 +620,7 @@ class ObTestHNSWDeserializeCallback { { int ret = OB_SUCCESS; ObTestHNSWDeserializeCallback::CbParam ¶m = static_cast(cb_param); - if (param.cur_pos_ <= param.size_) { + if (param.cur_pos_ < param.size_) { read_size = (param.size_ - param.cur_pos_) > param.part_size_ ? param.part_size_ : (param.size_ - param.cur_pos_); data = ((char*)param.data_) + param.cur_pos_; param.cur_pos_ += read_size; @@ -1493,6 +1497,289 @@ TEST_F(TestVectorIndexAdaptor, test_hnsw_bq_ser_deser) ASSERT_EQ(OB_SUCCESS, test_knn_search(index_handler, ids, vecs, dim, num_vectors, ef_search, &test_filter)); } +TEST_F(TestVectorIndexAdaptor, test_sparse_vector_index_query) +{ + obvsag::VectorIndexPtr index_handler = nullptr; + + const char* const METRIC = "ip"; + const char* const DATATYPE = "sparse"; + bool use_reorder = false; + float doc_prune_ratio = 0.0; + int window_size = 10000; + VsagMemContext vsag_mem_context; + ASSERT_EQ(vsag_mem_context.init(), 0); + + ASSERT_EQ(obvectorutil::create_index(index_handler, + obvsag::IPIVF_TYPE, + DATATYPE, + METRIC, + use_reorder, + doc_prune_ratio, + window_size, + &vsag_mem_context), 0); + + std::vector, std::vector>> custom_data = {{{1, 2, 3}, {0.1f, 0.2f, 0.3f}}, + {{2, 3, 4}, {0.2f, 0.3f, 0.4f}}, + {{3, 4, 5}, {0.3f, 0.4f, 0.5f}}, + {{4, 5, 6}, {0.4f, 0.5f, 0.6f}}, + {{5, 6, 7}, {0.5f, 0.6f, 0.7f}}, + {{6, 7, 8}, {0.6f, 0.7f, 0.8f}}, + {{7, 8, 9}, {0.7f, 0.8f, 0.9f}}, + {{8, 9, 10}, {0.8f, 0.9f, 1.0f}}, + {{9, 10, 11}, {0.9f, 1.0f, 1.1f}}, + {{11, 10, 12}, {1.1f, 1.0f, 1.2f}}}; + int num_sparse_vector = custom_data.size(); + int total_length = num_sparse_vector * 3; + ObArenaAllocator allocator; + uint32_t *lens = static_cast(allocator.alloc(sizeof(uint32_t) * num_sparse_vector)); + uint32_t *dims = static_cast(allocator.alloc(sizeof(uint32_t) * total_length)); + float *vals = static_cast(allocator.alloc(sizeof(float) * total_length)); + int64_t *ids = static_cast(allocator.alloc(sizeof(int64_t) * num_sparse_vector)); + int pos = 0; + for (int i = 0; i < custom_data.size(); ++i) { + lens[i] = 3; + MEMCPY(dims + pos, custom_data[i].first.data(), custom_data[i].first.size() * sizeof(uint32_t)); + MEMCPY(vals + pos, custom_data[i].second.data(), custom_data[i].second.size() * sizeof(float)); + pos += 3; + ids[i] = i + 1; + } + pos = 0; + for (int i = 0; i < custom_data.size(); ++i) { + ASSERT_EQ(0, obvectorutil::add_index(index_handler, &lens[i], dims+pos, vals+pos, &ids[i], 1)); + pos += 3; + } + int64_t index_size = 0; + ASSERT_EQ(0, obvectorutil::get_index_number(index_handler, index_size)); + ASSERT_EQ(index_size, num_sparse_vector); + int64_t min_id = 1, max_id = custom_data.size(); + int64_t min, max; + ASSERT_EQ(0, obvectorutil::get_vid_bound(index_handler, min, max)); + // ASSERT_EQ(min_id, min); + // ASSERT_EQ(max_id, max); + std::cout << "num vectors: " << index_size << ", min id: " << min << ", max id: " << max << std::endl; + + int query_len = 2; + uint32_t query_dims[2] = {3, 4}; + float query_vals[2] = {1, 1}; + + const float* result_dist0; + const int64_t* result_ids0; + const char* extra_info_buf_ptr = nullptr; + float query_prune_ratio = 0.0; + int64_t n_candidate = 10; + int64_t top_k = 10; + int64_t result_size = 0; + roaring::api::roaring64_bitmap_t *bitmap = roaring::api::roaring64_bitmap_create(); + TestFilter test_filter(bitmap); + + std::cout << "===================== Query Result ================" << std::endl; + + ASSERT_EQ(0, obvectorutil::knn_search(index_handler, + query_len, + query_dims, + query_vals, + top_k, + result_dist0, + result_ids0, + extra_info_buf_ptr, + result_size, + query_prune_ratio, + n_candidate, + &test_filter)); + std::cout << "result size: " << result_size << std::endl; + for (int64_t i = 0; i < result_size; ++i) { + std::cout << i << " id: " << result_ids0[i] << " dis: " << result_dist0[i] << ", Vector: {"; + auto data = custom_data[result_ids0[i] - 1]; + for (int j = 0; j < data.first.size(); j++) { + if (j > 0) std::cout << ", "; + std::cout << data.first[j] << ":" << data.second[j]; + } + std::cout << "}" << std::endl; + } + + uint32_t query_dims1[2] = {13, 14}; + float query_vals1[2] = {1, 1}; + const float* result_dist1; + const int64_t* result_ids1; + result_size = 0; + ASSERT_EQ(0, obvectorutil::knn_search(index_handler, + query_len, + query_dims1, + query_vals1, + top_k, + result_dist1, + result_ids1, + extra_info_buf_ptr, + result_size, + query_prune_ratio, + n_candidate, + nullptr)); + std::cout << "result size: " << result_size << std::endl; + ASSERT_EQ(0, result_size); + ASSERT_EQ(0, obvectorutil::knn_search(index_handler, + 0, + query_dims, + query_vals, + top_k, + result_dist1, + result_ids1, + extra_info_buf_ptr, + result_size, + query_prune_ratio, + n_candidate, + nullptr)); + std::cout << "result size: " << result_size << std::endl; + ASSERT_EQ(0, result_size); +} + +TEST_F(TestVectorIndexAdaptor, test_sparse_vector_index_serial) +{ + void* raw_memory = (void*)malloc(sizeof(common::obvectorutil::ObVsagLogger)); + common::obvectorutil::ObVsagLogger* ob_logger = new (raw_memory)common::obvectorutil::ObVsagLogger(); + obvsag::set_logger(ob_logger); + obvsag::VectorIndexPtr index_handler = nullptr; + + const char* const METRIC = "ip"; + const char* const DATATYPE = "sparse"; + bool use_reorder = false; + float doc_prune_ratio = 0.0; + int window_size = 10000; + std::mt19937 rng; + rng.seed(50); + VsagMemContext vsag_mem_context; + ASSERT_EQ(vsag_mem_context.init(), 0); + + ASSERT_EQ(obvectorutil::create_index(index_handler, + obvsag::IPIVF_TYPE, + DATATYPE, + METRIC, + use_reorder, + doc_prune_ratio, + window_size, + &vsag_mem_context), 0); + + int num_vectors = 1000; + int dim = 3; + uint32_t *lens = new uint32_t[num_vectors]; + int64_t *ids = new int64_t[num_vectors]; + uint32_t *dims = new uint32_t[dim * num_vectors]; + float *vecs = new float[dim * num_vectors]; + + std::uniform_real_distribution<> distrib_real; + for (int64_t i = 0; i < num_vectors; ++i) { + ids[i] = i + 1; + lens[i] = dim; + } + + for (int64_t i = 0; i < num_vectors * dim; ++i) { + vecs[i] = (i % dim + 1) / 10.0; + dims[i] = i % dim + 1; + } + + ASSERT_EQ(0, obvectorutil::add_index(index_handler, lens, dims, vecs, ids, num_vectors)); + int64_t index_size = 0; + ASSERT_EQ(0, obvectorutil::get_index_number(index_handler, index_size)); + ASSERT_EQ(index_size, num_vectors); + + int64_t min_id = 1, max_id = num_vectors; + int64_t min, max; + ASSERT_EQ(0, obvectorutil::get_vid_bound(index_handler, min, max)); + // ASSERT_EQ(min_id, min); + // ASSERT_EQ(max_id, max); + std::cout << "num vectors: " << index_size << ", min id: " << min << ", max id: " << max << std::endl; + + int query_len = 2; + uint32_t query_dims[2] = {2, 3}; + float query_vals[2] = {1, 1}; + + const float* result_dist0; + const int64_t* result_ids0; + int64_t result_size0 = 0; + const char* extra_info_buf_ptr = nullptr; + float query_prune_ratio = 0.0; + int64_t n_candidate = 0; + int64_t top_k = num_vectors; + roaring::api::roaring64_bitmap_t *bitmap = roaring::api::roaring64_bitmap_create(); + TestFilter test_filter(bitmap); + + std::cout << "===================== Query Result ================" << std::endl; + + ASSERT_EQ(0, obvectorutil::knn_search(index_handler, + query_len, + query_dims, + query_vals, + top_k, + result_dist0, + result_ids0, + extra_info_buf_ptr, + result_size0, + query_prune_ratio, + n_candidate, + &test_filter)); + std::cout << "result size: " << result_size0 << std::endl; + + // do serialize + ObArenaAllocator allocator; + ObVectorIndexSerializer index_seri(allocator); + ObTestHNSWSerializeCallback ser_callback; + ObOStreamBuf::Callback ser_cb = ser_callback; + + ObTestHNSWSerializeCallback::CbParam ser_param; + ser_param.allocator_ = &allocator; + ASSERT_EQ(0, index_seri.serialize(index_handler, ser_param, ser_cb, MTL_ID())); + std::cout << "serialize size " << ser_param.size_ << std::endl; + + // do deserialize + obvsag::VectorIndexPtr des_index_handler = nullptr; + ObTestHNSWDeserializeCallback des_callback; + ObIStreamBuf::Callback des_cb = des_callback; + + ObTestHNSWDeserializeCallback::CbParam des_param; + des_param.allocator_ = &allocator; + des_param.data_ = ser_param.data_; + des_param.size_ = ser_param.size_; + des_param.cur_pos_ = 0; + des_param.part_size_ = 1000; + ASSERT_EQ(obvectorutil::create_index(des_index_handler, + obvsag::IPIVF_TYPE, + DATATYPE, + METRIC, + use_reorder, + doc_prune_ratio, + window_size, + &vsag_mem_context), 0); + ASSERT_EQ(0, index_seri.deserialize(des_index_handler, des_param, des_cb, MTL_ID())); + // check vector count + ASSERT_EQ(0, obvectorutil::get_index_number(des_index_handler, index_size)); + ASSERT_EQ(index_size, num_vectors); + std::cout << "deserialize index number: " << index_size << std::endl; + + int query_len1 = 2; + uint32_t *query_dims1 = new uint32_t[2]; + query_dims1[0] = 2; + query_dims1[1] = 3; + float *query_vals1 = new float[2]; + query_vals1[0] = 1; + query_vals1[1] = 1; + const float* result_dist1; + const int64_t* result_ids1; + int64_t result_size1 = 0; + extra_info_buf_ptr = nullptr; + ASSERT_EQ(0, obvectorutil::knn_search(des_index_handler, + query_len1, + query_dims1, + query_vals1, + top_k, + result_dist1, + result_ids1, + extra_info_buf_ptr, + result_size1, + query_prune_ratio, + n_candidate, + &test_filter)); + std::cout << "result size: " << result_size1 << std::endl; +} + }; int main(int argc, char** argv) diff --git a/mittest/multi_replica/env/ob_fast_bootstrap.h b/mittest/multi_replica/env/ob_fast_bootstrap.h index 02051ce45..ff5ee2e0d 100644 --- a/mittest/multi_replica/env/ob_fast_bootstrap.h +++ b/mittest/multi_replica/env/ob_fast_bootstrap.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/mittest/multi_replica/env/ob_multi_replica_test_base.cpp b/mittest/multi_replica/env/ob_multi_replica_test_base.cpp index 5ae5843c5..4eed73a5d 100644 --- a/mittest/multi_replica/env/ob_multi_replica_test_base.cpp +++ b/mittest/multi_replica/env/ob_multi_replica_test_base.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_multi_replica_test_base.h" @@ -48,7 +52,7 @@ void init_log_and_gtest(int argc, char **argv) void init_gtest_output(std::string >est_log_name) { - // 判断是否处于Farm中 + // Determine if it is within the Farm char *mit_network_start_port_env = getenv("mit_network_start_port"); char *mit_network_port_num_env = getenv("mit_network_port_num"); if (mit_network_start_port_env != nullptr && mit_network_port_num_env != nullptr) { diff --git a/mittest/multi_replica/env/ob_multi_replica_test_base.h b/mittest/multi_replica/env/ob_multi_replica_test_base.h index eeeb086fc..9ec70a4d9 100644 --- a/mittest/multi_replica/env/ob_multi_replica_test_base.h +++ b/mittest/multi_replica/env/ob_multi_replica_test_base.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -56,7 +60,7 @@ class ObMultiReplicaTestBase : public testing::Test { public: static const int64_t TRANS_TIMEOUT = 5 * 1000 * 1000; - // set_bootstrap_and_create_tenant_warn_log 默认bootstrap和创建租户使用WARN日志,加速启动 + // set_bootstrap_and_create_tenant_warn_log default bootstrap and create tenant use WARN log, accelerate startup ObMultiReplicaTestBase(); virtual ~ObMultiReplicaTestBase(); @@ -104,7 +108,7 @@ class ObMultiReplicaTestBase : public testing::Test static void TearDownTestCase(); protected: - // 因为ob_server.h 中ObServer的使用方式导致现在只能启动单台 + // Because the usage of ObServer in ob_server.h now only allows starting a single machine static std::shared_ptr replica_; static bool is_started_; static bool is_inited_; diff --git a/mittest/multi_replica/env/ob_multi_replica_util.h b/mittest/multi_replica/env/ob_multi_replica_util.h index ca87abbc0..eb3784e2e 100644 --- a/mittest/multi_replica/env/ob_multi_replica_util.h +++ b/mittest/multi_replica/env/ob_multi_replica_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_multi_replica_test_base.h" diff --git a/mittest/multi_replica/env/ob_simple_replica.cpp b/mittest/multi_replica/env/ob_simple_replica.cpp index f690c824b..23ff6dfff 100644 --- a/mittest/multi_replica/env/ob_simple_replica.cpp +++ b/mittest/multi_replica/env/ob_simple_replica.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ @@ -161,9 +165,7 @@ int ObSimpleServerReplica::simple_init() "%ld, rs_list = %s\n", getpid(), zone_id_, rpc_port_, mysql_port_, zone_str.c_str(), server_info_list_.count(), rs_list_.c_str()); - - - // 因为改变了工作目录,设置为绝对路径 + // Because the working directory has changed, set to absolute path for (int i = 0; i < MAX_FD_FILE; i++) { int len = strlen(OB_LOGGER.log_file_[i].filename_); if (len > 0) { @@ -330,7 +332,7 @@ int ObSimpleServerReplica::bootstrap() ret = -66666666; SERVER_LOG(INFO, "observice is nullptr"); } else { - // observer内部有线程的检查, 这里在新建线程下调用会有问题 + // there is thread check inside observer, calling here when creating a new thread will cause issues obrpc::ObServerInfo server_info; server_info.zone_ = "zone1"; server_info.server_ = common::ObAddr(common::ObAddr::IPV4, local_ip_.c_str(), rpc_port_); diff --git a/mittest/multi_replica/env/ob_simple_replica.h b/mittest/multi_replica/env/ob_simple_replica.h index c5c27a89d..5e9390b6d 100644 --- a/mittest/multi_replica/env/ob_simple_replica.h +++ b/mittest/multi_replica/env/ob_simple_replica.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/mittest/multi_replica/test_mds_replay_from_ctx_table.cpp b/mittest/multi_replica/test_mds_replay_from_ctx_table.cpp index 87793e0bf..de31dd553 100644 --- a/mittest/multi_replica/test_mds_replay_from_ctx_table.cpp +++ b/mittest/multi_replica/test_mds_replay_from_ctx_table.cpp @@ -1,16 +1,20 @@ // owner: weixiaoxian.wxx // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/mittest/multi_replica/test_multi_transfer_tx.cpp b/mittest/multi_replica/test_multi_transfer_tx.cpp index ceb0570f0..e2f7bdfb9 100644 --- a/mittest/multi_replica/test_multi_transfer_tx.cpp +++ b/mittest/multi_replica/test_multi_transfer_tx.cpp @@ -1,16 +1,20 @@ // owner: handora.qc // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include #define USING_LOG_PREFIX SERVER diff --git a/mittest/multi_replica/test_ob_direct_load_inc_log.cpp b/mittest/multi_replica/test_ob_direct_load_inc_log.cpp index 61dc2e409..6242d3e73 100644 --- a/mittest/multi_replica/test_ob_direct_load_inc_log.cpp +++ b/mittest/multi_replica/test_ob_direct_load_inc_log.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/mittest/multi_replica/test_ob_multi_replica_basic.cpp b/mittest/multi_replica/test_ob_multi_replica_basic.cpp index f787f0a8d..5fb80c3be 100644 --- a/mittest/multi_replica/test_ob_multi_replica_basic.cpp +++ b/mittest/multi_replica/test_ob_multi_replica_basic.cpp @@ -1,16 +1,20 @@ // owner: weixiaoxian.wxx // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -47,25 +51,24 @@ TEST_F(ObSimpleMultiReplicaExampleTest_ZONE1, observer_start) { SERVER_LOG(INFO, "observer_start succ"); } - -// 创建租户并不轻量,看场景必要性使用 +// Creating a tenant is not lightweight, consider necessity of use based on the scenario TEST_F(ObSimpleMultiReplicaExampleTest_ZONE1, add_tenant) { - // 创建普通租户tt1 + // Create normal tenant tt1 ASSERT_EQ(OB_SUCCESS, create_tenant()); - // 获取租户tt1的tenant_id + // Get the tenant_id of tenant tt1 ASSERT_EQ(OB_SUCCESS, get_tenant_id(RunCtx.tenant_id_)); ASSERT_NE(0, RunCtx.tenant_id_); - // 初始化普通租户tt1的sql proxy + // Initialize the sql proxy for normal tenant tt1 ASSERT_EQ(OB_SUCCESS, get_curr_simple_server().init_sql_proxy2()); } TEST_F(ObSimpleMultiReplicaExampleTest_ZONE1, create_table) { int ret = OB_SUCCESS; - // 使用普通租户tt1 + // Use normal tenant tt1 common::ObMySQLProxy &sql_proxy = get_curr_simple_server().get_sql_proxy2(); - // 创建表 + // Create table { OB_LOG(INFO, "create_table start"); ObSqlString sql; diff --git a/mittest/multi_replica/test_tx_ls_state_switch.cpp b/mittest/multi_replica/test_tx_ls_state_switch.cpp index 8e90173a8..16bc237a2 100644 --- a/mittest/multi_replica/test_tx_ls_state_switch.cpp +++ b/mittest/multi_replica/test_tx_ls_state_switch.cpp @@ -1,16 +1,20 @@ // owner: weixiaoxian.wxx // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/mittest/ob_mittest_utils.h b/mittest/ob_mittest_utils.h index 39e0b07bd..94db7d4ca 100644 --- a/mittest/ob_mittest_utils.h +++ b/mittest/ob_mittest_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_UNITTEST_CLUSTER_OB_UTILS_H diff --git a/mittest/palf_cluster/env/ob_simple_log_cluster.cpp b/mittest/palf_cluster/env/ob_simple_log_cluster.cpp index 7aed167a0..5f5935ac6 100644 --- a/mittest/palf_cluster/env/ob_simple_log_cluster.cpp +++ b/mittest/palf_cluster/env/ob_simple_log_cluster.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_simple_log_cluster.h" @@ -130,4 +134,4 @@ int ObSimpleLogCluster::generate_sorted_server_list_(const int64_t node_cnt) } } // end unittest -} // end oceanbase \ No newline at end of file +} // end oceanbase diff --git a/mittest/palf_cluster/env/ob_simple_log_cluster.h b/mittest/palf_cluster/env/ob_simple_log_cluster.h index 40b20e303..83af81ab5 100644 --- a/mittest/palf_cluster/env/ob_simple_log_cluster.h +++ b/mittest/palf_cluster/env/ob_simple_log_cluster.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -108,4 +112,4 @@ class ObSimpleLogCluster : public testing::Test }; } // end unittest -} // end oceanbase \ No newline at end of file +} // end oceanbase diff --git a/mittest/palf_cluster/env/ob_simple_log_server.cpp b/mittest/palf_cluster/env/ob_simple_log_server.cpp index 66aae55af..b0357414c 100644 --- a/mittest/palf_cluster/env/ob_simple_log_server.cpp +++ b/mittest/palf_cluster/env/ob_simple_log_server.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define private public #include "ob_simple_log_server.h" @@ -811,4 +815,4 @@ bool ObLogServerReqQueueHandler::handlePacketQueue(ObRequest *req, void */* arg } } // unittest -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/mittest/palf_cluster/env/ob_simple_log_server.h b/mittest/palf_cluster/env/ob_simple_log_server.h index addc57415..6900b3b7e 100644 --- a/mittest/palf_cluster/env/ob_simple_log_server.h +++ b/mittest/palf_cluster/env/ob_simple_log_server.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/mittest/palf_cluster/logservice/log_service.cpp b/mittest/palf_cluster/logservice/log_service.cpp index f1151d23f..25e50a588 100644 --- a/mittest/palf_cluster/logservice/log_service.cpp +++ b/mittest/palf_cluster/logservice/log_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX CLOG @@ -69,7 +73,7 @@ int LogService::mtl_init(LogService* &logservice) const ObAddr &self = GCTX.self_addr(); const int64_t tenant_id = MTL_ID(); observer::ObSrvNetworkFrame *net_frame = GCTX.net_frame_; - //log_disk_usage_limit_size无法主动从配置项获取, 需要在mtl初始化时作为入参传入 + // log_disk_usage_limit_size cannot be actively obtained from the configuration item, and needs to be passed as a parameter when mtl is initialized const palf::PalfOptions &palf_options = MTL_INIT_CTX()->palf_options_; const char *tenant_clog_dir = MTL_INIT_CTX()->tenant_clog_dir_; const char *clog_dir = OB_FILE_SYSTEM_ROUTER.get_clog_dir(); @@ -487,7 +491,7 @@ int LogService::update_palf_options_except_disk_usage_limit_size() if (OB_FAIL(common::ObCompressorPool::get_instance().get_compressor_type( tenant_config->log_transport_compress_func, compressor_type))) { CLOG_LOG(ERROR, "log_transport_compress_func invalid.", K(ret)); - //需要获取log_disk_usage_limit_size + // Need to get log_disk_usage_limit_size } else if (OB_FAIL(palf_env_->get_options(palf_opts))) { CLOG_LOG(WARN, "palf get_options failed", K(ret)); } else { @@ -509,8 +513,7 @@ int LogService::update_palf_options_except_disk_usage_limit_size() } return ret; } - -//log_disk_usage_limit_size无法主动感知,只能通过上层触发时传入 +// log_disk_usage_limit_size cannot be proactively detected, it can only be passed in when triggered by the upper layer int LogService::update_log_disk_usage_limit_size(const int64_t log_disk_usage_limit_size) { int ret = OB_SUCCESS; diff --git a/mittest/palf_cluster/logservice/log_service.h b/mittest/palf_cluster/logservice/log_service.h index 7549fcd25..03282e8e7 100644 --- a/mittest/palf_cluster/logservice/log_service.h +++ b/mittest/palf_cluster/logservice/log_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_PALF_CLUSTER_OB_LOG_SERVICE_ @@ -81,29 +85,28 @@ class LogService common::ObILogAllocator *alloc_mgr, rpc::frame::ObReqTransport *transport, palf::ILogBlockPool *log_block_pool); - //--日志流相关接口-- - //新建日志流接口,该接口会创建日志流对应的目录,新建一个以PalfBaeInfo为日志基点的日志流。 - //其中包括生成并初始化对应的ObReplayStatus结构 - // @param [in] id,日志流标识符 - // @param [in] replica_type,日志流的副本类型 - // @param [in] tenant_role, 租户角色, 以此决定Palf使用模式(APPEND/RAW_WRITE) - // @param [in] palf_base_info, 日志同步基点信息 - // @param [out] log_handler,新建日志流以logservice::ObLogHandler形式返回,保证上层使用日志流时的生命周期 + //--Log stream related interfaces-- + // New log stream interface, this interface will create the directory corresponding to the log stream, and create a new log stream with PalfBaseInfo as the log base point. + // It includes generating and initializing the corresponding ObReplayStatus structure + // @param [in] id, log stream identifier + // @param [in] replica_type, the replica type of the log stream + // @param [in] tenant_role, tenant role, this decides the Palf usage mode (APPEND/RAW_WRITE) + // @param [in] palf_base_info, log synchronization base point information + // @param [out] log_handler, new log stream returned in the form of logservice::ObLogHandler, ensuring the lifecycle of the log stream when used by upper layers int create_ls(const share::ObLSID &id, const common::ObReplicaType &replica_type, const share::ObTenantRole &tenant_role, const palf::PalfBaseInfo &palf_base_info, const bool allow_log_sync, logservice::ObLogHandler &log_handler); - - //删除日志流接口:外层调用create_ls()之后,后续流程失败,需要调用remove_ls() + // Delete log stream interface: After calling create_ls(), if subsequent processes fail, you need to call remove_ls() int remove_ls(const share::ObLSID &id, logservice::ObLogHandler &log_handler); int check_palf_exist(const share::ObLSID &id, bool &exist) const; - //宕机重启恢复日志流接口,包括生成并初始化对应的ObReplayStatus结构 - // @param [in] id,日志流标识符 - // @param [out] log_handler,新建日志流以logservice::ObLogHandler形式返回,保证上层使用日志流时的生命周期 + // Downtime restart recovery log stream interface, including generating and initializing the corresponding ObReplayStatus structure + // @param [in] id, log stream identifier + // @param [out] log_handler, new log stream returned in the form of logservice::ObLogHandler, ensuring the lifecycle of the log stream when used by upper layers int add_ls(const share::ObLSID &id, logservice::ObLogHandler &log_handler); diff --git a/mittest/palf_cluster/logservice/ls_adapter.cpp b/mittest/palf_cluster/logservice/ls_adapter.cpp index e6c041f6a..e57402afe 100644 --- a/mittest/palf_cluster/logservice/ls_adapter.cpp +++ b/mittest/palf_cluster/logservice/ls_adapter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ls_adapter.h" diff --git a/mittest/palf_cluster/logservice/ls_adapter.h b/mittest/palf_cluster/logservice/ls_adapter.h index 4aed34fc5..9aef9dbec 100644 --- a/mittest/palf_cluster/logservice/ls_adapter.h +++ b/mittest/palf_cluster/logservice/ls_adapter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_PALF_CLUSTER_LS_ADAPTER_H_ diff --git a/mittest/palf_cluster/logservice/ob_log_client.cpp b/mittest/palf_cluster/logservice/ob_log_client.cpp index ba6baa469..f21d12e01 100644 --- a/mittest/palf_cluster/logservice/ob_log_client.cpp +++ b/mittest/palf_cluster/logservice/ob_log_client.cpp @@ -1,12 +1,18 @@ -// Copyright (c) 2021 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define USING_LOG_PREFIX CLOG #include "ob_log_client.h" @@ -234,4 +240,4 @@ void LogRemoteClient::has_returned() } } } // end namespace palfcluster -} // end namespace oceanbase \ No newline at end of file +} // end namespace oceanbase diff --git a/mittest/palf_cluster/logservice/ob_log_client.h b/mittest/palf_cluster/logservice/ob_log_client.h index 212e544a2..5e4d58b4f 100644 --- a/mittest/palf_cluster/logservice/ob_log_client.h +++ b/mittest/palf_cluster/logservice/ob_log_client.h @@ -1,12 +1,18 @@ -// Copyright (c) 2021 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #ifndef OCEANBASE_PALF_CLUSTER_LOG_CLIENT_H_ #define OCEANBASE_PALF_CLUSTER_LOG_CLIENT_H_ @@ -311,4 +317,4 @@ typedef common::ObLinearHashMap LogCli } // palfcluster } // oceanbase -#endif \ No newline at end of file +#endif diff --git a/mittest/palf_cluster/logservice/role_coordinator.cpp b/mittest/palf_cluster/logservice/role_coordinator.cpp index 9d8b90f8e..0e1f434a3 100644 --- a/mittest/palf_cluster/logservice/role_coordinator.cpp +++ b/mittest/palf_cluster/logservice/role_coordinator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "role_coordinator.h" diff --git a/mittest/palf_cluster/logservice/role_coordinator.h b/mittest/palf_cluster/logservice/role_coordinator.h index 99c122f59..b8a4c08ab 100644 --- a/mittest/palf_cluster/logservice/role_coordinator.h +++ b/mittest/palf_cluster/logservice/role_coordinator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_PALF_CLUSTER_ROLE_CHANGE_SERVICE_ diff --git a/mittest/palf_cluster/logservice/role_coordinator_handler.cpp b/mittest/palf_cluster/logservice/role_coordinator_handler.cpp index 493f7e62e..4bb06cd39 100644 --- a/mittest/palf_cluster/logservice/role_coordinator_handler.cpp +++ b/mittest/palf_cluster/logservice/role_coordinator_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "role_coordinator_handler.h" diff --git a/mittest/palf_cluster/logservice/role_coordinator_handler.h b/mittest/palf_cluster/logservice/role_coordinator_handler.h index 6095f0ece..8af1ed0ff 100644 --- a/mittest/palf_cluster/logservice/role_coordinator_handler.h +++ b/mittest/palf_cluster/logservice/role_coordinator_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_PALF_CLUSTER_OB_ROLE_CHANGE_HANDLER_ diff --git a/mittest/palf_cluster/rpc/ob_log_rpc_processor.h b/mittest/palf_cluster/rpc/ob_log_rpc_processor.h index 99c6c15e1..266715e48 100644 --- a/mittest/palf_cluster/rpc/ob_log_rpc_processor.h +++ b/mittest/palf_cluster/rpc/ob_log_rpc_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_PALF_CLUSTER_RPC_PROCESSOR_H_ diff --git a/mittest/palf_cluster/rpc/palf_cluster_request_handler.cpp b/mittest/palf_cluster/rpc/palf_cluster_request_handler.cpp index 80a24d7df..4ca3f5292 100644 --- a/mittest/palf_cluster/rpc/palf_cluster_request_handler.cpp +++ b/mittest/palf_cluster/rpc/palf_cluster_request_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "palf_cluster_request_handler.h" #include "palf_cluster_rpc_req.h" diff --git a/mittest/palf_cluster/rpc/palf_cluster_request_handler.h b/mittest/palf_cluster/rpc/palf_cluster_request_handler.h index 738490993..206c32029 100644 --- a/mittest/palf_cluster/rpc/palf_cluster_request_handler.h +++ b/mittest/palf_cluster/rpc/palf_cluster_request_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_PALF_CLUSTER_LOG_REQUEST_HANDLER_ diff --git a/mittest/palf_cluster/rpc/palf_cluster_rpc_processor.h b/mittest/palf_cluster/rpc/palf_cluster_rpc_processor.h index 328fb4c7d..065f1b67c 100644 --- a/mittest/palf_cluster/rpc/palf_cluster_rpc_processor.h +++ b/mittest/palf_cluster/rpc/palf_cluster_rpc_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_PALF_CLUSTER_RPC_PROCESSOR_H_ diff --git a/mittest/palf_cluster/rpc/palf_cluster_rpc_proxy.h b/mittest/palf_cluster/rpc/palf_cluster_rpc_proxy.h index b55935b5f..dd3d92e8c 100644 --- a/mittest/palf_cluster/rpc/palf_cluster_rpc_proxy.h +++ b/mittest/palf_cluster/rpc/palf_cluster_rpc_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_PALF_CLUSTER_LOG_RPC_PROXY_ diff --git a/mittest/palf_cluster/rpc/palf_cluster_rpc_req.cpp b/mittest/palf_cluster/rpc/palf_cluster_rpc_req.cpp index a0b767c8f..48cea0cde 100644 --- a/mittest/palf_cluster/rpc/palf_cluster_rpc_req.cpp +++ b/mittest/palf_cluster/rpc/palf_cluster_rpc_req.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "palf_cluster_rpc_req.h" diff --git a/mittest/palf_cluster/rpc/palf_cluster_rpc_req.h b/mittest/palf_cluster/rpc/palf_cluster_rpc_req.h index 71eadfce5..b86baa0a1 100644 --- a/mittest/palf_cluster/rpc/palf_cluster_rpc_req.h +++ b/mittest/palf_cluster/rpc/palf_cluster_rpc_req.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_PALF_CLUSTER_RPC_REQ_H_ diff --git a/mittest/palf_cluster/test_palf_bench_client.cpp b/mittest/palf_cluster/test_palf_bench_client.cpp index 5fa7f216c..02fe29c95 100644 --- a/mittest/palf_cluster/test_palf_bench_client.cpp +++ b/mittest/palf_cluster/test_palf_bench_client.cpp @@ -1,16 +1,20 @@ // owner: yunlong.cb // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/palf_cluster/test_palf_bench_server.cpp b/mittest/palf_cluster/test_palf_bench_server.cpp index 42df4e024..67d5e03fd 100644 --- a/mittest/palf_cluster/test_palf_bench_server.cpp +++ b/mittest/palf_cluster/test_palf_bench_server.cpp @@ -1,16 +1,20 @@ // owner: yunlong.cb // owner group: log -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/shared_storage/clean_residual_data.h b/mittest/shared_storage/clean_residual_data.h index e7d8ecd63..ca3e9ecb2 100644 --- a/mittest/shared_storage/clean_residual_data.h +++ b/mittest/shared_storage/clean_residual_data.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SENSITIVE_TEST_SHARED_STORAGE_CLEAN_RESIDUAL_DATA_H_ @@ -174,4 +178,4 @@ int ResidualDataCleanerHelper::clean_in_mock_env() } // namespace storage } // namespace oceanbase -#endif // OCEANBASE_SENSITIVE_TEST_SHARED_STORAGE_CLEAN_RESIDUAL_DATA_H_ \ No newline at end of file +#endif // OCEANBASE_SENSITIVE_TEST_SHARED_STORAGE_CLEAN_RESIDUAL_DATA_H_ diff --git a/mittest/shared_storage/meta_service/test_meta_service.cpp b/mittest/shared_storage/meta_service/test_meta_service.cpp index 9dfca5bf8..b748811e4 100644 --- a/mittest/shared_storage/meta_service/test_meta_service.cpp +++ b/mittest/shared_storage/meta_service/test_meta_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/simple_server/test_shared_storage_ls_gc.cpp b/mittest/shared_storage/simple_server/test_shared_storage_ls_gc.cpp index f53323081..2afee368b 100644 --- a/mittest/shared_storage/simple_server/test_shared_storage_ls_gc.cpp +++ b/mittest/shared_storage/simple_server/test_shared_storage_ls_gc.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -70,7 +74,7 @@ int ObCheckDirEmptOp::func(const dirent *entry) class ObSharedStorageTest : public ObSimpleClusterTestBase { public: - // 指定case运行目录前缀 test_ob_simple_cluster_ + // Specify the case run directory prefix test_ob_simple_cluster_ ObSharedStorageTest() : ObSimpleClusterTestBase("test_shared_storage_ls_gc_", "50G", "50G", "50G") {} int get_block_ids_from_dir( diff --git a/mittest/shared_storage/simple_server/test_storage_cache_policy_prewarmer.cpp b/mittest/shared_storage/simple_server/test_storage_cache_policy_prewarmer.cpp index 1da033a0b..4072de64c 100644 --- a/mittest/shared_storage/simple_server/test_storage_cache_policy_prewarmer.cpp +++ b/mittest/shared_storage/simple_server/test_storage_cache_policy_prewarmer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/sslog/test_meta_service_sslog.cpp b/mittest/shared_storage/sslog/test_meta_service_sslog.cpp index 2554844f9..6fe7b1c48 100644 --- a/mittest/shared_storage/sslog/test_meta_service_sslog.cpp +++ b/mittest/shared_storage/sslog/test_meta_service_sslog.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include #include diff --git a/mittest/shared_storage/test_auto_expand_disk.cpp b/mittest/shared_storage/test_auto_expand_disk.cpp index 03afeddcf..5d51a3e24 100644 --- a/mittest/shared_storage/test_auto_expand_disk.cpp +++ b/mittest/shared_storage/test_auto_expand_disk.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST @@ -117,4 +121,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_calibrate_disk_space.cpp b/mittest/shared_storage/test_calibrate_disk_space.cpp index 0e6f97b9f..3df461cbf 100644 --- a/mittest/shared_storage/test_calibrate_disk_space.cpp +++ b/mittest/shared_storage/test_calibrate_disk_space.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_clean_residual_data.cpp b/mittest/shared_storage/test_clean_residual_data.cpp index c1f77277b..ee1fbc722 100644 --- a/mittest/shared_storage/test_clean_residual_data.cpp +++ b/mittest/shared_storage/test_clean_residual_data.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST @@ -124,4 +128,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_ddl_clog.cpp b/mittest/shared_storage/test_ddl_clog.cpp index 780147113..551d24903 100644 --- a/mittest/shared_storage/test_ddl_clog.cpp +++ b/mittest/shared_storage/test_ddl_clog.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/shared_storage/test_device_config_mgr.cpp b/mittest/shared_storage/test_device_config_mgr.cpp index bf2332b13..74024076a 100644 --- a/mittest/shared_storage/test_device_config_mgr.cpp +++ b/mittest/shared_storage/test_device_config_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_disk_space_manager.cpp b/mittest/shared_storage/test_disk_space_manager.cpp index 5520aa3cc..d44ab38dd 100644 --- a/mittest/shared_storage/test_disk_space_manager.cpp +++ b/mittest/shared_storage/test_disk_space_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_file_manager.cpp b/mittest/shared_storage/test_file_manager.cpp index b5bba11db..0f5fbf095 100644 --- a/mittest/shared_storage/test_file_manager.cpp +++ b/mittest/shared_storage/test_file_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_flush_unsealed_tmp_file.cpp b/mittest/shared_storage/test_flush_unsealed_tmp_file.cpp index 6692ab512..be117d6f8 100644 --- a/mittest/shared_storage/test_flush_unsealed_tmp_file.cpp +++ b/mittest/shared_storage/test_flush_unsealed_tmp_file.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_open_close.cpp b/mittest/shared_storage/test_open_close.cpp index c14f9e7d4..9d2af21e5 100644 --- a/mittest/shared_storage/test_open_close.cpp +++ b/mittest/shared_storage/test_open_close.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_segment_file_manager.cpp b/mittest/shared_storage/test_segment_file_manager.cpp index 00427a705..84fb07dd7 100644 --- a/mittest/shared_storage/test_segment_file_manager.cpp +++ b/mittest/shared_storage/test_segment_file_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_ss_common_util.h b/mittest/shared_storage/test_ss_common_util.h index 743a3dfeb..05cc91d4d 100644 --- a/mittest/shared_storage/test_ss_common_util.h +++ b/mittest/shared_storage/test_ss_common_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST @@ -337,4 +341,4 @@ void TestSSCommonUtil::resume_all_bg_task(ObSSMicroCache *micro_cache) } } // namespace storage -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/mittest/shared_storage/test_ss_execute_checkpoint_task.cpp b/mittest/shared_storage/test_ss_execute_checkpoint_task.cpp index cc2b1bfea..350eca25c 100644 --- a/mittest/shared_storage/test_ss_execute_checkpoint_task.cpp +++ b/mittest/shared_storage/test_ss_execute_checkpoint_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_ss_fd_cache_perf.cpp b/mittest/shared_storage/test_ss_fd_cache_perf.cpp index 17e6b277f..c8e45243f 100644 --- a/mittest/shared_storage/test_ss_fd_cache_perf.cpp +++ b/mittest/shared_storage/test_ss_fd_cache_perf.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_ss_ha_prewarm_struct.cpp b/mittest/shared_storage/test_ss_ha_prewarm_struct.cpp index 2bf46f1d1..f5b15f0ff 100644 --- a/mittest/shared_storage/test_ss_ha_prewarm_struct.cpp +++ b/mittest/shared_storage/test_ss_ha_prewarm_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_ss_handle_arc_seg_op.cpp b/mittest/shared_storage/test_ss_handle_arc_seg_op.cpp index 8b2983e38..3742a842a 100644 --- a/mittest/shared_storage/test_ss_handle_arc_seg_op.cpp +++ b/mittest/shared_storage/test_ss_handle_arc_seg_op.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST @@ -190,4 +194,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_ss_la_micro_key_manager.cpp b/mittest/shared_storage/test_ss_la_micro_key_manager.cpp index 7e53bb02f..575a7a013 100644 --- a/mittest/shared_storage/test_ss_la_micro_key_manager.cpp +++ b/mittest/shared_storage/test_ss_la_micro_key_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_ss_linked_phy_block.cpp b/mittest/shared_storage/test_ss_linked_phy_block.cpp index 2eabdeac1..6ebc0aa00 100644 --- a/mittest/shared_storage/test_ss_linked_phy_block.cpp +++ b/mittest/shared_storage/test_ss_linked_phy_block.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE @@ -382,4 +386,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_ss_mc_prewarm_struct.cpp b/mittest/shared_storage/test_ss_mc_prewarm_struct.cpp index f65c7cdf8..70f6e34cb 100644 --- a/mittest/shared_storage/test_ss_mc_prewarm_struct.cpp +++ b/mittest/shared_storage/test_ss_mc_prewarm_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_ss_mem_data_manager.cpp b/mittest/shared_storage/test_ss_mem_data_manager.cpp index 95b7e42c0..e27ebb9be 100644 --- a/mittest/shared_storage/test_ss_mem_data_manager.cpp +++ b/mittest/shared_storage/test_ss_mem_data_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX @@ -440,4 +444,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_ss_micro_cache.cpp b/mittest/shared_storage/test_ss_micro_cache.cpp index 18e0d398b..4eeb4521f 100644 --- a/mittest/shared_storage/test_ss_micro_cache.cpp +++ b/mittest/shared_storage/test_ss_micro_cache.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_ss_micro_cache_abnormal_case.cpp b/mittest/shared_storage/test_ss_micro_cache_abnormal_case.cpp index add5dc16e..133e7875f 100644 --- a/mittest/shared_storage/test_ss_micro_cache_abnormal_case.cpp +++ b/mittest/shared_storage/test_ss_micro_cache_abnormal_case.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST @@ -365,4 +369,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_ss_micro_cache_basic_op.cpp b/mittest/shared_storage/test_ss_micro_cache_basic_op.cpp index 07e1f9aaf..47d9dc524 100644 --- a/mittest/shared_storage/test_ss_micro_cache_basic_op.cpp +++ b/mittest/shared_storage/test_ss_micro_cache_basic_op.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST @@ -859,4 +863,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_ss_micro_cache_check_prewarm.cpp b/mittest/shared_storage/test_ss_micro_cache_check_prewarm.cpp index 9c4851715..4266130cd 100644 --- a/mittest/shared_storage/test_ss_micro_cache_check_prewarm.cpp +++ b/mittest/shared_storage/test_ss_micro_cache_check_prewarm.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST @@ -385,4 +389,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_ss_micro_cache_checkpoint.cpp b/mittest/shared_storage/test_ss_micro_cache_checkpoint.cpp index 35b7d57cb..f03dfaa08 100644 --- a/mittest/shared_storage/test_ss_micro_cache_checkpoint.cpp +++ b/mittest/shared_storage/test_ss_micro_cache_checkpoint.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST @@ -221,4 +225,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_ss_micro_cache_eviction.cpp b/mittest/shared_storage/test_ss_micro_cache_eviction.cpp index 9c90598e1..7e7a40d04 100644 --- a/mittest/shared_storage/test_ss_micro_cache_eviction.cpp +++ b/mittest/shared_storage/test_ss_micro_cache_eviction.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_ss_micro_cache_huge_data.cpp b/mittest/shared_storage/test_ss_micro_cache_huge_data.cpp index 0544fba3e..44d8bfbf1 100644 --- a/mittest/shared_storage/test_ss_micro_cache_huge_data.cpp +++ b/mittest/shared_storage/test_ss_micro_cache_huge_data.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_ss_micro_cache_io_helper.cpp b/mittest/shared_storage/test_ss_micro_cache_io_helper.cpp index d827d872c..6a7be6278 100644 --- a/mittest/shared_storage/test_ss_micro_cache_io_helper.cpp +++ b/mittest/shared_storage/test_ss_micro_cache_io_helper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_ss_micro_cache_parallelism.cpp b/mittest/shared_storage/test_ss_micro_cache_parallelism.cpp index 52078e21b..8fe351a6f 100644 --- a/mittest/shared_storage/test_ss_micro_cache_parallelism.cpp +++ b/mittest/shared_storage/test_ss_micro_cache_parallelism.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_ss_micro_cache_random_size.cpp b/mittest/shared_storage/test_ss_micro_cache_random_size.cpp index e37596293..6f187a39a 100644 --- a/mittest/shared_storage/test_ss_micro_cache_random_size.cpp +++ b/mittest/shared_storage/test_ss_micro_cache_random_size.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_ss_micro_cache_reach_mem_limit.cpp b/mittest/shared_storage/test_ss_micro_cache_reach_mem_limit.cpp index 948edfff4..6452a4bc7 100644 --- a/mittest/shared_storage/test_ss_micro_cache_reach_mem_limit.cpp +++ b/mittest/shared_storage/test_ss_micro_cache_reach_mem_limit.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_ss_micro_cache_resize.cpp b/mittest/shared_storage/test_ss_micro_cache_resize.cpp index 99107a97a..de6a6e81c 100644 --- a/mittest/shared_storage/test_ss_micro_cache_resize.cpp +++ b/mittest/shared_storage/test_ss_micro_cache_resize.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST @@ -240,4 +244,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_ss_micro_cache_restart.cpp b/mittest/shared_storage/test_ss_micro_cache_restart.cpp index bf7298a20..5ba0975fa 100644 --- a/mittest/shared_storage/test_ss_micro_cache_restart.cpp +++ b/mittest/shared_storage/test_ss_micro_cache_restart.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_ss_micro_cache_stat.cpp b/mittest/shared_storage/test_ss_micro_cache_stat.cpp index b703e33e6..db8fa014f 100644 --- a/mittest/shared_storage/test_ss_micro_cache_stat.cpp +++ b/mittest/shared_storage/test_ss_micro_cache_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST @@ -346,4 +350,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_ss_micro_cache_struct.cpp b/mittest/shared_storage/test_ss_micro_cache_struct.cpp index 493868a14..4c4e6e759 100644 --- a/mittest/shared_storage/test_ss_micro_cache_struct.cpp +++ b/mittest/shared_storage/test_ss_micro_cache_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST @@ -821,4 +825,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_ss_micro_cache_util.cpp b/mittest/shared_storage/test_ss_micro_cache_util.cpp index 5e04dd816..a15e482bd 100644 --- a/mittest/shared_storage/test_ss_micro_cache_util.cpp +++ b/mittest/shared_storage/test_ss_micro_cache_util.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST @@ -313,4 +317,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_ss_micro_meta_manager.cpp b/mittest/shared_storage/test_ss_micro_meta_manager.cpp index beebb3195..7efacf4ad 100644 --- a/mittest/shared_storage/test_ss_micro_meta_manager.cpp +++ b/mittest/shared_storage/test_ss_micro_meta_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST @@ -1086,4 +1090,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_ss_persist_micro_data_task.cpp b/mittest/shared_storage/test_ss_persist_micro_data_task.cpp index c6e9db3db..21ad67b6f 100644 --- a/mittest/shared_storage/test_ss_persist_micro_data_task.cpp +++ b/mittest/shared_storage/test_ss_persist_micro_data_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST @@ -366,4 +370,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_ss_physical_block_manager.cpp b/mittest/shared_storage/test_ss_physical_block_manager.cpp index fba0764a7..d8fc91eee 100644 --- a/mittest/shared_storage/test_ss_physical_block_manager.cpp +++ b/mittest/shared_storage/test_ss_physical_block_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST @@ -1082,4 +1086,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_ss_preread_task.cpp b/mittest/shared_storage/test_ss_preread_task.cpp index 34ddfba28..4b531a033 100644 --- a/mittest/shared_storage/test_ss_preread_task.cpp +++ b/mittest/shared_storage/test_ss_preread_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_ss_reader_writer.cpp b/mittest/shared_storage/test_ss_reader_writer.cpp index 7457f80d4..12944986e 100644 --- a/mittest/shared_storage/test_ss_reader_writer.cpp +++ b/mittest/shared_storage/test_ss_reader_writer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/test_ss_reorganize_phy_block.cpp b/mittest/shared_storage/test_ss_reorganize_phy_block.cpp index 363e645d1..0d0e30aa8 100644 --- a/mittest/shared_storage/test_ss_reorganize_phy_block.cpp +++ b/mittest/shared_storage/test_ss_reorganize_phy_block.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef USING_LOG_PREFIX #define USING_LOG_PREFIX STORAGETEST @@ -597,4 +601,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/test_sstable_private_object_cleaner.cpp b/mittest/shared_storage/test_sstable_private_object_cleaner.cpp index a40c5f137..92b65b3ac 100644 --- a/mittest/shared_storage/test_sstable_private_object_cleaner.cpp +++ b/mittest/shared_storage/test_sstable_private_object_cleaner.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/shared_storage/tmp_file/test_ss_tmp_file.cpp b/mittest/shared_storage/tmp_file/test_ss_tmp_file.cpp index 6093a0f1a..14fe0d9bb 100644 --- a/mittest/shared_storage/tmp_file/test_ss_tmp_file.cpp +++ b/mittest/shared_storage/tmp_file/test_ss_tmp_file.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "mittest/mtlenv/storage/tmp_file/ob_tmp_file_test_helper.h" @@ -2475,4 +2479,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/shared_storage/tmp_file/test_ss_tmp_file_flush_task.cpp b/mittest/shared_storage/tmp_file/test_ss_tmp_file_flush_task.cpp index a5e1f8832..fc33ce9d2 100644 --- a/mittest/shared_storage/tmp_file/test_ss_tmp_file_flush_task.cpp +++ b/mittest/shared_storage/tmp_file/test_ss_tmp_file_flush_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGETEST diff --git a/mittest/shared_storage/tmp_file/test_ss_tmp_file_sub_module.cpp b/mittest/shared_storage/tmp_file/test_ss_tmp_file_sub_module.cpp index ea19b6c0b..ebe712044 100644 --- a/mittest/shared_storage/tmp_file/test_ss_tmp_file_sub_module.cpp +++ b/mittest/shared_storage/tmp_file/test_ss_tmp_file_sub_module.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "mittest/mtlenv/storage/tmp_file/ob_tmp_file_test_helper.h" diff --git a/mittest/simple_server/CMakeLists.txt b/mittest/simple_server/CMakeLists.txt index 89cc4f700..a34bc9568 100644 --- a/mittest/simple_server/CMakeLists.txt +++ b/mittest/simple_server/CMakeLists.txt @@ -73,6 +73,7 @@ ob_offline_observer(test_collect_mv mv/test_collect_mv.cpp) ob_unittest_observer(test_ls_recover test_ls_recover.cpp) ob_unittest_observer(test_ob_simple_cluster test_ob_simple_cluster.cpp) +ob_unittest_observer(test_ai_model_privilege test_ai_model_privilege.cpp) ob_unittest_observer(test_ob_partition_balance test_ob_partition_balance.cpp) ob_unittest_observer(test_mds_table_checkpoint test_mds_table_checkpoint.cpp) ob_unittest_observer(test_ob_black_list_service test_ob_black_list_service.cpp) @@ -107,6 +108,7 @@ ob_unittest_observer(test_callbacks_with_reverse_order test_callbacks_with_rever ob_unittest_observer(test_memtable_new_safe_to_destroy test_memtable_new_safe_to_destroy.cpp) ob_unittest_observer(test_tablet_to_ls_cache test_tablet_to_ls_cache.cpp) ob_unittest_observer(test_update_tablet_directly_when_mini test_update_tablet_directly_when_mini.cpp) +ob_unittest_observer(test_ai_service test_ai_service.cpp) ####### freeze case ####### #ob_freeze_observer(test_frequently_freeze freeze/test_frequently_freeze.cpp) diff --git a/mittest/simple_server/env/ob_simple_cluster_test_base.cpp b/mittest/simple_server/env/ob_simple_cluster_test_base.cpp index a9a352a4b..e37d1bbd5 100644 --- a/mittest/simple_server/env/ob_simple_cluster_test_base.cpp +++ b/mittest/simple_server/env/ob_simple_cluster_test_base.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_simple_cluster_test_base.h" @@ -57,7 +61,7 @@ void init_log_and_gtest(int argc, char **argv) void init_gtest_output(std::string >est_log_name) { - // 判断是否处于Farm中 + // Determine if it is within the Farm char *mit_network_start_port_env = getenv("mit_network_start_port"); char *mit_network_port_num_env = getenv("mit_network_port_num"); if (mit_network_start_port_env != nullptr && mit_network_port_num_env != nullptr) { diff --git a/mittest/simple_server/env/ob_simple_cluster_test_base.h b/mittest/simple_server/env/ob_simple_cluster_test_base.h index 89148d8ab..65eedc110 100644 --- a/mittest/simple_server/env/ob_simple_cluster_test_base.h +++ b/mittest/simple_server/env/ob_simple_cluster_test_base.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -29,7 +33,7 @@ class ObSimpleClusterTestBase : public testing::Test { public: static const int64_t TRANS_TIMEOUT = 5 * 1000 * 1000; - // set_bootstrap_and_create_tenant_warn_log 默认bootstrap和创建租户使用WARN日志,加速启动 + // set_bootstrap_and_create_tenant_warn_log default bootstrap and create tenant use WARN log, accelerate startup ObSimpleClusterTestBase(const std::string &env_prefix = "run_", const char *log_disk_size = "10G", const char *memory_limit = "16G", @@ -64,7 +68,7 @@ class ObSimpleClusterTestBase : public testing::Test static void TearDownTestCase(); protected: - // 因为ob_server.h 中ObServer的使用方式导致现在只能启动单台 + // Because the usage of ObServer in ob_server.h now only allows starting a single server static std::shared_ptr cluster_; static bool is_started_; static std::thread th_; diff --git a/mittest/simple_server/env/ob_simple_server.cpp b/mittest/simple_server/env/ob_simple_server.cpp index 83dd92723..75671023d 100644 --- a/mittest/simple_server/env/ob_simple_server.cpp +++ b/mittest/simple_server/env/ob_simple_server.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ @@ -184,7 +188,8 @@ int ObSimpleServer::simple_init() } } if (admin_dir != NULL) { - system(("cp ../admin/* admin/")); + system(("cp ../admin```cpp +/* admin/")); } std::string port_file_name = std::string("port.txt"); @@ -197,7 +202,7 @@ int ObSimpleServer::simple_init() fprintf(stdout, "rpc_port = %d mysql_port = %d\n", rpc_port_, rpc_port_+1); } - // 因为改变了工作目录,设置为绝对路径 + // Because the working directory has changed, set to absolute path for (int i=0;i 0) { @@ -344,7 +349,7 @@ int ObSimpleServer::bootstrap() ret = -66666666; SERVER_LOG(INFO, "observice is nullptr"); } else { - // observer内部有线程的检查, 这里在新建线程下调用会有问题 + // observer internal has thread check, calling here in a new thread will cause issues obrpc::ObServerInfo server_info; server_info.zone_ = "zone1"; server_info.server_ = common::ObAddr(common::ObAddr::IPV4, local_ip_.c_str(), rpc_port_); diff --git a/mittest/simple_server/env/ob_simple_server.h b/mittest/simple_server/env/ob_simple_server.h index 6b76ea95c..5f4e4f911 100644 --- a/mittest/simple_server/env/ob_simple_server.h +++ b/mittest/simple_server/env/ob_simple_server.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/mittest/simple_server/env/ob_simple_server_restart_helper.cpp b/mittest/simple_server/env/ob_simple_server_restart_helper.cpp index a30bcaf9f..cece22014 100644 --- a/mittest/simple_server/env/ob_simple_server_restart_helper.cpp +++ b/mittest/simple_server/env/ob_simple_server_restart_helper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/env/ob_simple_server_restart_helper.h b/mittest/simple_server/env/ob_simple_server_restart_helper.h index b2889528e..87e22537f 100644 --- a/mittest/simple_server/env/ob_simple_server_restart_helper.h +++ b/mittest/simple_server/env/ob_simple_server_restart_helper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/fast_commit_report.cpp b/mittest/simple_server/fast_commit_report.cpp index ec83a8f1b..25a915d30 100644 --- a/mittest/simple_server/fast_commit_report.cpp +++ b/mittest/simple_server/fast_commit_report.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/freeze/test_frequently_freeze.cpp b/mittest/simple_server/freeze/test_frequently_freeze.cpp index 2f6ab333e..d63694f8b 100644 --- a/mittest/simple_server/freeze/test_frequently_freeze.cpp +++ b/mittest/simple_server/freeze/test_frequently_freeze.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -251,15 +255,15 @@ TEST_F(TestFrequentlyFreeze, create_table) } /** - * 本case主要用于验证在超多Tablet且都存在少量写入的场景下触发频繁的冻结是否会有问题。 - * 主要的流程为: - * 1. 创建了三个具有4000个分区的表,分区方式是主键的hash - * 2. 每个表都插入了少量数据,按主键递增的方式插入,插入行数为分区数的5倍,尽量保证每个分区都有数据 - * 3. 启动了20个线程在插入数据的过程中执行tablet冻结,其中10个异步冻结,10个同步冻结。异步冻结会重复做10次,同步冻结只做了1次 - * 总共预计是会执行13万次Tablet级冻结。 - * 4. 启动了1个线程执行同步日志流冻结,每隔50秒一次,总计执行20次 - * 5. 启动了1个线程执行异步日志流冻结,每隔50秒一次,总结执行20次 - * 6. 最后确认ObFreezer中没有残留的待异步的冻结的分区 + * This case is mainly used to verify whether there will be any issues when frequent freezing is triggered in a scenario with a large number of Tablets and minor writes to each. + * The main process is as follows: + * 1. Created three tables with 4000 partitions each, using hash partitioning on the primary key. + * 2. Inserted a small amount of data into each table in ascending order of the primary key, with the number of inserted rows being five times the number of partitions, to ensure that each partition has data. + * 3. Started 20 threads to perform tablet freezing during the data insertion process, with 10 asynchronous freezes and 10 synchronous freezes. Asynchronous freezing was repeated 10 times, while synchronous freezing was done only once. + * A total of approximately 130,000 Tablet-level freezes are expected to be executed. + * 4. Started 1 thread to perform synchronous log stream freezing every 50 seconds, totaling 20 executions. + * 5. Started 1 thread to perform asynchronous log stream freezing every 50 seconds, totaling 20 executions. + * 6. Finally confirmed that there are no pending asynchronous freezing partitions left in ObFreezer. */ TEST_F(TestFrequentlyFreeze, frequently_freeze) { diff --git a/mittest/simple_server/freeze/test_ob_minor_freeze.cpp b/mittest/simple_server/freeze/test_ob_minor_freeze.cpp index 80b708498..18e1009f4 100644 --- a/mittest/simple_server/freeze/test_ob_minor_freeze.cpp +++ b/mittest/simple_server/freeze/test_ob_minor_freeze.cpp @@ -1,16 +1,20 @@ // owner: gengli.wzy // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -495,12 +499,12 @@ TEST_F(ObMinorFreezeTest, observer_start) TEST_F(ObMinorFreezeTest, add_tenant) { - // 创建普通租户tt1 + // Create normal tenant tt1 ASSERT_EQ(OB_SUCCESS, create_tenant("tt1")); - // 获取租户tt1的tenant_id + // Get the tenant_id of tenant tt1 ASSERT_EQ(OB_SUCCESS, get_tenant_id(RunCtx.tenant_id_)); ASSERT_NE(0, RunCtx.tenant_id_); - // 初始化普通租户tt1的sql proxy + // Initialize the sql proxy for normal tenant tt1 ASSERT_EQ(OB_SUCCESS, get_curr_simple_server().init_sql_proxy2()); } diff --git a/mittest/simple_server/mv/test_collect_mv.cpp b/mittest/simple_server/mv/test_collect_mv.cpp index 89fe5c649..28c608d04 100644 --- a/mittest/simple_server/mv/test_collect_mv.cpp +++ b/mittest/simple_server/mv/test_collect_mv.cpp @@ -1,16 +1,20 @@ // owner: lana.lgx // owner group: data -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -59,7 +63,7 @@ TestRunCtx R; class ObCollectMV : public ObSimpleClusterTestBase { public: - // 指定case运行目录前缀 test_ob_simple_cluster_ + // Specify the case run directory prefix test_ob_simple_cluster_ ObCollectMV() : ObSimpleClusterTestBase("test_collect_mv_", "20G", "20G") {} int wait_major_mv_refresh_finish(uint64_t scn); @@ -197,17 +201,16 @@ TEST_F(ObCollectMV, prepare) concurrency_control::ObMultiVersionGarbageCollector::GARBAGE_COLLECT_RECLAIM_DURATION = 3_s; LOGI("create tenant begin"); - // 创建普通租户tt1 + // Create normal tenant tt1 EQ(OB_SUCCESS, create_tenant("tt1", "12G", "16G", false, 10)); - // 获取租户tt1的tenant_id + // Get the tenant_id of tenant tt1 EQ(OB_SUCCESS, get_tenant_id(R.tenant_id_)); NE(0, R.tenant_id_); - // 初始化普通租户tt1的sql proxy + // Initialize the sql proxy for normal tenant tt1 EQ(OB_SUCCESS, get_curr_simple_server().init_sql_proxy2()); int tenant_id = R.tenant_id_; LOGI("create tenant finish"); - - // 在单节点ObServer下创建新的日志流, 注意避免被RS任务GC掉 + // Create a new log stream under a single-node ObServer, note to avoid being GCed by RS task EQ(0, SSH::create_ls(R.tenant_id_, get_curr_observer().self_addr_)); int64_t ls_count = 0; EQ(0, SSH::g_select_int64(R.tenant_id_, "select count(ls_id) as val from oceanbase.__all_ls where ls_id!=1", ls_count)); @@ -567,7 +570,7 @@ TEST_F(ObCollectMV, snapshot_gc) "select snapshot_scn val from oceanbase.__all_acquired_snapshot where tablet_id = %ld", base_tablet_id); EQ(0, SSH::select_int64(sql_proxy, sql_string.ptr(), snapshot_val)); - // 清除冗余的快照后,留下的应该是最小的快照 + // Clear the redundant snapshots, leaving only the smallest snapshot EQ(snapshot_scn_of_base_by_mv1, snapshot_val); LOGI("remove mview1"); @@ -587,7 +590,7 @@ TEST_F(ObCollectMV, snapshot_gc) "select count(*) val from oceanbase.__all_acquired_snapshot where tablet_id = %ld", base_tablet_id); EQ(0, SSH::select_int64(sql_proxy, sql_string.ptr(), cnt)); - // 基表的快照还不应该被回收掉 + // The snapshot of the base table should not be recycled yet EQ(1, cnt); LOGI("remove mview2 and mview3"); @@ -608,7 +611,7 @@ TEST_F(ObCollectMV, snapshot_gc) "select count(*) val from oceanbase.__all_acquired_snapshot where tablet_id = %ld", base_tablet_id); EQ(0, SSH::select_int64(sql_proxy, sql_string.ptr(), cnt)); - // 基表的快照应该被回收掉了 + // The snapshot of the base table should have been recycled EQ(0, cnt); LOGI("clean up"); diff --git a/mittest/simple_server/rewrite_function_for_test_big_tx_data.cpp b/mittest/simple_server/rewrite_function_for_test_big_tx_data.cpp index 4ca5cd5ce..2f688e295 100644 --- a/mittest/simple_server/rewrite_function_for_test_big_tx_data.cpp +++ b/mittest/simple_server/rewrite_function_for_test_big_tx_data.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "storage/tx_table/ob_tx_table_iterator.h" @@ -58,7 +62,7 @@ int ObTxTable::check_with_tx_data(ObReadTxDataArg &read_tx_data_arg, ObITxDataCh return ret; } /**************************************************************************************************/ - // 跳过读缓存 + // skip read cache /**************************************************************************************************/ // step 3 : read tx data in tx_ctx table and tx_data table @@ -96,8 +100,8 @@ int ObTxData::add_undo_action(ObTxTable *tx_table, STORAGE_LOG(WARN, "tx data table in tx table is nullptr.", KR(ret)); } else { /**************************************************************************************************/ - // 在测试big tx data的时候,连续挂很多无效的undo action上去,并且disable掉merge的逻辑 - // 可以节省测试时间,否则构建big tx data的耗时太长,没办法加到farm里 + // When testing big tx data, continuously attach many invalid undo actions and disable the merge logic + // Can save test time, otherwise building big tx data takes too long, can't be added to farm int loop_times = 10000; while (OB_SUCC(ret) && --loop_times) { ObUndoStatusNode *new_node = nullptr; diff --git a/mittest/simple_server/rootservice/test_add_remove_replace_arbitration_service.cpp b/mittest/simple_server/rootservice/test_add_remove_replace_arbitration_service.cpp index b4ba8440d..502f2859e 100644 --- a/mittest/simple_server/rootservice/test_add_remove_replace_arbitration_service.cpp +++ b/mittest/simple_server/rootservice/test_add_remove_replace_arbitration_service.cpp @@ -1,16 +1,20 @@ // owner: jingyu.cr // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE diff --git a/mittest/simple_server/rootservice/test_all_virtual_proxy_partition_info_default_value.cpp b/mittest/simple_server/rootservice/test_all_virtual_proxy_partition_info_default_value.cpp index 32ef60bb7..06e55ebda 100644 --- a/mittest/simple_server/rootservice/test_all_virtual_proxy_partition_info_default_value.cpp +++ b/mittest/simple_server/rootservice/test_all_virtual_proxy_partition_info_default_value.cpp @@ -1,16 +1,20 @@ // owner: wangzhennan.wzn // owner group: rs -/** - * Copyright (c) 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE diff --git a/mittest/simple_server/rootservice/test_arbitration_service_replica_task_table_operator.cpp b/mittest/simple_server/rootservice/test_arbitration_service_replica_task_table_operator.cpp index 26786b4c1..6d7c911da 100644 --- a/mittest/simple_server/rootservice/test_arbitration_service_replica_task_table_operator.cpp +++ b/mittest/simple_server/rootservice/test_arbitration_service_replica_task_table_operator.cpp @@ -1,16 +1,20 @@ // owner: jingyu.cr // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE diff --git a/mittest/simple_server/rootservice/test_arbitration_service_rpc.cpp b/mittest/simple_server/rootservice/test_arbitration_service_rpc.cpp index 0e302fb01..3b03b6348 100644 --- a/mittest/simple_server/rootservice/test_arbitration_service_rpc.cpp +++ b/mittest/simple_server/rootservice/test_arbitration_service_rpc.cpp @@ -1,16 +1,20 @@ // owner: jingyu.cr // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE diff --git a/mittest/simple_server/rootservice/test_arbitration_service_table_operator.cpp b/mittest/simple_server/rootservice/test_arbitration_service_table_operator.cpp index 23471d588..55d544930 100644 --- a/mittest/simple_server/rootservice/test_arbitration_service_table_operator.cpp +++ b/mittest/simple_server/rootservice/test_arbitration_service_table_operator.cpp @@ -1,16 +1,20 @@ // owner: jingyu.cr // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE diff --git a/mittest/simple_server/rootservice/test_change_arb_service_status.cpp b/mittest/simple_server/rootservice/test_change_arb_service_status.cpp index 7775fb05f..b09c93f9a 100644 --- a/mittest/simple_server/rootservice/test_change_arb_service_status.cpp +++ b/mittest/simple_server/rootservice/test_change_arb_service_status.cpp @@ -1,16 +1,20 @@ // owner: jingyu.cr // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE diff --git a/mittest/simple_server/rootservice/test_create_clone_tenant_resource_pool.cpp b/mittest/simple_server/rootservice/test_create_clone_tenant_resource_pool.cpp index 6e4fc3d73..1c5c0ed9a 100644 --- a/mittest/simple_server/rootservice/test_create_clone_tenant_resource_pool.cpp +++ b/mittest/simple_server/rootservice/test_create_clone_tenant_resource_pool.cpp @@ -1,16 +1,20 @@ // owner: jingyu.cr // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE diff --git a/mittest/simple_server/rootservice/test_create_tenant_compare.cpp b/mittest/simple_server/rootservice/test_create_tenant_compare.cpp index ad7cb70a5..a6066132b 100644 --- a/mittest/simple_server/rootservice/test_create_tenant_compare.cpp +++ b/mittest/simple_server/rootservice/test_create_tenant_compare.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RS @@ -130,7 +134,7 @@ Data2Compare parallel_data; #define TABLE_SQL "select * from oceanbase.%s where table_id < 500000 and schema_version < (select column_value from oceanbase.__all_core_table where column_name='baseline_schema_version') " #define ALL_TABLE_SQL TABLE_SQL "order by table_id" #define ALL_COLUMN_SQL TABLE_SQL "order by table_id, column_id" -// 只获取创建租户时的第一条operation记录,检查时忽略schema_version +// Only get the first operation record when creating a tenant, ignore schema_version when checking #define ALL_DDL_OPERATION_SQL "select * from oceanbase.%s where schema_version in " \ "(select min(schema_version) a from __all_table_history where table_id < 500000 group by table_id" \ " union "\ @@ -141,7 +145,7 @@ class ObCreateTenantCompareTest : public ObSimpleClusterTestBase { public: ObCreateTenantCompareTest() : ObSimpleClusterTestBase(TEST_NAME "_") {} - // 避免运行ObSimpleClusterTestBase里的SetUp和TearDown + // Avoid running SetUp and TearDown in ObSimpleClusterTestBase virtual void SetUp() {} virtual void TearDown() {} int start_observer(bool enable_parallel_tenant_creation = false); diff --git a/mittest/simple_server/rootservice/test_create_tenant_with_arbitration_service.cpp b/mittest/simple_server/rootservice/test_create_tenant_with_arbitration_service.cpp index d5871362d..fa7cf2ec0 100644 --- a/mittest/simple_server/rootservice/test_create_tenant_with_arbitration_service.cpp +++ b/mittest/simple_server/rootservice/test_create_tenant_with_arbitration_service.cpp @@ -1,16 +1,20 @@ // owner: jingyu.cr // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE diff --git a/mittest/simple_server/rootservice/test_dup_table_partition_balance.cpp b/mittest/simple_server/rootservice/test_dup_table_partition_balance.cpp index 037ae8c20..71c99c47c 100644 --- a/mittest/simple_server/rootservice/test_dup_table_partition_balance.cpp +++ b/mittest/simple_server/rootservice/test_dup_table_partition_balance.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/rootservice/test_get_stopped_zone_list.cpp b/mittest/simple_server/rootservice/test_get_stopped_zone_list.cpp index 7b74a7743..b7e2cc95b 100644 --- a/mittest/simple_server/rootservice/test_get_stopped_zone_list.cpp +++ b/mittest/simple_server/rootservice/test_get_stopped_zone_list.cpp @@ -1,16 +1,20 @@ // owner: linqiucen.lqc // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE #include @@ -94,4 +98,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/simple_server/rootservice/test_location_schema_refresh.cpp b/mittest/simple_server/rootservice/test_location_schema_refresh.cpp index 576a15aaf..709d506ac 100644 --- a/mittest/simple_server/rootservice/test_location_schema_refresh.cpp +++ b/mittest/simple_server/rootservice/test_location_schema_refresh.cpp @@ -1,16 +1,20 @@ // owner: cjl476581 -/** -* Copyright (c) 2023 OceanBase -* OceanBase CE is licensed under Mulan PubL v2. -* You can use this software according to the terms and conditions of the Mulan PubL v2. -* You may obtain a copy of Mulan PubL v2 at: -* http://license.coscl.org.cn/MulanPubL-2.0 -* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -* See the Mulan PubL v2 for more details. -*/ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #include #define USING_LOG_PREFIX SHARE diff --git a/mittest/simple_server/rootservice/test_location_service.cpp b/mittest/simple_server/rootservice/test_location_service.cpp index 1af7840fa..4a2d389f8 100644 --- a/mittest/simple_server/rootservice/test_location_service.cpp +++ b/mittest/simple_server/rootservice/test_location_service.cpp @@ -1,16 +1,20 @@ // owner: wangzhennan.wzn // owner group: rs -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/rootservice/test_ls_recovery_stat.cpp b/mittest/simple_server/rootservice/test_ls_recovery_stat.cpp index d7c0d9ed6..632e1325c 100644 --- a/mittest/simple_server/rootservice/test_ls_recovery_stat.cpp +++ b/mittest/simple_server/rootservice/test_ls_recovery_stat.cpp @@ -1,16 +1,20 @@ // owner: msy164651 // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RS @@ -44,16 +48,16 @@ TEST_F(TestLSRecoveryGuard, sys_recovery_guard) { int ret = OB_SUCCESS; { - //不init直接析构 + // Do not init directly destruct ObLSRecoveryGuard guard; } { - //init 系统租户,析构 + // init system tenant, destructor ObLSRecoveryGuard guard; ASSERT_EQ(OB_SUCCESS, guard.init(OB_SYS_TENANT_ID, SYS_LS)); } { - //init不存在的租户,或者日志流 + // init non-existent tenant, or log stream ObLSRecoveryGuard guard; ASSERT_EQ(OB_TENANT_NOT_IN_SERVER, guard.init(1002, SYS_LS)); } @@ -82,21 +86,21 @@ TEST_F(TestLSRecoveryGuard, user_recovery_guard) } { ObLSRecoveryGuard guard; - //加锁成功后,不在汇报,但是可以在统计 + // Lock acquisition successful, no longer report, but can be included in statistics ASSERT_EQ(OB_SUCCESS, guard.init(tenant_id_, SYS_LS, 300 * 1000)); - usleep(3000 * 1000);//sleep 300ms,应该设置成最新 + usleep(3000 * 1000);//sleep 300ms, should be set to the latest readable_scn = guard.ls_recovery_stat_->readable_scn_upper_limit_; - //内存中的scn还是可以推高的 + // The scn in memory can still be increased SCN readable_scn_memory = guard.ls_recovery_stat_->replicas_scn_.at(0).get_readable_scn(); config_version = guard.ls_recovery_stat_->config_version_in_inner_; ASSERT_EQ(1, guard.ls_recovery_stat_->ref_cnt_); ObLSRecoveryGuard guard1; - //不能加锁成功 + // Cannot acquire lock successfully ASSERT_EQ(OB_EAGAIN, guard1.init(tenant_id_, SYS_LS, 2 * 1000 * 1000)); ASSERT_EQ(OB_INIT_TWICE, guard.init(tenant_id_, SYS_LS)); ASSERT_EQ(1, guard.ls_recovery_stat_->ref_cnt_); ASSERT_EQ(OB_SUCCESS, guard.ls_recovery_stat_->reset_inner_readable_scn()); - usleep(3000 * 1000);//sleep 300ms,应该设置成最新 + usleep(3000 * 1000);//sleep 300ms, should be set to the latest ASSERT_EQ(readable_scn.get_val_for_sql(), guard.ls_recovery_stat_->readable_scn_upper_limit_.get_val_for_sql()); } diff --git a/mittest/simple_server/rootservice/test_ls_replica.cpp b/mittest/simple_server/rootservice/test_ls_replica.cpp index 377ee050b..86cccb687 100644 --- a/mittest/simple_server/rootservice/test_ls_replica.cpp +++ b/mittest/simple_server/rootservice/test_ls_replica.cpp @@ -1,16 +1,20 @@ // owner: jingyu.cr // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE diff --git a/mittest/simple_server/rootservice/test_ls_status_operator.cpp b/mittest/simple_server/rootservice/test_ls_status_operator.cpp index 2182b9fc5..0ec0b3dd9 100644 --- a/mittest/simple_server/rootservice/test_ls_status_operator.cpp +++ b/mittest/simple_server/rootservice/test_ls_status_operator.cpp @@ -1,16 +1,20 @@ // owner: msy164651 // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE @@ -52,7 +56,7 @@ TEST_F(TestLSStatusOperator, SQLProxy) sql.assign_fmt("select tenant_id, ls_id from oceanbase.__all_virtual_ls_status"); ASSERT_EQ(OB_SUCCESS, ret); SMART_VAR(ObMySQLProxy::MySQLResult, res) { - //mysql proxy 指定cluster_id报错,指定本集群也报错,不指定可以查询 + // mysql proxy specify cluster_id error, specify this cluster also error, not specify can query common::ObMySQLProxy &sql_proxy = get_curr_simple_server().get_sql_proxy2(); ret = sql_proxy.read(res, sql.ptr()); ASSERT_EQ(OB_SUCCESS, ret); @@ -62,9 +66,7 @@ TEST_F(TestLSStatusOperator, SQLProxy) ASSERT_EQ(OB_NOT_SUPPORTED, ret); ret = sql_proxy.read(res, OB_INVALID_CLUSTER_ID, OB_SYS_TENANT_ID, sql.ptr()); ASSERT_EQ(OB_NOT_SUPPORTED, ret); - - - //innser_sql不指定查询本集群,指定本集群查询本集群,指定非法报错 + //inner_sql does not specify to query this cluster, specifies this cluster to query this cluster, specifies illegal to report an error common::ObMySQLProxy &inner_proxy = get_curr_simple_server().get_observer().get_mysql_proxy(); ret = inner_proxy.read(res, sql.ptr()); ASSERT_EQ(OB_SUCCESS, ret); @@ -74,9 +76,7 @@ TEST_F(TestLSStatusOperator, SQLProxy) ASSERT_EQ(OB_SUCCESS, ret); ret = inner_proxy.read(res, OB_INVALID_CLUSTER_ID, OB_SYS_TENANT_ID, sql.ptr()); ASSERT_EQ(OB_INVALID_ARGUMENT, ret); - - - //trans不能指定远程集群,在mysql proxy开启的事务 + // trans cannot specify a remote cluster, in the transaction opened by mysql proxy ObMySQLTransaction trans; ret = trans.start(&sql_proxy, OB_SYS_TENANT_ID); ASSERT_EQ(OB_SUCCESS, ret); @@ -97,9 +97,7 @@ TEST_F(TestLSStatusOperator, SQLProxy) ret = trans12.read(res, OB_INVALID_CLUSTER_ID, OB_SYS_TENANT_ID, sql.ptr()); ASSERT_EQ(OB_NOT_SUPPORTED, ret); - - - //trans 在innser_sql上开启的事务 + // Start transaction on innser_sql ObMySQLTransaction trans2; ret = trans2.start(&inner_proxy, OB_SYS_TENANT_ID); ASSERT_EQ(OB_SUCCESS, ret); @@ -135,7 +133,7 @@ TEST_F(TestLSStatusOperator, LSLifeAgent) ObLSLifeAgentManager ls_life(get_curr_simple_server().get_observer().get_mysql_proxy()); ObLSStatusOperator status_operator; ObLSStatusInfoArray ls_array; - //非法参数检查 + // Illegal parameter check share::SCN create_scn; ObLSStatusInfo info; ObZone zone_priority("z1"); @@ -152,15 +150,13 @@ TEST_F(TestLSStatusOperator, LSLifeAgent) ret = ls_life.create_new_ls(info, create_scn, zone_priority.str(), share::NORMAL_SWITCHOVER_STATUS); ASSERT_EQ(OB_INVALID_ARGUMENT, ret); create_scn.set_min(); - - //创建新日志流 + // Create new log stream ObLSID ls_id(1002); ret = info.init(tenant_id_, ls_id, 0, share::OB_LS_CREATING, 0, primary_zone, flag); ASSERT_EQ(OB_SUCCESS, ret); ret = ls_life.create_new_ls(info, create_scn, zone_priority.str(), share::NORMAL_SWITCHOVER_STATUS); ASSERT_EQ(OB_SUCCESS, ret); - - //设置初始成员列表 + // Set initial member list ObMemberList member_list; ObMember arb_member; common::GlobalLearnerList learner_list; @@ -176,8 +172,7 @@ TEST_F(TestLSStatusOperator, LSLifeAgent) ret = status_operator.get_ls_init_member_list(tenant_id_, ls_id, new_list, new_status_info, get_curr_simple_server().get_observer().get_mysql_proxy(), arb_member, learner_list); ASSERT_EQ(OB_SUCCESS, ret); - - //创建新日志流 + // Create new log stream ObLSStatusInfo new_status_info2; ObLSID ls_id3(1003); ret = new_status_info2.init(tenant_id_, ls_id3, 0, share::OB_LS_CREATING, 0, primary_zone, flag); @@ -198,19 +193,16 @@ TEST_F(TestLSStatusOperator, LSLifeAgent) ret = status_operator.get_ls_init_member_list(tenant_id_, ls_id3, new_list2, new_status_info3, get_curr_simple_server().get_observer().get_mysql_proxy(), arb_member3, learner_list3); ASSERT_EQ(OB_SUCCESS, ret); - - //设置日志流offline的参数检查 + // Set the parameter check for offline log stream share::SCN invalid_scn; ret = ls_life.set_ls_offline(tenant_id_, SYS_LS, share::OB_LS_DROPPING, invalid_scn, share::NORMAL_SWITCHOVER_STATUS); ASSERT_EQ(OB_INVALID_ARGUMENT, ret); ret = ls_life.set_ls_offline(tenant_id_, SYS_LS, share::OB_LS_NORMAL, share::SCN::min_scn(), share::NORMAL_SWITCHOVER_STATUS); ASSERT_EQ(OB_INVALID_ARGUMENT, ret); - - //更新__all_ls_status表为空 + // Update __all_ls_status table to empty ret = ls_life.set_ls_offline(tenant_id_, ls_id, share::OB_LS_DROPPING, share::SCN::min_scn(), share::NORMAL_SWITCHOVER_STATUS); ASSERT_EQ(OB_NEED_RETRY, ret); - - //更新__all_ls_status表中1001日志流的状态 + // Update the status of log stream 1001 in the __all_ls_status table ret = status_operator.update_ls_status(tenant_id_, ls_id, share::OB_LS_EMPTY, share::OB_LS_DROPPING, share::NORMAL_SWITCHOVER_STATUS, get_curr_simple_server().get_observer().get_mysql_proxy()); ASSERT_EQ(OB_INVALID_ARGUMENT, ret); @@ -226,8 +218,7 @@ TEST_F(TestLSStatusOperator, LSLifeAgent) ASSERT_EQ(OB_SUCCESS, ret); ret = ls_life.set_ls_offline(tenant_id_, ls_id, share::OB_LS_NORMAL, share::SCN::min_scn(), share::NORMAL_SWITCHOVER_STATUS); ASSERT_EQ(OB_INVALID_ARGUMENT, ret); - - //更新成dropping状态,才可以set_offline + // Update to dropping state, then can set_offline ret = status_operator.update_ls_status(tenant_id_, ls_id, share::OB_LS_NORMAL, share::OB_LS_DROPPING, share::NORMAL_SWITCHOVER_STATUS, get_curr_simple_server().get_observer().get_mysql_proxy()); ASSERT_EQ(OB_SUCCESS, ret); @@ -237,8 +228,7 @@ TEST_F(TestLSStatusOperator, LSLifeAgent) scn.convert_for_logservice(100); ret = ls_life.set_ls_offline(tenant_id_, ls_id, share::OB_LS_DROPPING, scn, share::NORMAL_SWITCHOVER_STATUS); ASSERT_EQ(OB_SUCCESS, ret); - - //drop_ls,要等待sync等大于dropping + //drop_ls, need to wait for sync etc. to be greater than dropping ret = ls_life.drop_ls(tenant_id_, ls_id, share::NORMAL_SWITCHOVER_STATUS); ASSERT_EQ(OB_NEED_RETRY, ret); ObLSRecoveryStat recovery_stat; @@ -256,10 +246,10 @@ TEST_F(TestLSStatusOperator, LSLifeAgent) scn.convert_for_logservice(100); share::SCN recovery_scn; recovery_scn.convert_for_logservice(98); - //readable scn 大于sync_scn + // readable scn greater than sync_scn ret = recovery_stat.init_only_recovery_stat(tenant_id_, ls_id, scn, recovery_scn,config_version); ASSERT_EQ(OB_SUCCESS, ret); - //recovery_stat的取最大值 + //get the maximum value of recovery_stat ret = recovery_op.update_ls_recovery_stat(recovery_stat, false, get_curr_simple_server().get_observer().get_mysql_proxy()); ASSERT_EQ(OB_SUCCESS, ret); diff --git a/mittest/simple_server/rootservice/test_ob_admin_arg.cpp b/mittest/simple_server/rootservice/test_ob_admin_arg.cpp index ae473ebe0..9aad9d774 100644 --- a/mittest/simple_server/rootservice/test_ob_admin_arg.cpp +++ b/mittest/simple_server/rootservice/test_ob_admin_arg.cpp @@ -1,16 +1,20 @@ // owner: jingyu.cr // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE diff --git a/mittest/simple_server/rootservice/test_ob_parallel_migration_mode.cpp b/mittest/simple_server/rootservice/test_ob_parallel_migration_mode.cpp index 7d3f2bad1..6c2219d51 100644 --- a/mittest/simple_server/rootservice/test_ob_parallel_migration_mode.cpp +++ b/mittest/simple_server/rootservice/test_ob_parallel_migration_mode.cpp @@ -1,16 +1,20 @@ // owner: jinqian.zzy // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE @@ -183,4 +187,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/simple_server/rootservice/test_ob_tablet_to_ls_operator.cpp b/mittest/simple_server/rootservice/test_ob_tablet_to_ls_operator.cpp index 6bf99eb2f..bb96e3cf7 100644 --- a/mittest/simple_server/rootservice/test_ob_tablet_to_ls_operator.cpp +++ b/mittest/simple_server/rootservice/test_ob_tablet_to_ls_operator.cpp @@ -1,16 +1,20 @@ // owner: linqiucen.lqc // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE diff --git a/mittest/simple_server/rootservice/test_schema_service_sql_impl.cpp b/mittest/simple_server/rootservice/test_schema_service_sql_impl.cpp index e3f4b5d24..bb973e98f 100644 --- a/mittest/simple_server/rootservice/test_schema_service_sql_impl.cpp +++ b/mittest/simple_server/rootservice/test_schema_service_sql_impl.cpp @@ -1,16 +1,20 @@ // owner: wangzhennan.wzn // owner group: rs -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/rootservice/test_standby_balance_ls_group.cpp b/mittest/simple_server/rootservice/test_standby_balance_ls_group.cpp index e58622097..b1b946e67 100644 --- a/mittest/simple_server/rootservice/test_standby_balance_ls_group.cpp +++ b/mittest/simple_server/rootservice/test_standby_balance_ls_group.cpp @@ -1,16 +1,20 @@ // owner: msy164651 // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE @@ -70,7 +74,7 @@ TEST_F(TestStandbyBalance, BalanceLSGroup) ObSqlString sql; ASSERT_EQ(OB_SUCCESS, get_curr_simple_server().init_sql_proxy2("sys", "oceanbase")); common::ObMySQLProxy &sql_proxy = get_curr_simple_server().get_sql_proxy2(); - //2个unit group,四个日志流组 + //2 unit groups, four log stream groups uint64_t u1 = 1001; uint64_t u2 = 1002; ASSERT_EQ(OB_SUCCESS, sql.assign_fmt("insert into __all_unit(unit_id, unit_group_id, resource_pool_id, zone, svr_ip, svr_port, migrate_from_svr_ip, migrate_from_svr_port, status) values(%lu, %lu, 1, 'z1', '127.0.0.1', 2882, ' ', 0, 'ACTIVE')", u1, u1)); @@ -79,7 +83,7 @@ TEST_F(TestStandbyBalance, BalanceLSGroup) uint64_t lg1 = 1001, lg2 = 1002, lg3 = 1003, lg4 = 1004; int64_t ls1 = 1001, ls2 = 1002, ls3 = 1003, ls4 = 1004; - //4个日志流组都在一个ug上面 + //4 log stream groups are on one ug ASSERT_EQ(OB_SUCCESS, sql.assign_fmt("insert into __all_ls_status(tenant_id, ls_id, status, ls_group_id , unit_group_id, primary_zone) values(%ld, %lu, 'NORMAL', %lu, %lu, '%s')", tenant_id_, ls1, lg1, u1, z1.ptr())); ASSERT_EQ(OB_SUCCESS, sql_proxy.write(OB_SYS_TENANT_ID, sql.ptr(), affected_row)); ASSERT_EQ(1, affected_row); diff --git a/mittest/simple_server/rootservice/test_tenant_balance_operator.cpp b/mittest/simple_server/rootservice/test_tenant_balance_operator.cpp index 75b4f6ef5..90cd7196d 100644 --- a/mittest/simple_server/rootservice/test_tenant_balance_operator.cpp +++ b/mittest/simple_server/rootservice/test_tenant_balance_operator.cpp @@ -1,16 +1,20 @@ // owner: msy164651 // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE @@ -464,8 +468,7 @@ TEST_F(TestBalanceOperator, balance_execute) } } } - -//验证merge任务在transfer结束后再次设置part_list然后结束 +// Verify merge task sets part_list again after transfer ends and then finishes TEST_F(TestBalanceOperator, merge_task) { ObBalanceTask task; @@ -487,7 +490,7 @@ TEST_F(TestBalanceOperator, merge_task) task_type = ObString("LS_MERGE"); task_status = ObString("TRANSFER"); ObString comment; - //防止后台线程结束这个任务 + // Prevent the background thread from ending this task ASSERT_EQ(OB_SUCCESS, parent_list.push_back(task_id)); ASSERT_EQ(OB_SUCCESS, task.init( tenant_id, job_id, task_id, @@ -498,7 +501,7 @@ TEST_F(TestBalanceOperator, merge_task) parent_list, child_list, comment)); common::ObMySQLProxy &sql_proxy = get_curr_simple_server().get_sql_proxy2(); ASSERT_EQ(OB_SUCCESS, ObBalanceTaskTableOperator::insert_new_task(task, sql_proxy)); - //设置part_list + // Set part_list ObTransferPartInfo part_info(50001, 50001); ASSERT_EQ(OB_SUCCESS, part_list.push_back(part_info)); transfer_task_id = ObTransferTaskID(1); diff --git a/mittest/simple_server/rootservice/test_tenant_transfer_service.cpp b/mittest/simple_server/rootservice/test_tenant_transfer_service.cpp index 8effff22f..02d400965 100644 --- a/mittest/simple_server/rootservice/test_tenant_transfer_service.cpp +++ b/mittest/simple_server/rootservice/test_tenant_transfer_service.cpp @@ -1,16 +1,20 @@ // owner: wangzhennan.wzn // owner group: rs -/** - * Copyright (c) 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/rootservice/test_transfer_partition_task.cpp b/mittest/simple_server/rootservice/test_transfer_partition_task.cpp index 322a0dc37..34a87c217 100644 --- a/mittest/simple_server/rootservice/test_transfer_partition_task.cpp +++ b/mittest/simple_server/rootservice/test_transfer_partition_task.cpp @@ -1,16 +1,20 @@ // owner: msy164651 // owner group: rs -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE @@ -62,8 +66,8 @@ TEST_F(TestTransferPartition, TransferPartitionTask) ObTransferPartitionTaskStatus status(ObTransferPartitionTaskStatus::TRP_TASK_STATUS_WAITING); ObTransferPartitionTaskStatus invalid_status; ObString comment; - // case 1: 验证task的init - //simple_init不校验task_id,但是init校验 + // case 1: validate task's init + // simple_init does not validate task_id, but init does validate ASSERT_EQ(OB_INVALID_ARGUMENT, task.simple_init(tenant_id_, invalid_part, ls, task_id)); ASSERT_EQ(OB_INVALID_ARGUMENT, task.simple_init(tenant_id_, part_info, invalid_ls, task_id)); ASSERT_EQ(OB_SUCCESS, task.simple_init(tenant_id_, part_info, ls, invalid_task_id)); @@ -74,7 +78,7 @@ TEST_F(TestTransferPartition, TransferPartitionTask) job_id, ObTransferTaskID(1), invalid_status, comment)); ASSERT_EQ(OB_SUCCESS, task.init(tenant_id_, part_info, ls, task_id, job_id, ObTransferTaskID(1), status, comment)); - // case 2: 验证task的插入 + // case 2: validate task insertion ObMySQLTransaction trans; ObArray task_array; ASSERT_EQ(OB_SUCCESS, trans.start(&sql_proxy, tenant_id_)); @@ -86,8 +90,7 @@ TEST_F(TestTransferPartition, TransferPartitionTask) ASSERT_EQ(1, task_array.count()); LOG_INFO("[MITTEST]new task", K(task_array)); ASSERT_EQ(status, task_array.at(0).get_task_status()); - - // case 3: 验证不同的事务,在第一个事务没有提交之前,另外一个事务不能写入 + // case 3: validate different transactions, another transaction cannot write before the first transaction is committed ASSERT_EQ(OB_SUCCESS, trans.start(&sql_proxy, tenant_id_)); ObTransferPartitionTask new_task; ObTransferPartInfo part_info2(1, 2); @@ -109,12 +112,11 @@ TEST_F(TestTransferPartition, TransferPartitionTask) ASSERT_EQ(3, task_array.count()); LOG_INFO("[MITTEST]new task", K(task_array)); ASSERT_EQ(OB_SUCCESS, trans1.end(true)); - // case 4: 验证table_id,object_id不能重复 + // case 4: validate that table_id, object_id cannot be duplicated ASSERT_EQ(OB_SUCCESS, trans.start(&sql_proxy, tenant_id_)); ASSERT_EQ(OB_ERR_PRIMARY_KEY_DUPLICATE, ObTransferPartitionTaskTableOperator::insert_new_task(tenant_id_, part_info, ls, trans)); ASSERT_EQ(OB_SUCCESS, trans.end(false)); - - // case 5: 验证使用第一个task_id开始执行 + // case 5: validate starting execution with the first task_id ObTransferPartitionTaskID task_id2 = task_array.at(1).get_task_id(); ASSERT_EQ(OB_SUCCESS, trans.start(&sql_proxy, tenant_id_)); ASSERT_EQ(OB_ERR_UNEXPECTED, ObTransferPartitionTaskTableOperator::set_all_tasks_schedule( @@ -131,8 +133,7 @@ TEST_F(TestTransferPartition, TransferPartitionTask) ASSERT_EQ(1, task_array.at(0).get_balance_job_id().id()); ASSERT_EQ(1, task_array.at(1).get_balance_job_id().id()); ASSERT_EQ(-1, task_array.at(2).get_balance_job_id().id()); - - //case 6: 开始transfer,三个分区放进去会不匹配 + //case 6: start transfer, three partitions going in will not match ObTransferPartList part_list; ASSERT_EQ(OB_SUCCESS, part_list.push_back(part_info)); ASSERT_EQ(OB_SUCCESS, part_list.push_back(part_info2)); @@ -167,8 +168,7 @@ TEST_F(TestTransferPartition, TransferPartitionTask) ASSERT_EQ(100, task_array.at(0).get_transfer_task_id().id()); ASSERT_EQ(100, task_array.at(1).get_transfer_task_id().id()); ASSERT_EQ(-1, task_array.at(2).get_transfer_task_id().id()); - - //case 7: 结束transfer + //case 7: end transfer ASSERT_EQ(OB_SUCCESS, part_list.remove(0)); ASSERT_EQ(OB_SUCCESS, part_list.push_back(part_info2)); ASSERT_EQ(OB_SUCCESS, trans.start(&sql_proxy, tenant_id_)); @@ -203,8 +203,7 @@ TEST_F(TestTransferPartition, TransferPartitionTask) LOG_INFO("[MITTEST]balance_task", K(start_time), K(finish_time), K(new_task3)); } - - //case 8: 验证rollback + //case 8: validate rollback ASSERT_EQ(OB_SUCCESS, trans.start(&sql_proxy, tenant_id_)); ASSERT_EQ(OB_INVALID_ARGUMENT, ObTransferPartitionTaskTableOperator::rollback_all_to_waitting( tenant_id_, ObBalanceJobID(), trans)); diff --git a/mittest/simple_server/rootservice/test_transfer_task_operator.cpp b/mittest/simple_server/rootservice/test_transfer_task_operator.cpp index a90fd5af2..3bb823010 100644 --- a/mittest/simple_server/rootservice/test_transfer_task_operator.cpp +++ b/mittest/simple_server/rootservice/test_transfer_task_operator.cpp @@ -1,16 +1,20 @@ // owner: wangzhennan.wzn // owner group: rs -/** - * Copyright (c) 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SHARE diff --git a/mittest/simple_server/test_ai_model_privilege.cpp b/mittest/simple_server/test_ai_model_privilege.cpp new file mode 100644 index 000000000..f890e9488 --- /dev/null +++ b/mittest/simple_server/test_ai_model_privilege.cpp @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ + +#include +#define USING_LOG_PREFIX SERVER +#define protected public +#define private public + +#include "env/ob_simple_cluster_test_base.h" +#include "sql/privilege_check/ob_ai_model_priv_util.h" +#include "sql/resolver/ob_schema_checker.h" +#include "share/schema/ob_schema_getter_guard.h" +#include "share/schema/ob_schema_struct.h" +#include "sql/session/ob_sql_session_info.h" + +namespace oceanbase +{ +namespace unittest +{ + +using namespace oceanbase::transaction; +using namespace oceanbase::storage; +using namespace oceanbase::sql; + +class TestRunCtx +{ +public: + uint64_t tenant_id_ = 0; + int64_t time_sec_ = 0; +}; + +TestRunCtx RunCtx; + +class TestAIServiceEndpointPrivilege : public ObSimpleClusterTestBase +{ +public: + TestAIServiceEndpointPrivilege() : ObSimpleClusterTestBase("test_ai_model_privilege_") {} +}; + +TEST_F(TestAIServiceEndpointPrivilege, test_ai_model_privilege) +{ + int ret = OB_SUCCESS; + SERVER_LOG(INFO, "test_ai_model_privilege start"); + + ASSERT_EQ(OB_SUCCESS, create_tenant()); + ASSERT_EQ(OB_SUCCESS, get_tenant_id(RunCtx.tenant_id_)); + ASSERT_NE(0, RunCtx.tenant_id_); + ASSERT_EQ(OB_SUCCESS, get_curr_simple_server().init_sql_proxy2()); + + common::ObMySQLProxy &sql_proxy = get_curr_simple_server().get_sql_proxy2(); + + { + OB_LOG(INFO, "create test user start"); + ObSqlString sql; + sql.assign_fmt("CREATE USER test_ai_user@'%%' IDENTIFIED BY '123456'"); + int64_t affected_rows = 0; + ASSERT_EQ(OB_SUCCESS, sql_proxy.write(sql.ptr(), affected_rows)); + OB_LOG(INFO, "create test user succ"); + } + + { + OB_LOG(INFO, "check initial privileges start"); + ObSqlString sql; + sql.assign_fmt("SHOW GRANTS FOR test_ai_user@'%%'"); + SMART_VAR(ObMySQLProxy::MySQLResult, res) { + ASSERT_EQ(OB_SUCCESS, sql_proxy.read(res, sql.ptr())); + sqlclient::ObMySQLResult *result = res.get_result(); + ASSERT_NE(nullptr, result); + ASSERT_EQ(OB_SUCCESS, result->next()); + ObString grants; + ASSERT_EQ(OB_SUCCESS, result->get_varchar("Grants for test_ai_user@%", grants)); + OB_LOG(INFO, "initial grants", K(grants)); + } + OB_LOG(INFO, "check initial privileges succ"); + } + + { + OB_LOG(INFO, "grant AI MODEL privileges start"); + ObSqlString sql; + sql.assign_fmt("GRANT CREATE AI MODEL ON *.* TO test_ai_user@'%%'"); + int64_t affected_rows = 0; + ASSERT_EQ(OB_SUCCESS, sql_proxy.write(sql.ptr(), affected_rows)); + + sql.reset(); + sql.assign_fmt("GRANT ALTER AI MODEL ON *.* TO test_ai_user@'%%'"); + ASSERT_EQ(OB_SUCCESS, sql_proxy.write(sql.ptr(), affected_rows)); + + sql.reset(); + sql.assign_fmt("GRANT DROP AI MODEL ON *.* TO test_ai_user@'%%'"); + ASSERT_EQ(OB_SUCCESS, sql_proxy.write(sql.ptr(), affected_rows)); + + sql.reset(); + sql.assign_fmt("GRANT ACCESS AI MODEL ON *.* TO test_ai_user@'%%'"); + ASSERT_EQ(OB_SUCCESS, sql_proxy.write(sql.ptr(), affected_rows)); + + OB_LOG(INFO, "grant AI MODEL privileges succ"); + } + + { + OB_LOG(INFO, "verify granted privileges start"); + ObSqlString sql; + sql.assign_fmt("SHOW GRANTS FOR test_ai_user@'%%'"); + SMART_VAR(ObMySQLProxy::MySQLResult, res) { + ASSERT_EQ(OB_SUCCESS, sql_proxy.read(res, sql.ptr())); + sqlclient::ObMySQLResult *result = res.get_result(); + ASSERT_NE(nullptr, result); + ASSERT_EQ(OB_SUCCESS, result->next()); + ObString grants; + ASSERT_EQ(OB_SUCCESS, result->get_varchar("Grants for test_ai_user@%", grants)); + OB_LOG(INFO, "granted privileges", K(grants)); + + ObString grants_str(grants); + ASSERT_TRUE(grants_str.prefix_match("GRANT CREATE AI MODEL, ALTER AI MODEL, DROP AI MODEL, ACCESS AI MODEL ON *.* TO 'test_ai_user'")); + } + OB_LOG(INFO, "verify granted privileges succ"); + } + + { + OB_LOG(INFO, "test privilege check functions start"); + + observer::ObServer& observer = get_curr_observer(); + + share::schema::ObSchemaGetterGuard schema_guard; + ASSERT_EQ(OB_SUCCESS, observer.get_schema_service().get_tenant_schema_guard(RunCtx.tenant_id_, schema_guard)); + + const share::schema::ObUserInfo *user_info = nullptr; + ASSERT_EQ(OB_SUCCESS, schema_guard.get_user_info(RunCtx.tenant_id_, "test_ai_user", "%", user_info)); + ASSERT_NE(nullptr, user_info); + + share::schema::ObSessionPrivInfo session_priv; + session_priv.tenant_id_ = RunCtx.tenant_id_; + session_priv.user_id_ = user_info->get_user_id(); + session_priv.user_name_ = user_info->get_user_name_str(); + session_priv.host_name_ = user_info->get_host_name_str(); + session_priv.user_priv_set_ = user_info->get_priv_set(); + common::ObArenaAllocator allocator; + + ObAIServiceEndpointPrivUtil priv_util(schema_guard); + + bool has_priv = false; + + ASSERT_EQ(OB_SUCCESS, priv_util.check_create_ai_model_priv( + allocator, session_priv, has_priv)); + ASSERT_TRUE(has_priv); + OB_LOG(INFO, "CREATE AI MODEL privilege check passed"); + + ASSERT_EQ(OB_SUCCESS, priv_util.check_alter_ai_model_priv( + allocator, session_priv, has_priv)); + ASSERT_TRUE(has_priv); + OB_LOG(INFO, "ALTER AI MODEL privilege check passed"); + + ASSERT_EQ(OB_SUCCESS, priv_util.check_drop_ai_model_priv( + allocator, session_priv, has_priv)); + ASSERT_TRUE(has_priv); + OB_LOG(INFO, "DROP AI MODEL privilege check passed"); + + ASSERT_EQ(OB_SUCCESS, priv_util.check_access_ai_model_priv( + allocator, session_priv, has_priv)); + ASSERT_TRUE(has_priv); + OB_LOG(INFO, "ACCESS AI MODEL privilege check passed"); + + OB_LOG(INFO, "test privilege check functions succ"); + } + + { + OB_LOG(INFO, "revoke partial privileges start"); + ObSqlString sql; + sql.assign_fmt("REVOKE ALTER AI MODEL ON *.* FROM test_ai_user@'%%'"); + int64_t affected_rows = 0; + ASSERT_EQ(OB_SUCCESS, sql_proxy.write(sql.ptr(), affected_rows)); + + sql.reset(); + sql.assign_fmt("REVOKE DROP AI MODEL ON *.* FROM test_ai_user@'%%'"); + ASSERT_EQ(OB_SUCCESS, sql_proxy.write(sql.ptr(), affected_rows)); + + OB_LOG(INFO, "revoke partial privileges succ"); + } + + { + OB_LOG(INFO, "verify revoked privileges start"); + ObSqlString sql; + sql.assign_fmt("SHOW GRANTS FOR test_ai_user@'%%'"); + SMART_VAR(ObMySQLProxy::MySQLResult, res) { + ASSERT_EQ(OB_SUCCESS, sql_proxy.read(res, sql.ptr())); + sqlclient::ObMySQLResult *result = res.get_result(); + ASSERT_NE(nullptr, result); + ASSERT_EQ(OB_SUCCESS, result->next()); + ObString grants; + ASSERT_EQ(OB_SUCCESS, result->get_varchar("Grants for test_ai_user@%", grants)); + OB_LOG(INFO, "remaining privileges after revoke", K(grants)); + + ObString grants_str(grants); + ASSERT_TRUE(grants_str.prefix_match("GRANT CREATE AI MODEL, ACCESS AI MODEL ON *.* TO 'test_ai_user'")); + } + OB_LOG(INFO, "verify revoked privileges succ"); + } + + { + OB_LOG(INFO, "test privilege check functions after revoke start"); + observer::ObServer& observer = get_curr_observer(); + + share::schema::ObSchemaGetterGuard schema_guard; + ASSERT_EQ(OB_SUCCESS, observer.get_schema_service().get_tenant_schema_guard(RunCtx.tenant_id_, schema_guard)); + + const share::schema::ObUserInfo *user_info = nullptr; + ASSERT_EQ(OB_SUCCESS, schema_guard.get_user_info(RunCtx.tenant_id_, "test_ai_user", "%", user_info)); + ASSERT_NE(nullptr, user_info); + + share::schema::ObSessionPrivInfo session_priv; + session_priv.tenant_id_ = RunCtx.tenant_id_; + session_priv.user_id_ = user_info->get_user_id(); + session_priv.user_name_ = user_info->get_user_name_str(); + session_priv.host_name_ = user_info->get_host_name_str(); + session_priv.user_priv_set_ = user_info->get_priv_set(); + + common::ObArenaAllocator allocator; + + ObAIServiceEndpointPrivUtil priv_util(schema_guard); + + bool has_priv = false; + + ASSERT_EQ(OB_SUCCESS, priv_util.check_create_ai_model_priv( + allocator, session_priv, has_priv)); + ASSERT_TRUE(has_priv); + OB_LOG(INFO, "CREATE AI MODEL privilege check passed after revoke"); + + ASSERT_EQ(OB_SUCCESS, priv_util.check_alter_ai_model_priv( + allocator, session_priv, has_priv)); + OB_LOG(INFO, "ALTER AI MODEL privilege check result", K(has_priv), K(session_priv.user_priv_set_)); + ASSERT_FALSE(has_priv); + OB_LOG(INFO, "ALTER AI MODEL privilege check failed as expected after revoke"); + + ASSERT_EQ(OB_SUCCESS, priv_util.check_drop_ai_model_priv( + allocator, session_priv, has_priv)); + OB_LOG(INFO, "DROP AI MODEL privilege check result", K(has_priv), K(session_priv.user_priv_set_)); + ASSERT_FALSE(has_priv); + OB_LOG(INFO, "DROP AI MODEL privilege check failed as expected after revoke"); + + ASSERT_EQ(OB_SUCCESS, priv_util.check_access_ai_model_priv( + allocator, session_priv, has_priv)); + ASSERT_TRUE(has_priv); + OB_LOG(INFO, "ACCESS AI MODEL privilege check passed after revoke"); + + OB_LOG(INFO, "test privilege check functions after revoke succ"); + } + + { + OB_LOG(INFO, "cleanup test user start"); + ObSqlString sql; + sql.assign_fmt("DROP USER test_ai_user@'%%'"); + int64_t affected_rows = 0; + ASSERT_EQ(OB_SUCCESS, sql_proxy.write(sql.ptr(), affected_rows)); + OB_LOG(INFO, "cleanup test user succ"); + } + + SERVER_LOG(INFO, "test_ai_model_privilege end"); +} + +TEST_F(TestAIServiceEndpointPrivilege, end) +{ + // if (RunCtx.time_sec_ > 0) { + // ::sleep(RunCtx.time_sec_); + // } +} + +} // end unittest +} // end oceanbase + + +int main(int argc, char **argv) +{ + int64_t c = 0; + int64_t time_sec = 0; + char *log_level = (char*)"INFO"; + while(EOF != (c = getopt(argc,argv,"t:l:"))) { + switch(c) { + case 't': + time_sec = atoi(optarg); + break; + case 'l': + log_level = optarg; + oceanbase::unittest::ObSimpleClusterTestBase::enable_env_warn_log_ = false; + break; + default: + break; + } + } + oceanbase::unittest::init_log_and_gtest(argc, argv); + OB_LOGGER.set_log_level(log_level); + + LOG_INFO("main>>>"); + oceanbase::unittest::RunCtx.time_sec_ = time_sec; + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/mittest/simple_server/test_ai_service.cpp b/mittest/simple_server/test_ai_service.cpp new file mode 100644 index 000000000..783c95f0d --- /dev/null +++ b/mittest/simple_server/test_ai_service.cpp @@ -0,0 +1,295 @@ +// owner: shenyunlong.syl +// owner group: shenzhen + +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ + +#include +#define USING_LOG_PREFIX SERVER_OMT +#define protected public +#define private public + +#include "env/ob_simple_cluster_test_base.h" +#include "observer/omt/ob_tenant_ai_service.h" +#include "share/schema/ob_tenant_schema_service.h" + +using namespace oceanbase::observer; +using namespace oceanbase::share; +using namespace oceanbase::omt; +using namespace oceanbase::common; + +namespace oceanbase +{ +namespace unittest +{ +class TestRunCtx +{ +public: + uint64_t tenant_id_ = 0; + int time_sec_ = 0; +}; + +TestRunCtx RunCtx; + +class TestAiService: public ObSimpleClusterTestBase +{ +public: + TestAiService() : ObSimpleClusterTestBase("test_ai_service") {} + virtual ~TestAiService() {} + void SetUp() override + { + ObSimpleClusterTestBase::SetUp(); + } +private: + DISALLOW_COPY_AND_ASSIGN(TestAiService); +}; + +void check_ai_model_endpoint(ObAiModelEndpointInfo &endpoint_info, + ObArenaAllocator &allocator, + ObString &endpoint_name, + ObString &ai_model_name, + ObString &url, + ObString &access_key, + ObString &provider, + ObString &request_model_name, + ObString ¶meters, + ObString &request_transform_fn, + ObString &response_transform_fn) +{ + ASSERT_EQ(endpoint_name, endpoint_info.get_name()); + ASSERT_EQ(ai_model_name, endpoint_info.get_ai_model_name()); + ASSERT_EQ(url, endpoint_info.get_url()); + ASSERT_NE(access_key, endpoint_info.get_encrypted_access_key()); + ObString unencrypted_access_key; + ASSERT_EQ(OB_SUCCESS, endpoint_info.get_unencrypted_access_key(allocator, unencrypted_access_key)); + ASSERT_EQ(access_key, unencrypted_access_key); + ASSERT_EQ(provider, endpoint_info.get_provider()); + ASSERT_EQ(request_model_name, endpoint_info.get_request_model_name()); + ASSERT_EQ(parameters, endpoint_info.get_parameters()); + ASSERT_EQ(request_transform_fn, endpoint_info.get_request_transform_fn()); + ASSERT_EQ(response_transform_fn, endpoint_info.get_response_transform_fn()); +} + +TEST_F(TestAiService, test_ai_model_endpoint) +{ + share::ObTenantSwitchGuard tenant_guard; + ASSERT_EQ(OB_SUCCESS, tenant_guard.switch_to(OB_SYS_TENANT_ID)); + ObTenantAiService *ai_service = MTL(ObTenantAiService*); + ObAiServiceGuard ai_service_guard; + ObAiModelEndpointInfo *endpoint_info = nullptr; + + ObString endpoint_name = "test_endpoint"; + ObString ai_model_name = "test_ai_model"; + ObString url = "http://license.coscl.org.cn/MulanPubL-2.0"; + ObString access_key = "sk-1234455"; + ObString provider = "aliyun-openai"; + ObString request_model_name = "text-embedding-v2-custom-model"; + ObString parameters = ""; + ObString request_transform_fn = ""; + ObString response_transform_fn = ""; + common::ObArenaAllocator allocator; + ObSqlString sql; + + // 1. create ai model endpoint + std::string json_str = R"({"url": ")"; + json_str += url.ptr(); + json_str += R"(", "access_key": ")"; + json_str += access_key.ptr(); + json_str += R"(", "ai_model_name": ")"; + json_str += ai_model_name.ptr(); + json_str += R"(", "provider": ")"; + json_str += provider.ptr(); + json_str += R"(", "request_model_name": ")"; + json_str += request_model_name.ptr(); + json_str += R"(", "parameters": ")"; + json_str += parameters.ptr(); + json_str += R"(", "request_transform_fn": ")"; + json_str += request_transform_fn.ptr(); + json_str += R"(", "response_transform_fn": ")"; + json_str += response_transform_fn.ptr(); + json_str += R"("})"; + sql.assign_fmt("call DBMS_AI_SERVICE.CREATE_AI_MODEL_ENDPOINT ('%s', '%s')", endpoint_name.ptr(), json_str.c_str()); + int64_t affected_rows = 0; + common::ObMySQLProxy &sql_proxy = get_curr_simple_server().get_sql_proxy(); + ASSERT_EQ(OB_SUCCESS, sql_proxy.write(sql.ptr(), affected_rows)); + + // 2. get ai model endpoint by endpoint name + ASSERT_EQ(OB_SUCCESS, ai_service->get_ai_service_guard(ai_service_guard)); + ASSERT_EQ(OB_SUCCESS, ai_service_guard.get_ai_endpoint(endpoint_name, endpoint_info)); + ASSERT_TRUE(endpoint_info != nullptr); + check_ai_model_endpoint(*endpoint_info, allocator, endpoint_name, ai_model_name, url, access_key, + provider, request_model_name, parameters, request_transform_fn, response_transform_fn); + + // 3. get ai model endpoint by ai model name + endpoint_info = nullptr; + ASSERT_EQ(OB_SUCCESS, ai_service_guard.get_ai_endpoint_by_ai_model_name(ai_model_name, endpoint_info)); + ASSERT_TRUE(endpoint_info != nullptr); + check_ai_model_endpoint(*endpoint_info, allocator, endpoint_name, ai_model_name, url, access_key, + provider, request_model_name, parameters, request_transform_fn, response_transform_fn); + + // 3. alter ai model endpoint + access_key = "my_new_access_key_1234567890"; + provider = "openai"; + + json_str = R"({"access_key": ")"; + json_str += access_key.ptr(); + json_str += R"(", "provider": ")"; + json_str += provider.ptr(); + json_str += R"(", "request_transform_fn": ")"; + json_str += request_transform_fn.ptr(); + json_str += R"(", "response_transform_fn": ")"; + json_str += response_transform_fn.ptr(); + json_str += R"("})"; + + sql.assign_fmt("call DBMS_AI_SERVICE.ALTER_AI_MODEL_ENDPOINT ('test_endpoint', '%s')", json_str.c_str()); + ASSERT_EQ(OB_SUCCESS, sql_proxy.write(sql.ptr(), affected_rows)); + + // 4. get ai model endpoint by endpoint name after alter ai model endpoint + endpoint_info = nullptr; + ASSERT_EQ(OB_SUCCESS, ai_service_guard.get_ai_endpoint(endpoint_name, endpoint_info)); + ASSERT_TRUE(endpoint_info != nullptr); + check_ai_model_endpoint(*endpoint_info, allocator, endpoint_name, ai_model_name, url, access_key, + provider, request_model_name, parameters, request_transform_fn, response_transform_fn); + + // 5. get ai model endpoint by ai model name after alter ai model endpoint + endpoint_info = nullptr; + ASSERT_EQ(OB_SUCCESS, ai_service_guard.get_ai_endpoint_by_ai_model_name(ai_model_name, endpoint_info)); + ASSERT_TRUE(endpoint_info != nullptr); + check_ai_model_endpoint(*endpoint_info, allocator, endpoint_name, ai_model_name, url, access_key, + provider, request_model_name, parameters, request_transform_fn, response_transform_fn); + + // 6. get ai model endpoint by non-exist ai model point + ASSERT_EQ(OB_AI_FUNC_ENDPOINT_NOT_FOUND, ai_service_guard.get_ai_endpoint("test_endpoint2", endpoint_info)); + + // 7. drop ai model endpoint + sql.assign("call DBMS_AI_SERVICE.DROP_AI_MODEL_ENDPOINT ('test_endpoint')"); + ASSERT_EQ(OB_SUCCESS, sql_proxy.write(sql.ptr(), affected_rows)); + ASSERT_EQ(OB_AI_FUNC_ENDPOINT_NOT_FOUND, ai_service_guard.get_ai_endpoint("test_endpoint", endpoint_info)); +} + +TEST_F(TestAiService, test_get_increment_ai_model_keys_reversely) +{ + const uint64_t tenant_id = OB_SYS_TENANT_ID; + share::ObTenantSwitchGuard tenant_guard; + ASSERT_EQ(OB_SUCCESS, tenant_guard.switch_to(tenant_id)); + + ObSchemaGetterGuard schema_guard; + const ObSchemaMgr *schema_mgr = nullptr; + int64_t curr_version = OB_INVALID_VERSION; + ObRefreshSchemaStatus schema_status; + + ObMySQLProxy &inner_sql_proxy = get_curr_simple_server().get_sql_proxy(); + ASSERT_TRUE(OB_NOT_NULL(GCTX.schema_service_)); + ObSchemaService *schema_service = GCTX.schema_service_->get_schema_service(); + ASSERT_TRUE(OB_NOT_NULL(schema_service)); + ASSERT_EQ(OB_SUCCESS, get_curr_observer().get_schema_service().get_tenant_schema_guard(tenant_id, schema_guard)); + ASSERT_EQ(OB_SUCCESS, schema_guard.get_schema_version(tenant_id, curr_version)); + ASSERT_NE(OB_INVALID_VERSION, curr_version); + ASSERT_EQ(OB_SUCCESS, schema_guard.get_schema_status(tenant_id, schema_status)); + ASSERT_TRUE(OB_NOT_NULL(schema_guard.schema_service_)); + ASSERT_EQ(OB_SUCCESS, schema_guard.get_schema_mgr(tenant_id, schema_mgr)); + ASSERT_TRUE(OB_NOT_NULL(schema_mgr)); + + ObAiModelMgr &mgr = const_cast(schema_mgr->ai_model_mgr_); + + // 1. add ai model + uint64_t id = OB_INVALID_ID; + int64_t version = OB_INVALID_VERSION; + ASSERT_EQ(OB_SUCCESS, schema_service->fetch_new_ai_model_id(tenant_id, id)); + ASSERT_NE(OB_INVALID_ID, id); + ASSERT_EQ(OB_SUCCESS, schema_service->gen_new_schema_version(tenant_id, curr_version, version)); + ASSERT_NE(OB_INVALID_VERSION, version); + ObAiModelSchema schema; + schema.set_tenant_id(tenant_id); + schema.set_model_id(id); + schema.set_schema_version(version); + schema.set_name("my_ai_model"); + schema.set_type(EndpointType::RERANK); + schema.set_model_name("my_model_name"); + ASSERT_EQ(OB_SUCCESS, mgr.add_ai_model(schema, ObNameCaseMode::OB_LOWERCASE_AND_INSENSITIVE)); + + // 2. try get from schema_guard + { + const ObAiModelSchema *schema = nullptr; + ASSERT_EQ(OB_SUCCESS, schema_guard.get_ai_model_schema(tenant_id, id, schema)); + ASSERT_TRUE(OB_NOT_NULL(schema)); + ASSERT_EQ(schema->get_ai_model_id(), id); + ASSERT_EQ(schema->get_tenant_id(), tenant_id); + ASSERT_EQ(schema->get_schema_version(), version); + ASSERT_EQ(schema->get_name(), "my_ai_model"); + ASSERT_EQ(schema->get_type(), EndpointType::RERANK); + ASSERT_EQ(schema->get_model_name(), "my_model_name"); + } + + // 3. test ObServerSchemaService::get_increment_external_resource_keys_reversely + { + ObSchemaOperation op; + op.op_type_ = OB_DDL_CREATE_AI_MODEL; + op.tenant_id_ = tenant_id; + op.ai_model_id_ = id; + + ObServerSchemaService::AllSchemaKeys ids; + ASSERT_EQ(OB_SUCCESS, ids.create(8)); + ASSERT_EQ(OB_SUCCESS, schema_guard.schema_service_->get_increment_ai_model_keys_reversely(*schema_mgr, op, ids)); + ASSERT_EQ(0, ids.new_ai_model_keys_.size()); + ASSERT_EQ(1, ids.del_ai_model_keys_.size()); + ASSERT_EQ(OB_SUCCESS, schema_guard.schema_service_->update_schema_mgr(inner_sql_proxy, schema_status, const_cast(*schema_mgr), curr_version, ids)); + } + + // 4. try get from schema_guard again + { + const ObAiModelSchema *schema = nullptr; + ASSERT_EQ(OB_SUCCESS, schema_guard.get_ai_model_schema(tenant_id, id, schema)); + ASSERT_TRUE(OB_ISNULL(schema)); + } +} + +TEST_F(TestAiService, end) +{ + RunCtx.time_sec_ = 0; + if (RunCtx.time_sec_ > 0) { + ::sleep(RunCtx.time_sec_); + } +} +} // end unittest +} // end oceanbase + +int main(int argc, char **argv) +{ + int64_t c = 0; + int64_t time_sec = 0; + char *log_level = (char*)"INFO"; + while(EOF != (c = getopt(argc,argv,"t:l:"))) { + switch(c) { + case 't': + time_sec = atoi(optarg); + break; + case 'l': + log_level = optarg; + oceanbase::unittest::ObSimpleClusterTestBase::enable_env_warn_log_ = false; + break; + default: + break; + } + } + oceanbase::unittest::init_log_and_gtest(argc, argv); + OB_LOGGER.set_log_level(log_level); + + LOG_INFO("main>>>"); + oceanbase::unittest::RunCtx.time_sec_ = time_sec; + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/mittest/simple_server/test_big_tx_data.cpp b/mittest/simple_server/test_big_tx_data.cpp index e3dc0cd4b..ae446a17f 100644 --- a/mittest/simple_server/test_big_tx_data.cpp +++ b/mittest/simple_server/test_big_tx_data.cpp @@ -1,16 +1,20 @@ // owner: zk250686 // owner group: transaction -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define protected public @@ -42,7 +46,7 @@ TestRunCtx RunCtx; class TestBigTxData : public ObSimpleClusterTestBase { public: - // 指定case运行目录前缀 test_ob_simple_cluster_ + // Specify the case run directory prefix test_ob_simple_cluster_ void minor_freeze_and_wait(); TestBigTxData() : ObSimpleClusterTestBase("test_big_tx_data_") {} }; @@ -66,7 +70,7 @@ TEST_F(TestBigTxData, big_tx_data) MTL_SWITCH(OB_SYS_TENANT_ID) { int64_t affected_rows = 0; sqlclient::ObISQLConnection *connection = nullptr; - // 1,开启事务,生成一些savepoint + // 1, start transaction, generate some savepoints ASSERT_EQ(OB_SUCCESS, get_curr_simple_server().get_sql_proxy().acquire(connection)); DO(EXEC_SQL("set ob_trx_timeout = 6000000000")); DO(EXEC_SQL("set ob_trx_idle_timeout = 6000000000")); @@ -83,7 +87,7 @@ TEST_F(TestBigTxData, big_tx_data) DO(sql.append_fmt("savepoint s%ld", idx)); DO(EXEC_SQL(sql.ptr())); } - // 2,获取本事务ID,这个事务的tx data足够大 + // 2, get the transaction ID of this transaction, the tx data of this transaction is large enough HEAP_VAR(ObMySQLProxy::MySQLResult, res) { int64_t sess_id = 0; int64_t tx_id; @@ -102,10 +106,10 @@ TEST_F(TestBigTxData, big_tx_data) ATOMIC_STORE(&TEST_TX_ID, tx_id); std::cout << "tx_id:" << tx_id << std::endl; } - // 3,写日志才可以生成undo status + // 3, write log can generate undo status cout << "alter system minor freeze 1" << endl; minor_freeze_and_wait(); - // 4,回滚生成undo status + // 4, rollback to generate undo status for (int64_t idx = savepoint_size - 1; idx >= 0; --idx) { ObSqlString sql; DO(sql.append_fmt("rollback to s%ld", idx)); @@ -113,11 +117,11 @@ TEST_F(TestBigTxData, big_tx_data) } DO(EXEC_SQL("commit")); ::sleep(10); - // 5,把tx data转下去 + // 5, convert tx data down cout << "alter system minor freeze 2" << endl; minor_freeze_and_wait(); - ASSERT_EQ(ATOMIC_LOAD(&DUMP_BIG_TX_DATA), true);// 确保tx data已经走过了序列化逻辑 - // 6, 读一次这个tx data + ASSERT_EQ(ATOMIC_LOAD(&DUMP_BIG_TX_DATA), true);// Ensure tx data has gone through the serialization logic + // 6, read this tx data once DoNothingOP op; ObLSService *ls_service = MTL(ObLSService*); ObLSHandle handle; @@ -126,7 +130,7 @@ TEST_F(TestBigTxData, big_tx_data) ObTxDataMiniCache fake_cache; ObReadTxDataArg read_arg(ObTransID(ATOMIC_LOAD(&TEST_TX_ID)), 1, fake_cache); DO(handle.get_ls()->tx_table_.check_with_tx_data(read_arg, op)); - // 7,检查被测事务的tx data已经经过了deserialize + // 7, check that the tx data of the transaction under test has already been deserialized ASSERT_EQ(ATOMIC_LOAD(&LOAD_BIG_TX_DATA), true); } } diff --git a/mittest/simple_server/test_callbacks_with_reverse_order.cpp b/mittest/simple_server/test_callbacks_with_reverse_order.cpp index cddd8b8e7..4313684e0 100644 --- a/mittest/simple_server/test_callbacks_with_reverse_order.cpp +++ b/mittest/simple_server/test_callbacks_with_reverse_order.cpp @@ -1,16 +1,20 @@ // owner: handora.qc // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include #define protected public diff --git a/mittest/simple_server/test_ddl_task.cpp b/mittest/simple_server/test_ddl_task.cpp index b10562480..8f056a266 100644 --- a/mittest/simple_server/test_ddl_task.cpp +++ b/mittest/simple_server/test_ddl_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/test_keep_alive_min_start_scn.cpp b/mittest/simple_server/test_keep_alive_min_start_scn.cpp index 82529aba8..50f8c0e41 100644 --- a/mittest/simple_server/test_keep_alive_min_start_scn.cpp +++ b/mittest/simple_server/test_keep_alive_min_start_scn.cpp @@ -1,16 +1,20 @@ // owner: gengli.wzy // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -91,15 +95,13 @@ void ObTestKeepAliveMinStartSCN::loop_check_start_scn(SCN &prev_min_start_scn, S { ObLS *ls = get_ls(RunCtx.tenant_id_, ObLSID(1001)); ObTxTable *tx_table = ls->get_tx_table(); - - // 每100毫秒循环一次,对应tx loop worker的单次循环interval,循环200次,对应20秒 - // 因为tx loop worker会15秒遍历一次上下文,略大于遍历间隔 + // Every 100 milliseconds loop once, corresponding to the single loop interval of tx loop worker, loop 200 times, corresponding to 20 seconds + // Because tx loop worker will traverse the context every 15 seconds, which is slightly greater than the traversal interval int retry_times = 200; while (--retry_times >= 0) { - // 每次循环都更新tx data table中的min_start_scn + // Each loop updates the min_start_scn in the tx data table tx_table->update_min_start_scn_info(SCN::max_scn()); - - // 判断min_start_scn的大小关系,若出错,打印到stdout + // Determine the size relationship of min_start_scn, if an error occurs, print to stdout if (prev_min_start_scn > tx_table->ctx_min_start_scn_info_.min_start_scn_in_ctx_) { ObCStringHelper helper; fprintf(stdout, @@ -129,12 +131,10 @@ void ObTestKeepAliveMinStartSCN::test_min_start_scn() SCN prev_min_start_scn = SCN::min_scn(); SCN prev_keep_alive_scn = SCN::min_scn(); - - // 执行循环检查前,先sleep一段时间,确保tx_loop_worker成功做一次遍历,keep_alive日志中会成功写下一次NO_CTX, - // 在错误场景下,后续的UNKNOW日志会会修改keep_alive_handler中的keep_alive_scn,但是不会修改status + // Execute loop check after sleeping for a while to ensure tx_loop_worker successfully completes one traversal, the keep_alive log will successfully write one NO_CTX, + // In the error scenario, subsequent UNKNOW logs will modify keep_alive_handler's keep_alive_scn, but will not modify status ::sleep(15); - - // 循环检查并使用keep_alive_handler中的信息更新tx data table中的数据,在错误场景下,min_start_scn会被错误推大 + // Loop check and use information in keep_alive_handler to update data in tx data table, in error scenarios, min_start_scn may be incorrectly increased loop_check_start_scn(prev_min_start_scn, prev_keep_alive_scn); // create test table @@ -143,15 +143,13 @@ void ObTestKeepAliveMinStartSCN::test_min_start_scn() // insert data and trigger redo log write WRITE_SQL_BY_CONN(connection, "begin"); WRITE_SQL_BY_CONN(connection, "insert into test.test_keep_alive_min_start_scn_t values(1,1)"); - - // 由于系统租户设置过_private_buffer_size,所有写入都会立即产生CLOG,事务也拥有了start_scn - // 在错误场景下,由于之前min_start_scn已经被错误推大,此时会出现min_start_scn回退 + // Due to the system tenant setting _private_buffer_size, all writes will immediately generate CLOG, and the transaction also has start_scn + // In the error scenario, since min_start_scn was incorrectly pushed forward earlier, it will now appear that min_start_scn is rolling back loop_check_start_scn(prev_min_start_scn, prev_keep_alive_scn); WRITE_SQL_BY_CONN(connection, "commit"); WRITE_SQL_BY_CONN(connection, "alter system minor freeze"); - - // 在事务提交后再做一次检查,确保整个过程中不会有min_start_scn回退 + // After transaction commit, do one more check to ensure that min_start_scn does not retreat throughout the entire process loop_check_start_scn(prev_min_start_scn, prev_keep_alive_scn); } diff --git a/mittest/simple_server/test_lock_table_persistence.cpp b/mittest/simple_server/test_lock_table_persistence.cpp index b27736ba1..9c304cf53 100644 --- a/mittest/simple_server/test_lock_table_persistence.cpp +++ b/mittest/simple_server/test_lock_table_persistence.cpp @@ -1,16 +1,20 @@ // owner: cxf262476 // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/test_lock_table_with_tx.cpp b/mittest/simple_server/test_lock_table_with_tx.cpp index fd9a7e0b7..8cc907541 100644 --- a/mittest/simple_server/test_lock_table_with_tx.cpp +++ b/mittest/simple_server/test_lock_table_with_tx.cpp @@ -1,16 +1,20 @@ // owner: cxf262476 // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/test_ls_recover.cpp b/mittest/simple_server/test_ls_recover.cpp index 129391735..591829732 100644 --- a/mittest/simple_server/test_ls_recover.cpp +++ b/mittest/simple_server/test_ls_recover.cpp @@ -1,16 +1,20 @@ // owner: cxf262476 // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/test_mds_recover.cpp b/mittest/simple_server/test_mds_recover.cpp index ee80c03c1..dfff9cdde 100644 --- a/mittest/simple_server/test_mds_recover.cpp +++ b/mittest/simple_server/test_mds_recover.cpp @@ -1,16 +1,20 @@ // owner: zk250686 // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -69,10 +73,10 @@ void create_or_find_test_table(const char *table_name, share::ObLSID &ls_id, ObT int64_t _; char create_table_sql[512] = { 0 }; databuff_printf(create_table_sql, 512, "create table %s(a int)", table_name); - // 1. 新建一个tablet + // 1. Create a new tablet ASSERT_EQ(OB_SUCCESS, GCTX.sql_proxy_->write(OB_SYS_TENANT_ID, create_table_sql, _)); } - // 2. 从表名拿到它的tablet_id + // 2. Get its tablet_id from the table name char where_condition1[512] = { 0 }; databuff_printf(where_condition1, 512, "where table_name = '%s'", table_name); ASSERT_EQ(OB_SUCCESS, ObTableAccessHelper::read_single_row(OB_SYS_TENANT_ID, @@ -80,7 +84,7 @@ void create_or_find_test_table(const char *table_name, share::ObLSID &ls_id, ObT OB_ALL_TABLE_TNAME, where_condition1, tablet_id)); - // 3. 从tablet_id拿到它的ls_id + // 3. Get its ls_id from tablet_id char where_condition2[512] = { 0 }; databuff_printf(where_condition2, 512, "where tablet_id = %ld", tablet_id.id()); ASSERT_EQ(OB_SUCCESS, ObTableAccessHelper::read_single_row(OB_SYS_TENANT_ID, @@ -88,7 +92,7 @@ void create_or_find_test_table(const char *table_name, share::ObLSID &ls_id, ObT OB_ALL_TABLET_TO_LS_TNAME, where_condition2, ls_id)); - // 4. 从ls_id找到ls + // 4. Find ls from ls_id storage::ObLSHandle ls_handle; ASSERT_EQ(OB_SUCCESS, MTL(storage::ObLSService *)->get_ls(ls_id, ls_handle, ObLSGetMod::TRANS_MOD)); } @@ -98,7 +102,7 @@ void insert_row_to_write_inc_seq(const char *table_name) int64_t _; char insert_sql[512] = { 0 }; databuff_printf(insert_sql, 512, "insert into %s values(0)", table_name); - // 1. 插入数据 + // 1. Insert data ASSERT_EQ(OB_SUCCESS, GCTX.sql_proxy_->write(OB_SYS_TENANT_ID, insert_sql, _)); } @@ -107,9 +111,9 @@ void add_column_to_write_dll_info(const char *table_name, share::ObLSID &ls_id, int64_t _; char insert_sql[512] = { 0 }; databuff_printf(insert_sql, 512, "alter table %s add b int after a", table_name); - // 1. 加列 + // 1. Add column ASSERT_EQ(OB_SUCCESS, GCTX.sql_proxy_->write(OB_SYS_TENANT_ID, insert_sql, _)); - // 2. 从表名拿到它的tablet_id + // 2. Get its tablet_id from the table name char where_condition1[512] = { 0 }; databuff_printf(where_condition1, 512, "where table_name = '%s'", table_name); ASSERT_EQ(OB_SUCCESS, ObTableAccessHelper::read_single_row(OB_SYS_TENANT_ID, @@ -117,7 +121,7 @@ void add_column_to_write_dll_info(const char *table_name, share::ObLSID &ls_id, OB_ALL_TABLE_TNAME, where_condition1, tablet_id)); - // 3. 从tablet_id拿到它的ls_id + // 3. Get its ls_id from tablet_id char where_condition2[512] = { 0 }; databuff_printf(where_condition2, 512, "where tablet_id = %ld", tablet_id.id()); ASSERT_EQ(OB_SUCCESS, ObTableAccessHelper::read_single_row(OB_SYS_TENANT_ID, @@ -125,7 +129,7 @@ void add_column_to_write_dll_info(const char *table_name, share::ObLSID &ls_id, OB_ALL_TABLET_TO_LS_TNAME, where_condition2, ls_id)); - // 4. 从ls_id找到ls + // 4. Find ls from ls_id storage::ObLSHandle ls_handle; ASSERT_EQ(OB_SUCCESS, MTL(storage::ObLSService *)->get_ls(ls_id, ls_handle, ObLSGetMod::TRANS_MOD)); } @@ -133,29 +137,29 @@ void add_column_to_write_dll_info(const char *table_name, share::ObLSID &ls_id, void do_major_to_write_medium_info() { int64_t _; - // 1. 插入数据 + // 1. Insert data ASSERT_EQ(OB_SUCCESS, GCTX.sql_proxy_->write(OB_SYS_TENANT_ID, "alter system minor freeze", _)); } void do_flush_mds_table(share::ObLSID ls_id, ObTabletID tablet_id) { - // 1. 从ls_id找到ls + // 1. Find ls from ls_id storage::ObLSHandle ls_handle; ASSERT_EQ(OB_SUCCESS, MTL(storage::ObLSService *)->get_ls(ls_id, ls_handle, ObLSGetMod::TRANS_MOD)); - // 2. 从ls拿到tablet handle + // 2. Get tablet handle from ls storage::ObTabletHandle tablet_handle; ASSERT_EQ(OB_SUCCESS, ls_handle.get_ls()->get_tablet(tablet_id, tablet_handle)); - // 3. 从tablet handle拿到tablet pointer + // 3. Get tablet pointer from tablet handle const ObTabletPointerHandle &pointer_handle = tablet_handle.get_obj()->get_pointer_handle(); ObTabletPointer *tablet_pointer = pointer_handle.get_resource_ptr(); - // 4. 做flush动作 + // 4. do flush action mds::MdsTableHandle handle; share::SCN max_decided_scn; ASSERT_EQ(OB_SUCCESS, ls_handle.get_ls()->get_max_decided_scn(max_decided_scn)); ASSERT_EQ(OB_SUCCESS, tablet_pointer->get_mds_table(tablet_id, handle)); ASSERT_EQ(OB_SUCCESS, handle.flush(share::SCN::max_scn(), max_decided_scn)); ASSERT_EQ(true, handle.p_mds_table_base_->flushing_scn_.is_valid()); - // 5. 等flush完成 + // 5. Wait for flush to complete share::SCN rec_scn = share::SCN::min_scn(); while (!rec_scn.is_max()) { ASSERT_EQ(OB_SUCCESS, handle.get_rec_scn(rec_scn)); @@ -167,10 +171,10 @@ void do_flush_mds_table(share::ObLSID ls_id, ObTabletID tablet_id) void do_recycle_and_gc_mds_table(share::ObLSID ls_id, ObTabletID tablet_id) { int ret = OB_SUCCESS; - // 1. 从ls_id找到ls + // 1. Find ls from ls_id storage::ObLSHandle ls_handle; ASSERT_EQ(OB_SUCCESS, MTL(storage::ObLSService *)->get_ls(ls_id, ls_handle, ObLSGetMod::TRANS_MOD)); - // 2. 从ls拿到tablet handle + // 2. Get tablet handle from ls storage::ObTabletHandle tablet_handle; ASSERT_EQ(OB_SUCCESS, ls_handle.get_ls()->get_tablet(tablet_id, tablet_handle)); // 3. gc mds table @@ -220,12 +224,12 @@ void read_virtual_mds_stat(share::ObLSID ls_id, ObTabletID tablet_id, VirtualTab void advance_checkpoint(share::ObLSID ls_id, share::SCN aim_scn) { int ret = OB_SUCCESS; - // 1. 从ls_id找到ls + // 1. Find ls from ls_id storage::ObLSHandle ls_handle; ASSERT_EQ(OB_SUCCESS, MTL(storage::ObLSService *)->get_ls(ls_id, ls_handle, ObLSGetMod::TRANS_MOD)); int64_t retry_times = 60; SCN checkpoint = SCN::min_scn(); - // 2. 等max_decided_scn推过目标点 + // 2. Wait until max_decided_scn surpasses the target point SCN max_decided_scn; do { ret = ls_handle.get_ls()->get_max_decided_scn(max_decided_scn); @@ -237,7 +241,7 @@ void advance_checkpoint(share::ObLSID ls_id, share::SCN aim_scn) } while (OB_SUCC(ret) && max_decided_scn <= aim_scn); ASSERT_EQ(OB_SUCCESS, ret); ASSERT_GT(max_decided_scn, aim_scn); - // 3. 推checkpoint并且等checkpoint推过 + // 3. Push checkpoint and wait for the checkpoint to be pushed through while (--retry_times > 0) { checkpoint = ls_handle.get_ls()->get_clog_checkpoint_scn(); if (checkpoint > aim_scn) { @@ -256,7 +260,7 @@ void advance_checkpoint(share::ObLSID ls_id, share::SCN aim_scn) } } ASSERT_GT(ls_handle.get_ls()->get_clog_checkpoint_scn(), aim_scn); - // 4. 等CLOG回收日志 + // 4. Wait for CLOG to recycle logs SCN min_start_scn = SCN::min_scn(); SCN keep_alive_scn = SCN::min_scn(); MinStartScnStatus status = MinStartScnStatus::UNKOWN; diff --git a/mittest/simple_server/test_mds_table_checkpoint.cpp b/mittest/simple_server/test_mds_table_checkpoint.cpp index b97dbb492..054cbc360 100644 --- a/mittest/simple_server/test_mds_table_checkpoint.cpp +++ b/mittest/simple_server/test_mds_table_checkpoint.cpp @@ -1,16 +1,20 @@ // owner: gengli.wzy // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -46,7 +50,7 @@ ObLSID LS_ID; class ObMdsTableCheckpointTest : public ObSimpleClusterTestBase { public: - // 指定case运行目录前缀 test_ob_simple_cluster_ + // Specify the case run directory prefix test_ob_simple_cluster_ ObMdsTableCheckpointTest() : ObSimpleClusterTestBase("test_mds_table_checkpoint_") {} void do_basic_test(); diff --git a/mittest/simple_server/test_mds_transaction.cpp b/mittest/simple_server/test_mds_transaction.cpp index c32bd6200..9f4787b2c 100644 --- a/mittest/simple_server/test_mds_transaction.cpp +++ b/mittest/simple_server/test_mds_transaction.cpp @@ -1,16 +1,20 @@ // owner: zk250686 // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef DEBUG_FOR_MDS @@ -74,7 +78,7 @@ TestRunCtx RunCtx; class TestMdsTransactionTest : public ObSimpleClusterTestBase { public: - // 指定case运行目录前缀 test_ob_simple_cluster_ + // Specify the case run directory prefix test_ob_simple_cluster_ TestMdsTransactionTest() : ObSimpleClusterTestBase("test_mds_transaction_") {} virtual void SetUp() override { ObSimpleClusterTestBase::SetUp(); @@ -106,12 +110,12 @@ TEST_F(TestMdsTransactionTest, simple_test) TEST_F(TestMdsTransactionTest, add_tenant) { while(!GCTX.root_service_->is_full_service()); - // 创建普通租户tt1 + // Create normal tenant tt1 ASSERT_EQ(OB_SUCCESS, create_tenant()); - // 获取租户tt1的tenant_id + // Get the tenant_id of tenant tt1 ASSERT_EQ(OB_SUCCESS, get_tenant_id(RunCtx.tenant_id_)); ASSERT_NE(0, RunCtx.tenant_id_); - // 初始化普通租户tt1的sql proxy + // Initialize the sql proxy for normal tenant tt1 ASSERT_EQ(OB_SUCCESS, get_curr_simple_server().init_sql_proxy2()); } @@ -154,16 +158,16 @@ TEST_F(TestMdsTransactionTest, test_for_each_kv_in_unit_in_tablet) MTL_SWITCH(OB_SYS_TENANT_ID) { int64_t _; - // 1. 新建一个tablet + // 1. Create a new tablet ASSERT_EQ(OB_SUCCESS, GCTX.ddl_sql_proxy_->write(OB_SYS_TENANT_ID, "create table test_mds_table(a int)", _)); - // 2. 从表名拿到它的tablet_id + // 2. Get the tablet_id from the table name ObTabletID tablet_id; ASSERT_EQ(OB_SUCCESS, ObTableAccessHelper::read_single_row(OB_SYS_TENANT_ID, {"tablet_id"}, OB_ALL_TABLE_TNAME, "where table_name = 'test_mds_table'", tablet_id)); - // 3. 从tablet_id拿到它的ls_id + // 3. Get its ls_id from tablet_id ObLSID ls_id; char where_condition[512] = { 0 }; databuff_printf(where_condition, 512, "where tablet_id = %ld", tablet_id.id()); @@ -172,18 +176,18 @@ TEST_F(TestMdsTransactionTest, test_for_each_kv_in_unit_in_tablet) OB_ALL_TABLET_TO_LS_TNAME, where_condition, ls_id)); - // 4. 从ls_id找到ls + // 4. Find ls from ls_id storage::ObLSHandle ls_handle; ASSERT_EQ(OB_SUCCESS, MTL(storage::ObLSService *)->get_ls(ls_id, ls_handle, ObLSGetMod::TRANS_MOD)); - // 5. 从LS找到tablet结构 + // 5. Find the tablet structure from LS storage::ObTabletHandle tablet_handle; ASSERT_EQ(OB_SUCCESS, ls_handle.get_ls()->get_tablet(tablet_id, tablet_handle)); - // 6. 调用tablet接口第一次写入多源数据,提交 + // 6. Call the tablet interface to write multi-source data for the first time, submit MdsCtx ctx1(mds::MdsWriter(ObTransID(1))); ASSERT_EQ(OB_SUCCESS, tablet_handle.get_obj()->set(ObMediumCompactionInfoKey(1), data_1_ref, ctx1)); ASSERT_EQ(OB_SUCCESS, tablet_handle.get_obj()->set(ObMediumCompactionInfoKey(3), data_3, ctx1)); ctx1.single_log_commit(mock_scn(10), mock_scn(10)); - // 7. 调用tablet接口第二次写入多源数据,不提交 + // 7. Call the tablet interface to write multi-source data for the second time without committing MdsCtx ctx2(mds::MdsWriter(ObTransID(2))); ASSERT_EQ(OB_SUCCESS, tablet_handle.get_obj()->set(ObMediumCompactionInfoKey(1), data_11, ctx2)); ASSERT_EQ(OB_SUCCESS, tablet_handle.get_obj()->set(ObMediumCompactionInfoKey(2), data_2, ctx2)); @@ -204,15 +208,15 @@ TEST_F(TestMdsTransactionTest, test_mds_table_gc_and_recycle) MTL_SWITCH(OB_SYS_TENANT_ID) { int64_t _; - // 1. 新建一个tablet + // 1. Create a new tablet ASSERT_EQ(OB_SUCCESS, GCTX.ddl_sql_proxy_->write(OB_SYS_TENANT_ID, "create table test_mds_table2(a int)", _)); - // 2. 从表名拿到它的tablet_id + // 2. Get the tablet_id from the table name ASSERT_EQ(OB_SUCCESS, ObTableAccessHelper::read_single_row(OB_SYS_TENANT_ID, {"tablet_id"}, OB_ALL_TABLE_TNAME, "where table_name = 'test_mds_table2'", tablet_id)); - // 3. 从tablet_id拿到它的ls_id + // 3. Get its ls_id from tablet_id ObLSID ls_id; char where_condition[512] = { 0 }; databuff_printf(where_condition, 512, "where tablet_id = %ld", tablet_id.id()); @@ -221,13 +225,13 @@ TEST_F(TestMdsTransactionTest, test_mds_table_gc_and_recycle) OB_ALL_TABLET_TO_LS_TNAME, where_condition, ls_id)); - // 4. 从ls_id找到ls + // 4. Find ls from ls_id storage::ObLSHandle ls_handle; ASSERT_EQ(OB_SUCCESS, MTL(storage::ObLSService *)->get_ls(ls_id, ls_handle, ObLSGetMod::TRANS_MOD)); - // 5. 从LS找到tablet结构1 + // 5. Find tablet structure 1 from LS storage::ObTabletHandle tablet_handle; ASSERT_EQ(OB_SUCCESS, ls_handle.get_ls()->get_tablet(tablet_id, tablet_handle)); - // 6. 调用tablet接口写入多源数据,提交 + // 6. Call tablet interface to write multi-source data, submit MdsCtx ctx1(mds::MdsWriter(ObTransID(1))); share::SCN rec_scn; ASSERT_EQ(OB_SUCCESS, tablet_handle.get_obj()->set(data_to_write, ctx1)); @@ -242,7 +246,7 @@ TEST_F(TestMdsTransactionTest, test_mds_table_gc_and_recycle) ASSERT_EQ(OB_SUCCESS, ls_handle.get_ls()->get_max_decided_scn(max_decided_scn)); ASSERT_EQ(OB_SUCCESS, tablet_handle.get_obj()->mds_table_flush(max_decided_scn)); MDS_LOG(INFO, "print tablet id", K(tablet_id)); - // 7. 检查mds table的存在情况 + // 7. Check the existence of mds table do { std::this_thread::sleep_for(std::chrono::seconds(5)); ASSERT_EQ(true, dynamic_cast(tablet_handle.get_obj()->pointer_hdl_.get_resource_ptr())->mds_table_handler_.mds_table_handle_.is_valid()); @@ -254,7 +258,7 @@ TEST_F(TestMdsTransactionTest, test_mds_table_gc_and_recycle) std::this_thread::sleep_for(std::chrono::seconds(5)); MDS_LOG(INFO, "mds table handle not destroy yet", K(tablet_id)); } while (false != dynamic_cast(tablet_handle.get_obj()->pointer_hdl_.get_resource_ptr())->mds_table_handler_.mds_table_handle_.is_valid()); - ASSERT_EQ(OB_SUCCESS, ls_handle.get_ls()->get_tablet(tablet_id, tablet_handle));// 重新获取一下tablet handle + ASSERT_EQ(OB_SUCCESS, ls_handle.get_ls()->get_tablet(tablet_id, tablet_handle)); // re-obtain the tablet handle ASSERT_EQ(OB_SUCCESS, (tablet_handle.get_obj()->get_mds_data_from_tablet(mds::DummyKey(), share::SCN::max_scn(), 1_s, [&data_to_write](const ObTabletBindingMdsUserData &data_to_read) -> int { OB_ASSERT(data_to_write.schema_version_ == data_to_read.schema_version_); @@ -278,15 +282,15 @@ TEST_F(TestMdsTransactionTest, test_mds_table_gc_and_recycle) // MTL_SWITCH(OB_SYS_TENANT_ID) // { // int64_t _; -// // 1. 新建一个tablet +// // 1. Create a new tablet // ASSERT_EQ(OB_SUCCESS, GCTX.ddl_sql_proxy_->write(OB_SYS_TENANT_ID, "create table test_mds_table3(a int)", _)); -// // 2. 从表名拿到它的tablet_id +// // 2. Get the tablet_id from the table name // ASSERT_EQ(OB_SUCCESS, ObTableAccessHelper::read_single_row(OB_SYS_TENANT_ID, // {"tablet_id"}, // OB_ALL_TABLE_TNAME, // "where table_name = 'test_mds_table3'", // tablet_id)); -// // 3. 从tablet_id拿到它的ls_id +// // 3. Get its ls_id from tablet_id // ObLSID ls_id; // char where_condition[512] = { 0 }; // databuff_printf(where_condition, 512, "where tablet_id = %ld", tablet_id.id()); @@ -295,29 +299,29 @@ TEST_F(TestMdsTransactionTest, test_mds_table_gc_and_recycle) // OB_ALL_TABLET_TO_LS_TNAME, // where_condition, // ls_id)); -// // 4. 从ls_id找到ls +// // 4. Find ls from ls_id // storage::ObLSHandle ls_handle; // ASSERT_EQ(OB_SUCCESS, MTL(storage::ObLSService *)->get_ls(ls_id, ls_handle, ObLSGetMod::TRANS_MOD)); -// // 5. 从LS找到tablet结构 +// // 5. Find the tablet structure from LS // storage::ObTabletHandle tablet_handle; // ASSERT_EQ(OB_SUCCESS, ls_handle.get_ls()->get_tablet(tablet_id, tablet_handle)); -// // 6. 调用tablet接口写入多源数据,提交 +// // 6. Call tablet interface to write multi-source data, submit // share::SCN max_decided_scn; // ASSERT_EQ(OB_SUCCESS, ls_handle.get_ls()->get_max_decided_scn(max_decided_scn)); // MdsCtx ctx1(mds::MdsWriter(ObTransID(1))); // share::SCN rec_scn; -// ASSERT_EQ(OB_STATE_NOT_MATCH, tablet_handle.get_obj()->check_transfer_in_redo_written(written));// 这个时候因为tablet status不是TRANSFER IN所以查不出来 +// ASSERT_EQ(OB_STATE_NOT_MATCH, tablet_handle.get_obj()->check_transfer_in_redo_written(written)); // At this time, because the tablet status is not TRANSFER IN, it cannot be found // ASSERT_EQ(OB_SUCCESS, tablet_handle.get_obj()->set(data_to_write, ctx1)); -// ASSERT_EQ(OB_SUCCESS, tablet_handle.get_obj()->check_transfer_in_redo_written(written));// 这个时候tablet status是TRANSFER IN, 但事务还没写日志,所以可以查出结果,但结果是false +// ASSERT_EQ(OB_SUCCESS, tablet_handle.get_obj()->check_transfer_in_redo_written(written)); // At this time, the tablet status is TRANSFER IN, but the transaction has not written the log, so the result can be queried, but the result is false // ASSERT_EQ(false, written); // ctx1.single_log_commit(max_decided_scn, max_decided_scn); -// ASSERT_EQ(OB_SUCCESS, tablet_handle.get_obj()->check_transfer_in_redo_written(written));// 这个时候tablet status是TRANSFER IN, 并且事务已经提交,所以可以查出结果,并且结果是true +// ASSERT_EQ(OB_SUCCESS, tablet_handle.get_obj()->check_transfer_in_redo_written(written)); // At this time, the tablet status is TRANSFER IN, and the transaction has been committed, so the result can be queried, and the result is true // ASSERT_EQ(true, written); // ASSERT_EQ(true, dynamic_cast(tablet_handle.get_obj()->pointer_hdl_.get_resource_ptr())->mds_table_handler_.mds_table_handle_.is_valid()); // std::this_thread::sleep_for(std::chrono::seconds(5)); // ASSERT_EQ(OB_SUCCESS, tablet_handle.get_obj()->mds_table_flush(max_decided_scn)); // MDS_LOG(INFO, "print tablet id", K(tablet_id)); -// // 7. 检查mds table的存在情况 +// // 7. Check the existence of mds table // do { // std::this_thread::sleep_for(std::chrono::seconds(5)); // ASSERT_EQ(true, dynamic_cast(tablet_handle.get_obj()->pointer_hdl_.get_resource_ptr())->mds_table_handler_.mds_table_handle_.is_valid()); @@ -330,8 +334,8 @@ TEST_F(TestMdsTransactionTest, test_mds_table_gc_and_recycle) // std::this_thread::sleep_for(std::chrono::seconds(5)); // MDS_LOG(INFO, "mds table handle not destroy yet", K(tablet_id)); // } while (false != dynamic_cast(tablet_handle.get_obj()->pointer_hdl_.get_resource_ptr())->mds_table_handler_.mds_table_handle_.is_valid()); -// ASSERT_EQ(OB_SUCCESS, ls_handle.get_ls()->get_tablet(tablet_id, tablet_handle));// 重新获取一下tablet handle -// ASSERT_EQ(OB_SUCCESS, tablet_handle.get_obj()->check_transfer_in_redo_written(written));// 这个时候tablet status是TRANSFER IN, 并且事务已经提交,所以可以查出结果,并且结果是true +// ASSERT_EQ(OB_SUCCESS, ls_handle.get_ls()->get_tablet(tablet_id, tablet_handle)); // re-obtain the tablet handle +// ASSERT_EQ(OB_SUCCESS, tablet_handle.get_obj()->check_transfer_in_redo_written(written)); // At this time, the tablet status is TRANSFER IN, and the transaction has been committed, so the result can be queried, and the result is true // ASSERT_EQ(true, written); // mock_tablet_oldest_scn = unittest::mock_scn(1000); // } diff --git a/mittest/simple_server/test_mds_tx_ctx_recover_mem_leak.cpp b/mittest/simple_server/test_mds_tx_ctx_recover_mem_leak.cpp index 965dd5ae4..c48e0c54e 100644 --- a/mittest/simple_server/test_mds_tx_ctx_recover_mem_leak.cpp +++ b/mittest/simple_server/test_mds_tx_ctx_recover_mem_leak.cpp @@ -1,16 +1,20 @@ // owner: zk250686 // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include #define USING_LOG_PREFIX STORAGE @@ -126,7 +130,7 @@ TEST_F(ObTestMdsTxCtxRecoverMemLeakAfterRecover, after_recover_test) ASSERT_EQ(OB_SUCCESS, delete_tenant("tt1")); OCCAM_LOG(INFO, "step 11: after delete tenant"); int64_t result_num = 0; - // 等待租户的MTL组建析构,此时会检查内存泄露 + // Wait for the tenant's MTL construction destruction, at this time it will check for memory leaks do { char where_condition[512] = { 0 }; databuff_printf(where_condition, 512, "where event = 'remove_tenant' and value1 = 1002"); @@ -174,4 +178,4 @@ int main(int argc, char **argv) restart_helper.run(); return ret; -} \ No newline at end of file +} diff --git a/mittest/simple_server/test_memtable_new_safe_to_destroy.cpp b/mittest/simple_server/test_memtable_new_safe_to_destroy.cpp index a585fde86..5b1eb7b21 100644 --- a/mittest/simple_server/test_memtable_new_safe_to_destroy.cpp +++ b/mittest/simple_server/test_memtable_new_safe_to_destroy.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/test_mvcc_gc.cpp b/mittest/simple_server/test_mvcc_gc.cpp index 602ce078e..37f534d35 100644 --- a/mittest/simple_server/test_mvcc_gc.cpp +++ b/mittest/simple_server/test_mvcc_gc.cpp @@ -1,16 +1,20 @@ // owner: handora.qc // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/test_ob_black_list_service.cpp b/mittest/simple_server/test_ob_black_list_service.cpp index e766731d8..d7f17b5eb 100644 --- a/mittest/simple_server/test_ob_black_list_service.cpp +++ b/mittest/simple_server/test_ob_black_list_service.cpp @@ -1,16 +1,20 @@ // owner: weixiaoxian.wxx // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/simple_server/test_ob_obj_lock_garbage_collector.cpp b/mittest/simple_server/test_ob_obj_lock_garbage_collector.cpp index 47f3c595d..65795c925 100644 --- a/mittest/simple_server/test_ob_obj_lock_garbage_collector.cpp +++ b/mittest/simple_server/test_ob_obj_lock_garbage_collector.cpp @@ -1,16 +1,20 @@ // owner: yichang.yyf // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/test_ob_partition_balance.cpp b/mittest/simple_server/test_ob_partition_balance.cpp index ae32faae3..331ac91a8 100644 --- a/mittest/simple_server/test_ob_partition_balance.cpp +++ b/mittest/simple_server/test_ob_partition_balance.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -89,7 +93,7 @@ void print_part_map(const ObTransferPartMap &part_map, const char* label) { class ObBalancePartitionTest : public ObSimpleClusterTestBase { public: - // 指定case运行目录前缀 test_ob_simple_cluster_ + // Specify the case run directory prefix test_ob_simple_cluster_ ObBalancePartitionTest() : ObSimpleClusterTestBase("test_ob_balance_partition_") { common::ObMySQLProxy &sql_proxy = get_curr_simple_server().get_sql_proxy(); ObSqlString sql; @@ -149,15 +153,14 @@ TEST_F(ObBalancePartitionTest, empty) ASSERT_EQ(OB_SUCCESS, run(i)); } } - -// 非分区表整体是一个均衡组,表做平铺 +// The non-partitioned table as a whole is an even group, the table is laid out evenly TEST_F(ObBalancePartitionTest, simple_table) { TEST_INFO("-----------simple_table-------------"); common::ObMySQLProxy &sql_proxy = get_curr_simple_server().get_sql_proxy(); ObSqlString sql; int64_t affected_rows = 0; - // 创建表 + // Create table for (int i = 1; i <= 17; i++) { sql.assign_fmt("create table basic_%d(col1 int)", i); ASSERT_EQ(OB_SUCCESS, sql_proxy.write(sql.ptr(), affected_rows)); @@ -166,13 +169,12 @@ TEST_F(ObBalancePartitionTest, simple_table) ASSERT_EQ(OB_SUCCESS, run(i)); } } - -// 每个一级分区的表是一个均衡组,一级分区做平铺 +// Each first-level partition table is a balanced group, first-level partitions are laid out evenly TEST_F(ObBalancePartitionTest, partition) { TEST_INFO("-----------partition-------------"); common::ObMySQLProxy &sql_proxy = get_curr_simple_server().get_sql_proxy(); - // 创建表 + // Create table for (int i = 1; i <= 5; i++) { ObSqlString sql; sql.assign_fmt("create table partition_%d(col1 int) partition by hash(col1) partitions 10", i); @@ -188,7 +190,7 @@ TEST_F(ObBalancePartitionTest, subpart) { TEST_INFO("-----------subpart-------------"); common::ObMySQLProxy &sql_proxy = get_curr_simple_server().get_sql_proxy(); - // 创建表 + // Create table for (int i = 1; i <= 5; i++) { ObSqlString sql; sql.assign_fmt("create table subpart_%d(col1 int) partition by range(col1) subpartition by hash(col1) subpartitions 10 (partition p1 values less than (100), partition p2 values less than MAXVALUE)", i); diff --git a/mittest/simple_server/test_ob_queuing_table.cpp b/mittest/simple_server/test_ob_queuing_table.cpp index b19bd7f7d..08f07a689 100644 --- a/mittest/simple_server/test_ob_queuing_table.cpp +++ b/mittest/simple_server/test_ob_queuing_table.cpp @@ -1,16 +1,20 @@ // owner: chengkong.oyhr // owner group: storage -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -256,4 +260,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/simple_server/test_ob_simple_cluster.cpp b/mittest/simple_server/test_ob_simple_cluster.cpp index 655b55810..d74820649 100644 --- a/mittest/simple_server/test_ob_simple_cluster.cpp +++ b/mittest/simple_server/test_ob_simple_cluster.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -38,7 +42,7 @@ TestRunCtx RunCtx; class ObSimpleClusterExampleTest : public ObSimpleClusterTestBase { public: - // 指定case运行目录前缀 test_ob_simple_cluster_ + // Specify the case run directory prefix test_ob_simple_cluster_ ObSimpleClusterExampleTest() : ObSimpleClusterTestBase("test_ob_simple_cluster_") {} }; @@ -46,16 +50,15 @@ TEST_F(ObSimpleClusterExampleTest, observer_start) { SERVER_LOG(INFO, "observer_start succ"); } - -// 创建租户并不轻量,看场景必要性使用 +// Creating a tenant is not lightweight, consider necessity of use based on the scenario TEST_F(ObSimpleClusterExampleTest, add_tenant) { - // 创建普通租户tt1 + // Create normal tenant tt1 ASSERT_EQ(OB_SUCCESS, create_tenant()); - // 获取租户tt1的tenant_id + // Get the tenant_id of tenant tt1 ASSERT_EQ(OB_SUCCESS, get_tenant_id(RunCtx.tenant_id_)); ASSERT_NE(0, RunCtx.tenant_id_); - // 初始化普通租户tt1的sql proxy + // Initialize the SQL proxy for the normal tenant tt1 ASSERT_EQ(OB_SUCCESS, get_curr_simple_server().init_sql_proxy2()); } @@ -63,9 +66,9 @@ TEST_F(ObSimpleClusterExampleTest, add_tenant) TEST_F(ObSimpleClusterExampleTest, create_table) { int ret = OB_SUCCESS; - // 使用普通租户tt1 + // use normal tenant tt1 common::ObMySQLProxy &sql_proxy = get_curr_simple_server().get_sql_proxy2(); - // 创建表 + // create table { OB_LOG(INFO, "create_table start"); ObSqlString sql; @@ -85,7 +88,7 @@ TEST_F(ObSimpleClusterExampleTest, create_table) int64_t affected_rows = 0; ASSERT_EQ(OB_SUCCESS, sql_proxy.write(sql.ptr(), affected_rows)); } - //check row count + // check row count OB_LOG(INFO, "check row count"); { int64_t row_cnt = 0; diff --git a/mittest/simple_server/test_ob_simple_rto.cpp b/mittest/simple_server/test_ob_simple_rto.cpp index 5845aaa88..657ff7e42 100644 --- a/mittest/simple_server/test_ob_simple_rto.cpp +++ b/mittest/simple_server/test_ob_simple_rto.cpp @@ -1,16 +1,20 @@ // owner: yunlong.cb // owner group: clog -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/test_ob_table_lock_service.cpp b/mittest/simple_server/test_ob_table_lock_service.cpp index 0bf48856c..81d8d44c7 100644 --- a/mittest/simple_server/test_ob_table_lock_service.cpp +++ b/mittest/simple_server/test_ob_table_lock_service.cpp @@ -1,16 +1,20 @@ // owner: cxf262476 // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -35,7 +39,7 @@ using namespace oceanbase::storage; class ObTableLockServiceTest : public ObSimpleClusterTestBase { public: - // 指定case运行目录前缀 test_ob_simple_cluster_ + // Specify the case run directory prefix test_ob_simple_cluster_ ObTableLockServiceTest() : ObSimpleClusterTestBase("test_ob_lock_service_") {} void get_table_id(const char* tname, uint64_t &table_id); void get_lock_owner(const char* where_cond, int64_t &raw_owner_id); diff --git a/mittest/simple_server/test_observer_expand_shrink.cpp b/mittest/simple_server/test_observer_expand_shrink.cpp index f6c7d30ba..ee5de81a7 100644 --- a/mittest/simple_server/test_observer_expand_shrink.cpp +++ b/mittest/simple_server/test_observer_expand_shrink.cpp @@ -1,16 +1,20 @@ // owner: zjf225077 // owner group: clog -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -44,7 +48,7 @@ TestRunCtx RunCtx; class ObserverExpandShink : public ObSimpleClusterTestBase { public: - // 指定case运行目录前缀 test_ob_simple_cluster_ + // Specify the case run directory prefix test_ob_simple_cluster_ ObserverExpandShink() : ObSimpleClusterTestBase(TEST_FILE_NAME) {} }; @@ -73,24 +77,22 @@ TEST_F(ObserverExpandShink, basic_func) int64_t affected_rows = 0; std::string succ_sql_str = "ALTER RESOURCE UNIT sys_unit_config LOG_DISK_SIZE='3G'"; EXPECT_EQ(OB_SUCCESS, exec_write_sql_sys(succ_sql_str.c_str(), affected_rows)); - // tenant_node_balancer 1 s 运行一次 + // tenant_node_balancer runs once every 1 s sleep(3); std::string succ_sql_str1 = "ALTER SYSTEM SET log_disk_utilization_limit_threshold = 81"; EXPECT_EQ(OB_SUCCESS, exec_write_sql_sys(succ_sql_str1.c_str(), affected_rows)); - - // 验证修改租户规格失败,报错小于clog盘下限 + // Validate tenant specification modification failure, error less than clog disk lower limit std::string fail_sql_str = "ALTER RESOURCE UNIT sys_unit_config LOG_DISK_SIZE='1G'"; EXPECT_EQ(OB_RESOURCE_UNIT_VALUE_BELOW_LIMIT, exec_write_sql_sys(fail_sql_str.c_str(), affected_rows)); std::string succ_sql_str2 = "ALTER SYSTEM SET log_disk_size = '4G'"; EXPECT_EQ(OB_SUCCESS, exec_write_sql_sys(succ_sql_str2.c_str(), affected_rows)); sleep(6); EXPECT_EQ(GCONF.log_disk_size, 4 * 1024 * 1024 * 1024ul); - // 验证修改租户规格失败,clog盘空间不够 + // Verify that modifying tenant specification failed, clog disk space insufficient std::string fail_sql_str1 = "ALTER RESOURCE UNIT sys_unit_config LOG_DISK_SIZE='100G'"; EXPECT_EQ(OB_MACHINE_RESOURCE_NOT_ENOUGH, exec_write_sql_sys(fail_sql_str1.c_str(), affected_rows)); - - // 验证创建租户失败,clog盘空间不够 + // Validate tenant creation failure, clog disk space insufficient std::string succ_sql_str3 = "ALTER SYSTEM SET log_disk_size = '3G'"; EXPECT_EQ(OB_SUCCESS, exec_write_sql_sys(succ_sql_str3.c_str(), affected_rows)); sleep(6); @@ -132,20 +134,20 @@ TEST_F(ObserverExpandShink, resize_tenant_log_disk) SERVER_LOG(WARN, "check_tenant_exist failed", K(ret)); } } - // 保证log_disk_size变为10G生效 + // Ensure log_disk_size change to 10G takes effect sleep(3); int64_t log_disk_origin_assigned = GCTX.log_block_mgr_->min_log_disk_size_for_all_tenants_; bool bool_ret = true; EXPECT_EQ(bool_ret, true); LOG_INFO("runlin trace, before create one default tenant", KPC(GCTX.log_block_mgr_), K(log_disk_origin_assigned)); - // 每个租户的日志盘大小为2G(默认值) + // The size of each tenant's log disk is 2G (default value) EXPECT_EQ(OB_SUCCESS, create_tenant("runlin1")); LOG_INFO("runlin trace, after create one default tenant", KPC(GCTX.log_block_mgr_), K(log_disk_origin_assigned)); EXPECT_EQ(OB_SUCCESS, create_tenant("runlin2")); EXPECT_EQ(GCTX.log_block_mgr_->min_log_disk_size_for_all_tenants_, log_disk_origin_assigned + 4*1024*1024*1024ul); LOG_INFO("runlin trace, after create two default tenant", KPC(GCTX.log_block_mgr_), K(log_disk_origin_assigned)); - // 修改租户规格 + // Modify tenant specification int64_t affected_rows = 0; std::string sql_str = "ALTER RESOURCE UNIT %s%s LOG_DISK_SIZE='%s'"; { @@ -159,20 +161,20 @@ TEST_F(ObserverExpandShink, resize_tenant_log_disk) LOG_INFO("runlin trace, alter resource below limit", KPC(GCTX.log_block_mgr_)); } { - // 扩容验证 + // Expansion validation std::string alter_resource_runlin1 = string_format(sql_str, UNIT_BASE, "runlin1", "6G"); std::string alter_resource_runlin2 = string_format(sql_str, UNIT_BASE, "runlin2", "6G"); EXPECT_EQ(OB_SUCCESS, exec_write_sql_sys(alter_resource_runlin1.c_str(), affected_rows)); EXPECT_EQ(OB_SUCCESS, exec_write_sql_sys(alter_resource_runlin2.c_str(), affected_rows)); sleep(3); - // 扩容操作直接执行成功 + // Expansion operation executed successfully directly EXPECT_EQ(GCTX.log_block_mgr_->min_log_disk_size_for_all_tenants_, log_disk_origin_assigned + 12*1024*1024*1024ul); LOG_INFO("runlin trace, alter resource to 6G success", KPC(GCTX.log_block_mgr_)); } { - // 缩容验证 - // 暂停TenantNodeBalancer的运行 + // Shrink validation + // Pause the operation of TenantNodeBalancer omt::ObTenantNodeBalancer::get_instance().refresh_interval_ = 10 * 1000 * 1000; int64_t start_ts = ObTimeUtility::current_time(); sleep(2); @@ -183,9 +185,9 @@ TEST_F(ObserverExpandShink, resize_tenant_log_disk) EXPECT_EQ(OB_SUCCESS, exec_write_sql_sys(alter_resource_runlin2.c_str(), affected_rows)); } const int64_t cost_ts = ObTimeUtility::current_time() - start_ts; - // 假设sleep+执行sql的时间小于4s + // Assume the sleep + execution of sql time is less than 4s EXPECT_LE(cost_ts, 4*1000*1000); - // 此时TenantNodeBalancer线程还未开始运行,ObServerLogBlockMgr的min_log_disk_size_for_all_tenants_不会发生变化 + // At this time, the TenantNodeBalancer thread has not started running, ObServerLogBlockMgr's min_log_disk_size_for_all_tenants_ will not change EXPECT_EQ(GCTX.log_block_mgr_->min_log_disk_size_for_all_tenants_, log_disk_origin_assigned + 12*1024*1024*1024ul); omt::ObTenantNodeBalancer::get_instance().refresh_interval_ = 1 * 1000 * 1000; diff --git a/mittest/simple_server/test_replay_from_middle.cpp b/mittest/simple_server/test_replay_from_middle.cpp index d3ea3265e..6327b4c04 100644 --- a/mittest/simple_server/test_replay_from_middle.cpp +++ b/mittest/simple_server/test_replay_from_middle.cpp @@ -1,16 +1,20 @@ // owner: gengli.wzy // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -448,7 +452,7 @@ void ObReplayRestartTest::restart_test() tx_data_table = tx_table->get_tx_data_table(); { - // 场景一: keep alive日志没有被回放,min_start_scn为初始值状态,跳过计算upper_trans_version + // Scene one: keep alive log has not been replayed, min_start_scn is in initial value state, skip calculating upper_trans_version ASSERT_EQ(SCN::min_scn(), tx_table->ctx_min_start_scn_info_.min_start_scn_in_ctx_); upper_trans_version.set_min(); FLOG_INFO("get upper trans version, situation 1:", K(SSTABLE_END_SCN)); @@ -457,7 +461,7 @@ void ObReplayRestartTest::restart_test() } { - // 场景2: keep alive日志被回放,min_start_scn小于end_scn,跳过计算upper_trans_version + // Scene 2: keep alive log is replayed, min_start_scn is less than end_scn, skip calculating upper_trans_version REPLAY_BARRIER = SCN::plus(KEEP_ALIVE_SCN, 1); int64_t retry_times = 100; while (--retry_times > 0) { @@ -477,7 +481,7 @@ void ObReplayRestartTest::restart_test() } { - // 场景3: 所有日志回放结束,事务数据也发生冻结转储,上下文及事务数据表都已没有事务 + // Scene 3: All log replays have ended, transaction data has also been frozen and dumped, and there are no transactions left in the context and transaction data table REPLAY_BARRIER = SCN::max_scn(); // wait replaying again diff --git a/mittest/simple_server/test_role_change_service.cpp b/mittest/simple_server/test_role_change_service.cpp index f9c2e5dd4..e1fdb1934 100644 --- a/mittest/simple_server/test_role_change_service.cpp +++ b/mittest/simple_server/test_role_change_service.cpp @@ -1,15 +1,21 @@ // owner: zjf225077 // owner group: clog -// Copyright (c) 2021 OceanBase cxf262476, 2021-10-18 - add interface of logstream -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #include #define USING_LOG_PREFIX SERVER #define protected public @@ -38,7 +44,7 @@ std::string LOGGER_FILE_NAME=TEST_FILE_NAME + "/role_change_service.log"; class RoleChangeService : public ObSimpleClusterTestBase { public: - // 指定case运行目录前缀 test_ob_simple_cluster_ + // Specify the case run directory prefix test_ob_simple_cluster_ RoleChangeService () : ObSimpleClusterTestBase(TEST_FILE_NAME) {} }; @@ -65,13 +71,13 @@ TEST_F(RoleChangeService, unique_set) EXPECT_EQ(OB_ENTRY_EXIST, set.insert(event)); RoleChangeEvent event1(RoleChangeEventType::ROLE_CHANGE_CB_EVENT_TYPE, ObLSID(base_ls_id+1000000)); EXPECT_EQ(OB_SIZE_OVERFLOW, set.insert(event1)); - // 第一个slot将会被清空 + // The first slot will be cleared EXPECT_EQ(OB_SUCCESS, rc_service->on_role_change(base_ls_id)); RoleChangeEvent event2(RoleChangeEventType::ROLE_CHANGE_CB_EVENT_TYPE, ObLSID(base_ls_id+1)); EXPECT_EQ(OB_ENTRY_EXIST, set.insert(event2)); sleep(1); { - // 清空第一个slot + // Clear the first slot rc_service->rc_set_.events_[0].reset(); CLOG_LOG(ERROR, "runlin trace1"); ObAddr dest_addr(ObAddr::VER::IPV4, "127.0.0.1", 1234); @@ -101,7 +107,7 @@ TEST_F(RoleChangeService, basic_func) uint64_t tenant_id = 0; EXPECT_EQ(OB_SUCCESS, get_tenant_id(tenant_id, tenant_name)); MAKE_TENANT_SWITCH_SCOPE_GUARD(guard); - // 上下文切换为runlin租户 + // Context switch to runlin tenant ASSERT_EQ(OB_SUCCESS, guard.switch_to(tenant_id)); ObLogService *log_service = MTL(ObLogService*); ASSERT_NE(nullptr, log_service); @@ -112,7 +118,7 @@ TEST_F(RoleChangeService, basic_func) { ObLSHandle ls; EXPECT_EQ(OB_SUCCESS, ls_service->get_ls(ObLSID(1001), ls, ObLSGetMod::LOG_MOD)); - // 停止回放 + // Stop playback EXPECT_EQ(OB_SUCCESS, ls.get_ls()->disable_replay()); ObLogHandler *log_handler = &ls.get_ls()->log_handler_; EXPECT_EQ(LEADER, log_handler->role_); @@ -143,8 +149,8 @@ TEST_F(RoleChangeService, test_offline) ObApplyStatusGuard guard; ObLSID id(1); EXPECT_EQ(OB_SUCCESS, apply_service->get_apply_status(id, guard)); - // 开启事务,提交日志 - // offline是否卡卡住 + // Start transaction, commit log + // is offline stuck common::ObMySQLProxy &sql_proxy = get_curr_simple_server().get_sql_proxy_with_short_wait(); ObSqlString sql; { @@ -173,7 +179,7 @@ TEST_F(RoleChangeService, test_offline) ASSERT_EQ(OB_SUCCESS, sql.assign_fmt("insert into t1 values(%d, %d)", 1, 9)); sql_proxy.write(sql.ptr(), affected_rows); ASSERT_EQ(OB_SUCCESS, sql.assign_fmt("commit")); - // commit 会卡住 + // commit will hang CLOG_LOG(INFO, "runlin trace before commit"); sql_proxy.write(sql.ptr(), affected_rows); diff --git a/mittest/simple_server/test_special_tablet_flush.cpp b/mittest/simple_server/test_special_tablet_flush.cpp index a026f8cab..546c5f376 100644 --- a/mittest/simple_server/test_special_tablet_flush.cpp +++ b/mittest/simple_server/test_special_tablet_flush.cpp @@ -1,16 +1,20 @@ // owner: gengli.wzy // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/test_table_lock_split.cpp b/mittest/simple_server/test_table_lock_split.cpp index 57e9dc530..e804c313d 100644 --- a/mittest/simple_server/test_table_lock_split.cpp +++ b/mittest/simple_server/test_table_lock_split.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/test_tablet_autoinc_mgr.cpp b/mittest/simple_server/test_tablet_autoinc_mgr.cpp index 109327df9..998a5de88 100644 --- a/mittest/simple_server/test_tablet_autoinc_mgr.cpp +++ b/mittest/simple_server/test_tablet_autoinc_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/test_tablet_memtable_mit.cpp b/mittest/simple_server/test_tablet_memtable_mit.cpp index 47ac955de..bd4418496 100644 --- a/mittest/simple_server/test_tablet_memtable_mit.cpp +++ b/mittest/simple_server/test_tablet_memtable_mit.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/test_tablet_to_ls_cache.cpp b/mittest/simple_server/test_tablet_to_ls_cache.cpp index ea2b5d3bb..df5b33b17 100644 --- a/mittest/simple_server/test_tablet_to_ls_cache.cpp +++ b/mittest/simple_server/test_tablet_to_ls_cache.cpp @@ -1,16 +1,20 @@ // owner: shanyan.g // owner group: transaction -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/test_tenant_snapshot_service.cpp b/mittest/simple_server/test_tenant_snapshot_service.cpp index 93a717a23..1ce5e1480 100644 --- a/mittest/simple_server/test_tenant_snapshot_service.cpp +++ b/mittest/simple_server/test_tenant_snapshot_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -257,4 +261,4 @@ int main(int argc, char **argv) oceanbase::common::ObLogger::get_logger().set_log_level("INFO"); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/simple_server/test_truncate_info_service.cpp b/mittest/simple_server/test_truncate_info_service.cpp index 5ae8edca7..00185b7ca 100644 --- a/mittest/simple_server/test_truncate_info_service.cpp +++ b/mittest/simple_server/test_truncate_info_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/mittest/simple_server/test_truncate_partition_filter.cpp b/mittest/simple_server/test_truncate_partition_filter.cpp index 5fe3444f9..371b86a64 100644 --- a/mittest/simple_server/test_truncate_partition_filter.cpp +++ b/mittest/simple_server/test_truncate_partition_filter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -1079,4 +1083,4 @@ int main(int argc, char **argv) oceanbase::common::ObLogger::get_logger().set_log_level("INFO"); ::testing::InitGoogleTest(&argc,argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/mittest/simple_server/test_tx_ctx_table_mit.cpp b/mittest/simple_server/test_tx_ctx_table_mit.cpp index d6e4cb9bb..1a7e49d5e 100644 --- a/mittest/simple_server/test_tx_ctx_table_mit.cpp +++ b/mittest/simple_server/test_tx_ctx_table_mit.cpp @@ -1,16 +1,20 @@ // owner: gengli.wzy // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -139,34 +143,28 @@ void ObTxCtxTableTest::dump_ctx_with_merged_undo_action() ASSERT_NE(nullptr, tt1_conn); ASSERT_EQ(OB_SUCCESS, sys_proxy.acquire(sys_conn)); ASSERT_NE(nullptr, sys_conn); - - // 初始化测试用例所需参数 + // Initialize the parameters required for test cases WRITE_SQL_BY_CONN(sys_conn, "alter system set _private_buffer_size = '1B';"); WRITE_SQL_BY_CONN(tt1_conn, "set ob_trx_timeout = 3000000000"); WRITE_SQL_BY_CONN(tt1_conn, "set ob_trx_idle_timeout = 3000000000"); WRITE_SQL_BY_CONN(tt1_conn, "set ob_query_timeout = 3000000000"); WRITE_SQL_BY_CONN(tt1_conn, "alter system set undo_retention = 1800"); sleep(5); - - // 建表 + // Create table WRITE_SQL_BY_CONN(tt1_conn, "create table if not exists test_tx_ctx_t (a int, b int)"); - - // 开事务 + // Start transaction WRITE_SQL_BY_CONN(tt1_conn, "begin"); WRITE_SQL_BY_CONN(tt1_conn, "insert into test_tx_ctx_t values(1, 1);"); for (int i = 0; i < 4; i++) { WRITE_SQL_BY_CONN(tt1_conn, "insert into test_tx_ctx_t select a, b from test_tx_ctx_t;"); } - - // 执行一次事务上下文表的转储,保证建表语句产生的多源事务能够被转储下去,retain ctx可以被释放 + // Execute a dump of the transaction context table to ensure that the multi-source transactions generated by the create table statements can be dumped, retain ctx can be released SLEEP_BEFORE_DUMP_TX_CTX = false; WRITE_SQL_BY_CONN(sys_conn, "alter system minor freeze tenant sys;"); WRITE_SQL_BY_CONN(sys_conn, "alter system minor freeze tenant all_user;"); WRITE_SQL_BY_CONN(sys_conn, "alter system minor freeze tenant all_meta;"); sleep(5); - - - // 确认当前上下文中有且只有这一个事务 + // Confirm that there is and only one transaction in the current context HEAP_VAR(ObMySQLProxy::MySQLResult, res_0) { common::sqlclient::ObMySQLResult *result = nullptr; @@ -191,8 +189,7 @@ void ObTxCtxTableTest::dump_ctx_with_merged_undo_action() } ASSERT_EQ(1, cnt); } - - // 获取当前上下文表的转储位点,用于确认下一次转储是否成功 + // Get the dump point of the current context table to confirm the success of the next dump HEAP_VAR(ObMySQLProxy::MySQLResult, res_1) { common::sqlclient::ObMySQLResult *result = nullptr; @@ -211,29 +208,23 @@ void ObTxCtxTableTest::dump_ctx_with_merged_undo_action() for (int i = 0; i < 2; i++) { WRITE_SQL_BY_CONN(tt1_conn, "insert into test_tx_ctx_t select a, b from test_tx_ctx_t;"); } - - - // 产生一个undo action,同时插入一些新的数据 + // Generate an undo action, while inserting some new data WRITE_SQL_BY_CONN(tt1_conn, "savepoint x2"); for (int i = 0; i < 2; i++) { WRITE_SQL_BY_CONN(tt1_conn, "insert into test_tx_ctx_t select a, b from test_tx_ctx_t;"); } WRITE_SQL_BY_CONN(tt1_conn, "rollback to savepoint x2"); WRITE_SQL_BY_CONN(tt1_conn, "insert into test_tx_ctx_t select a, b from test_tx_ctx_t;"); - - - // 转储ctx table,设置SLEEP_BEFORE_DUMP_TX_CTX标志 + // Dump ctx table, set SLEEP_BEFORE_DUMP_TX_CTX flag SLEEP_BEFORE_DUMP_TX_CTX = true; HAS_GOT_TX_CTX = false; WRITE_SQL_BY_CONN(sys_conn, "alter system minor freeze tenant tt1 ls 1001 tablet_id = 49401;"); - - // 等待一段时间保证上下文表的转储已经拿到了带有undo node的tx data + // Wait for a while to ensure that the context table dump has obtained tx data with undo node while (!HAS_GOT_TX_CTX) { fprintf(stdout, "waitting for scheduling tx ctx table merge dag ...\n"); sleep(2); } - - // 再次执行rollback,预期能merge掉第一次回滚产生的undo action + // Again execute rollback, expect to merge the undo action generated by the first rollback WRITE_SQL_BY_CONN(tt1_conn, "rollback to savepoint x1"); { sqlclient::ObISQLConnection *tt1_conn_2 = nullptr; @@ -248,8 +239,7 @@ void ObTxCtxTableTest::dump_ctx_with_merged_undo_action() } } } - - // 确认上下文表转储成功 + // Confirm context table dump successful HEAP_VAR(ObMySQLProxy::MySQLResult, res_2) { common::sqlclient::ObMySQLResult *result = nullptr; diff --git a/mittest/simple_server/test_tx_data.cpp b/mittest/simple_server/test_tx_data.cpp index 419ccfa6f..289e30012 100644 --- a/mittest/simple_server/test_tx_data.cpp +++ b/mittest/simple_server/test_tx_data.cpp @@ -1,16 +1,20 @@ // owner: gengli.wzy // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -47,7 +51,7 @@ TestRunCtx R; class ObTxDataTest : public ObSimpleClusterTestBase { public: - // 指定case运行目录前缀 test_ob_simple_cluster_ + // Specify the case run directory prefix test_ob_simple_cluster_ ObTxDataTest() : ObSimpleClusterTestBase("test_tx_data_", "50G", "50G") {} }; @@ -55,22 +59,21 @@ TEST_F(ObTxDataTest, observer_start) { SERVER_LOG(INFO, "observer_start succ"); } - -// 创建租户并不轻量,看场景必要性使用 +// Creating a tenant is not lightweight, consider the necessity of use based on the scenario TEST_F(ObTxDataTest, add_tenant) { - // 创建普通租户tt1 + // Create normal tenant tt1 ASSERT_EQ(OB_SUCCESS, create_tenant("tt1", "40G", "40G", false, 10)); - // 获取租户tt1的tenant_id + // Get the tenant_id of tenant tt1 ASSERT_EQ(OB_SUCCESS, get_tenant_id(R.tenant_id_)); ASSERT_NE(0, R.tenant_id_); - // 初始化普通租户tt1的sql proxy + // Initialize the sql proxy for normal tenant tt1 ASSERT_EQ(OB_SUCCESS, get_curr_simple_server().init_sql_proxy2()); } TEST_F(ObTxDataTest, create_new_ls) { - // 在单节点ObServer下创建新的日志流, 注意避免被RS任务GC掉 + // Create a new log stream under a single-node ObServer, note to avoid being GC'd by RS tasks EQ(0, SSH::create_ls(R.tenant_id_, get_curr_observer().self_addr_)); int64_t ls_count = 0; EQ(0, SSH::g_select_int64(R.tenant_id_, "select count(ls_id) as val from __all_ls where ls_id!=1", ls_count)); diff --git a/mittest/simple_server/test_tx_data_minor.cpp b/mittest/simple_server/test_tx_data_minor.cpp index 96151f3d4..cca39477e 100644 --- a/mittest/simple_server/test_tx_data_minor.cpp +++ b/mittest/simple_server/test_tx_data_minor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -59,7 +63,7 @@ TestRunCtx RunCtx; class ObTxDataMinorTest : public ObSimpleClusterTestBase { public: - // 指定case运行目录前缀 test_ob_simple_cluster_ + // Specify the case run directory prefix test_ob_simple_cluster_ ObTxDataMinorTest() : ObSimpleClusterTestBase("test_tx_data_minor_") {} void insert_and_freeze(); diff --git a/mittest/simple_server/test_tx_data_table_mit.cpp b/mittest/simple_server/test_tx_data_table_mit.cpp index e7b2e004e..fce9de81c 100644 --- a/mittest/simple_server/test_tx_data_table_mit.cpp +++ b/mittest/simple_server/test_tx_data_table_mit.cpp @@ -1,16 +1,20 @@ // owner: gengli.wzy // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -343,8 +347,7 @@ void ObTxDataTableTest::check_minor_merge() HEAP_VAR(ObMySQLProxy::MySQLResult, res) { int64_t retry_times = 10; - - // 确认MINI MERGE 并行转储正确 + // Confirm MINI MERGE parallel dump is correct int64_t cnt = 0; while (--retry_times >= 0) { ASSERT_EQ(OB_SUCCESS, @@ -363,9 +366,7 @@ void ObTxDataTableTest::check_minor_merge() } } // ASSERT_GT(cnt, 0); - - - // 确认没有未能转储的memtable + // Confirm there are no undumped memtables retry_times = 10; while (--retry_times >= 0) { ASSERT_EQ(OB_SUCCESS, diff --git a/mittest/simple_server/test_tx_recovery.cpp b/mittest/simple_server/test_tx_recovery.cpp index 440fc7536..892e6dff5 100644 --- a/mittest/simple_server/test_tx_recovery.cpp +++ b/mittest/simple_server/test_tx_recovery.cpp @@ -1,16 +1,20 @@ // owner: handora.qc // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/test_tx_recovery2.cpp b/mittest/simple_server/test_tx_recovery2.cpp index 82d098add..c5758cf0d 100644 --- a/mittest/simple_server/test_tx_recovery2.cpp +++ b/mittest/simple_server/test_tx_recovery2.cpp @@ -1,16 +1,20 @@ // owner: handora.qc // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/test_tx_recovery3.cpp b/mittest/simple_server/test_tx_recovery3.cpp index 0ec6d4eaa..4d4ba4e13 100644 --- a/mittest/simple_server/test_tx_recovery3.cpp +++ b/mittest/simple_server/test_tx_recovery3.cpp @@ -1,16 +1,20 @@ // owner: handora.qc // owner group: transaction -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include diff --git a/mittest/simple_server/test_update_tablet_directly_when_mini.cpp b/mittest/simple_server/test_update_tablet_directly_when_mini.cpp index 945abc1cc..80c84f53f 100644 --- a/mittest/simple_server/test_update_tablet_directly_when_mini.cpp +++ b/mittest/simple_server/test_update_tablet_directly_when_mini.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -128,4 +132,4 @@ int main(int argc, char **argv) OB_LOGGER.set_log_level("INFO"); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/rpm/oceanbase-lite-build.sh b/rpm/oceanbase-lite-build.sh new file mode 100644 index 000000000..4f96525c7 --- /dev/null +++ b/rpm/oceanbase-lite-build.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +PROJECT_DIR=$1 +PROJECT_NAME=$2 +VERSION=$3 +RELEASE=$4 + +CURDIR=$PWD +TOP_DIR=`pwd`/../ + +OB_DISABLE_LSE_OPTION="" +[[ $OB_DISABLE_LSE == "1" ]] && OB_DISABLE_LSE_OPTION="-DOB_DISABLE_LSE=ON" + +echo "[BUILD] args: TOP_DIR=${TOP_DIR} PROJECT_NAME=${PROJECT_NAME} VERSION=${VERSION} RELEASE=${RELEASE} ${OB_DISABLE_LSE_OPTION}" + +cd ${TOP_DIR} +./build.sh clean +./build.sh \ + rpm \ + -DOB_RELEASEID=$RELEASE \ + -DBUILD_NUMBER=$RELEASE \ + -DUSE_LTO_CACHE=ON \ + ${OB_DISABLE_LSE_OPTION} \ + --init \ + --make rpm || exit 1 + +cd ${TOP_DIR}/build_rpm +mv *.rpm $CURDIR || exit 2 diff --git a/src/diagnose/lua/ob_lua_api.cpp b/src/diagnose/lua/ob_lua_api.cpp index ed73f88df..f978cb856 100644 --- a/src/diagnose/lua/ob_lua_api.cpp +++ b/src/diagnose/lua/ob_lua_api.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_lua_api.h" diff --git a/src/diagnose/lua/ob_lua_api.h b/src/diagnose/lua/ob_lua_api.h index bf81cf8d9..0e9c898ee 100644 --- a/src/diagnose/lua/ob_lua_api.h +++ b/src/diagnose/lua/ob_lua_api.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEANBASE_OB_LUA_API_ @@ -66,4 +70,4 @@ class APIRegister } // oceanbase -#endif //_OCEANBASE_OB_LUA_API_ \ No newline at end of file +#endif //_OCEANBASE_OB_LUA_API_ diff --git a/src/diagnose/lua/ob_lua_handler.cpp b/src/diagnose/lua/ob_lua_handler.cpp index 7ffc16344..b9728596a 100644 --- a/src/diagnose/lua/ob_lua_handler.cpp +++ b/src/diagnose/lua/ob_lua_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_lua_api.h" diff --git a/src/diagnose/lua/ob_lua_handler.h b/src/diagnose/lua/ob_lua_handler.h index 477d8bc33..3bf97de09 100644 --- a/src/diagnose/lua/ob_lua_handler.h +++ b/src/diagnose/lua/ob_lua_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEANBASE_OB_LUA_HANDLER_ diff --git a/src/libtable/examples/ob_kvtable_benchmark.cpp b/src/libtable/examples/ob_kvtable_benchmark.cpp index 1787837a3..ef76941dd 100644 --- a/src/libtable/examples/ob_kvtable_benchmark.cpp +++ b/src/libtable/examples/ob_kvtable_benchmark.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "libobtable.h" diff --git a/src/libtable/examples/ob_kvtable_example.cpp b/src/libtable/examples/ob_kvtable_example.cpp index fc77cd7da..90383cb3c 100644 --- a/src/libtable/examples/ob_kvtable_example.cpp +++ b/src/libtable/examples/ob_kvtable_example.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "libobtable.h" diff --git a/src/libtable/examples/ob_pstore_example.cpp b/src/libtable/examples/ob_pstore_example.cpp index 82074d37c..6f62bca0c 100644 --- a/src/libtable/examples/ob_pstore_example.cpp +++ b/src/libtable/examples/ob_pstore_example.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "libobtable.h" diff --git a/src/libtable/examples/ob_table_example.cpp b/src/libtable/examples/ob_table_example.cpp index 243e37fc6..8435245d3 100644 --- a/src/libtable/examples/ob_table_example.cpp +++ b/src/libtable/examples/ob_table_example.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "libobtable.h" diff --git a/src/libtable/src/libobtable.cpp b/src/libtable/src/libobtable.cpp index d961a6c87..8e9d4c425 100644 --- a/src/libtable/src/libobtable.cpp +++ b/src/libtable/src/libobtable.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX CLIENT diff --git a/src/libtable/src/libobtable.h b/src/libtable/src/libobtable.h index 7f3d85c72..88ee0f7ab 100644 --- a/src/libtable/src/libobtable.h +++ b/src/libtable/src/libobtable.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _LIBOBTABLE_H diff --git a/src/libtable/src/ob_hkv_table.cpp b/src/libtable/src/ob_hkv_table.cpp index 1efa64eea..1ed5e2dce 100644 --- a/src/libtable/src/ob_hkv_table.cpp +++ b/src/libtable/src/ob_hkv_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX CLIENT diff --git a/src/libtable/src/ob_hkv_table.h b/src/libtable/src/ob_hkv_table.h index d2b03185b..9357ea3e6 100644 --- a/src/libtable/src/ob_hkv_table.h +++ b/src/libtable/src/ob_hkv_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_KV_TABLE_H diff --git a/src/libtable/src/ob_pstore.cpp b/src/libtable/src/ob_pstore.cpp index 178404894..72b77bd31 100644 --- a/src/libtable/src/ob_pstore.cpp +++ b/src/libtable/src/ob_pstore.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX CLIENT diff --git a/src/libtable/src/ob_pstore.h b/src/libtable/src/ob_pstore.h index aa56daf0f..ead247e16 100644 --- a/src/libtable/src/ob_pstore.h +++ b/src/libtable/src/ob_pstore.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_PSTORE_H diff --git a/src/libtable/src/ob_table.h b/src/libtable/src/ob_table.h index 87d81c6db..5970f150b 100644 --- a/src/libtable/src/ob_table.h +++ b/src/libtable/src/ob_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_H diff --git a/src/libtable/src/ob_table_define.h b/src/libtable/src/ob_table_define.h index 55fe26ee7..a446286a1 100644 --- a/src/libtable/src/ob_table_define.h +++ b/src/libtable/src/ob_table_define.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_DEFINE_H diff --git a/src/libtable/src/ob_table_impl.cpp b/src/libtable/src/ob_table_impl.cpp index 2690fd6af..52c61dd88 100644 --- a/src/libtable/src/ob_table_impl.cpp +++ b/src/libtable/src/ob_table_impl.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX CLIENT diff --git a/src/libtable/src/ob_table_impl.h b/src/libtable/src/ob_table_impl.h index 343466222..1d997d06a 100644 --- a/src/libtable/src/ob_table_impl.h +++ b/src/libtable/src/ob_table_impl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_IMPL_H diff --git a/src/libtable/src/ob_table_rpc_impl.cpp b/src/libtable/src/ob_table_rpc_impl.cpp index 39097bb4c..29af71173 100644 --- a/src/libtable/src/ob_table_rpc_impl.cpp +++ b/src/libtable/src/ob_table_rpc_impl.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX CLIENT diff --git a/src/libtable/src/ob_table_rpc_impl.h b/src/libtable/src/ob_table_rpc_impl.h index 2d1c45850..46e93f637 100644 --- a/src/libtable/src/ob_table_rpc_impl.h +++ b/src/libtable/src/ob_table_rpc_impl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_RPC_IMPL_H diff --git a/src/libtable/src/ob_table_service_client.cpp b/src/libtable/src/ob_table_service_client.cpp index f76ef8dbc..7e0ab237c 100644 --- a/src/libtable/src/ob_table_service_client.cpp +++ b/src/libtable/src/ob_table_service_client.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX CLIENT diff --git a/src/libtable/src/ob_table_service_client.h b/src/libtable/src/ob_table_service_client.h index 67500b7a7..dd6653abc 100644 --- a/src/libtable/src/ob_table_service_client.h +++ b/src/libtable/src/ob_table_service_client.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_SERVICE_CLIENT_H diff --git a/src/libtable/src/ob_table_service_config.h b/src/libtable/src/ob_table_service_config.h index cf5cf6245..f75c98644 100644 --- a/src/libtable/src/ob_table_service_config.h +++ b/src/libtable/src/ob_table_service_config.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_SERVICE_CONFIG_H diff --git a/src/libtable/src/ob_tablet_location_proxy.cpp b/src/libtable/src/ob_tablet_location_proxy.cpp index 7050e730e..7995c4acb 100644 --- a/src/libtable/src/ob_tablet_location_proxy.cpp +++ b/src/libtable/src/ob_tablet_location_proxy.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX CLIENT diff --git a/src/libtable/src/ob_tablet_location_proxy.h b/src/libtable/src/ob_tablet_location_proxy.h index cb64a75ee..912f0a0d9 100644 --- a/src/libtable/src/ob_tablet_location_proxy.h +++ b/src/libtable/src/ob_tablet_location_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLET_LOCATION_PROXY_H diff --git a/src/libtable/test/ob_batch_execute_test.cpp b/src/libtable/test/ob_batch_execute_test.cpp index 4d026c835..4c15017d4 100644 --- a/src/libtable/test/ob_batch_execute_test.cpp +++ b/src/libtable/test/ob_batch_execute_test.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include @@ -3038,7 +3042,7 @@ TEST_F(TestBatchExecute, secondary_index) ASSERT_EQ(OB_SUCCESS, query.add_select_column(C1)); ASSERT_EQ(OB_SUCCESS, query.add_select_column(C2)); ASSERT_EQ(OB_SUCCESS, query.add_select_column(C3)); - // 扫描C2为1和2的所有数据 + // Scan all data for C2 as 1 and 2 ObObj pk_objs_start[1]; pk_objs_start[0].set_int(1); ObObj pk_objs_end[1]; @@ -3165,7 +3169,7 @@ TEST_F(TestBatchExecute, secondary_index) } ASSERT_EQ(OB_ITER_END, iter->get_next_entity(result_entity)); } - // 删除后一半row + // Delete the second half of the row batch_operation.reset(); result.reset(); for (int64_t i = 0; i < BATCH_SIZE/2; ++i) { @@ -3527,8 +3531,7 @@ TEST_F(TestBatchExecute, update_table_with_index_by_lowercase_rowkey) } ASSERT_EQ(OB_ITER_END, iter->get_next_entity(result_entity)); } - - // todo@wenqu: mysqlproxy使用时报-1044,后面再调通。 + // todo@wenqu: mysqlproxy returns -1044 when used, to be resolved later. // ObISQLClient::ReadResult res; // uint64_t tenant_id = service_client_->get_tenant_id(); // ObString col_val; @@ -4736,7 +4739,7 @@ TEST_F(TestBatchExecute, single_insert_up) value.set_double(c2_value); ASSERT_EQ(OB_SUCCESS, entity->set_property(C2, value)); ObTableOperation table_operation = ObTableOperation::insert_or_update(*entity); - // TODO:@linjing 和sql行为不一致 + // TODO:@linjing and sql behavior is inconsistent ASSERT_EQ(OB_ERR_UPDATE_ROWKEY_COLUMN, the_table->execute(table_operation, r)); ASSERT_EQ(OB_SUCCESS, r.get_errno()); ASSERT_EQ(0, r.get_affected_rows()); @@ -5307,7 +5310,7 @@ TEST_F(TestBatchExecute, multi_insert) ASSERT_TRUE(batch_operation.is_same_type()); ASSERT_TRUE(batch_operation.is_same_properties_names()); ObTableBatchOperationResult result; - // 冲突,但是非atomic,其他行可以写入 + // Conflict, but not atomic, other rows can be written ASSERT_EQ(OB_SUCCESS, the_table->batch_execute(batch_operation, result)); } } @@ -9342,8 +9345,8 @@ TEST_F(TestBatchExecute, htble_query_async) ASSERT_EQ(OB_ITER_END, ret); } ASSERT_EQ(OB_ITER_END, ret); - ASSERT_EQ(200, result_cnt); // set_max_versions(2),故只有200条 - ASSERT_EQ(round, query_round - 1); // start已经扫描了一次 + ASSERT_EQ(200, result_cnt); // set_max_versions(2), hence only 200 entries + ASSERT_EQ(round, query_round - 1); // start has already scanned once //////////////////////////////////////////////////////////////// // teardown service_client_->free_table(the_table); @@ -11352,14 +11355,14 @@ TEST_F(TestBatchExecute, atomic_batch_ops) ASSERT_EQ(OB_SUCCESS, entity->add_rowkey_value(key)); ASSERT_EQ(OB_SUCCESS, table_batch_operation.del(*entity)); } - // 当前的数据 + // Current data // +----+-------+------------------+----+ // | c1 | c2 | cast(c3 as char) | c4 | // +----+-------+------------------+----+ // | 5 | hello | world | 1 | // | 6 | hello | world | 1 | // +----+-------+------------------+----+ - // 删唯一索引的时候会报错4377,因为c2,c4联合唯一索引有两条一模一样的数据,第二次删除会找不到记录,第一次已经删完。 + // When deleting the unique index, error 4377 will be reported because the combined unique index of c2 and c4 has two identical records. The second deletion will not find the record as it has already been deleted in the first attempt. ASSERT_EQ(OB_ERR_DEFENSIVE_CHECK, table->batch_execute(table_batch_operation, req_options, result)); } @@ -11377,7 +11380,7 @@ TEST_F(TestBatchExecute, atomic_batch_ops) key.set_int(6); ASSERT_EQ(OB_SUCCESS, entity->add_rowkey_value(key)); table_operation = ObTableOperation::del(*entity); - // 第二条还是删不掉,遗留成为脏数据 + // The second one still can't be deleted, becoming dirty data // +----+-------+------------------+----+ // | c1 | c2 | cast(c3 as char) | c4 | // +----+-------+------------------+----+ diff --git a/src/logservice/applyservice/ob_log_apply_service.cpp b/src/logservice/applyservice/ob_log_apply_service.cpp index 695d8fa4c..183685873 100644 --- a/src/logservice/applyservice/ob_log_apply_service.cpp +++ b/src/logservice/applyservice/ob_log_apply_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_log_apply_service.h" @@ -139,7 +143,7 @@ ObApplyServiceQueueTask::~ObApplyServiceQueueTask() void ObApplyServiceQueueTask::reset() { if (!queue_.is_empty()) { - //防御性检查,默认apply status析构时队列一定为空 + //Defensive check, default apply status destructor queue must be empty CLOG_LOG_RET(ERROR, OB_ERR_UNEXPECTED, "queue is not empty when reset task", KPC(apply_status_)); } ObApplyServiceTask::reset(); @@ -402,7 +406,7 @@ int ObApplyStatus::push_append_cb(AppendCb *cb) CLOG_LOG(TRACE, "push_append_cb", K(thread_index), K(cb_lsn), K(cb_sign), K(cb_queues_[thread_index]), KPC(this)); palf_committed_end_lsn.val_ = ATOMIC_LOAD(&palf_committed_end_lsn_.val_); if (cb_lsn < palf_committed_end_lsn) { - // 需要调用on_success的cb进入队列时需要主动触发推入线程池 + // The cb that needs to call on_success should actively trigger the push into the thread pool when entering the queue if (OB_FAIL(submit_task_to_apply_service_(cb_queues_[thread_index]))) { CLOG_LOG(ERROR, "apply service push_task failed", K(thread_index), K(cb_lsn), K(cb_sign), KPC(this)); } else { @@ -472,7 +476,7 @@ int ObApplyStatus::try_handle_cb_queue(ObApplyServiceQueueTask *cb_queue, ret = OB_ERR_UNEXPECTED; CLOG_LOG(ERROR, "cb is NULL", KPC(cb_queue), KPC(this), K(ret)); } else if ((lsn = cb->__get_lsn()).val_ < ATOMIC_LOAD(&palf_committed_end_lsn_.val_)) { - // 小于确认日志位点的cb可以回调on_success + // callbacks with log position less than the confirmed log position can callback on_success ObDIActionGuard(cb->get_cb_name()); if (OB_FAIL(cb_queue->pop())) { CLOG_LOG(ERROR, "cb_queue pop failed", KPC(cb_queue), KPC(this), K(ret)); @@ -481,7 +485,7 @@ int ObApplyStatus::try_handle_cb_queue(ObApplyServiceQueueTask *cb_queue, get_cb_trace_(cb, append_start_time, append_finish_time, cb_first_handle_time, cb_start_time); CLOG_LOG(TRACE, "cb on_success", K(lsn), K(scn), KP(link->next_), KPC(cb_queue), KPC(this)); if (OB_FAIL(cb->on_success())) { - // 不处理此类失败情况 + // Do not handle this type of failure case CLOG_LOG(ERROR, "cb on_success failed", KP(cb), K(ret), KPC(this)); ret = OB_SUCCESS; } @@ -490,7 +494,7 @@ int ObApplyStatus::try_handle_cb_queue(ObApplyServiceQueueTask *cb_queue, cb_queue->inc_total_apply_cb_cnt(); } } else if (FOLLOWER == role_) { - // 大于确认日志位点的cb在applystatus切为follower应该回调on_failure + // Callbacks greater than the confirmed log position should be called back with on_failure when applystatus switches to follower if (OB_FAIL(cb_queue->pop())) { CLOG_LOG(ERROR, "cb_queue pop failed", KPC(cb_queue), KPC(this), K(ret)); } else { @@ -508,7 +512,7 @@ int ObApplyStatus::try_handle_cb_queue(ObApplyServiceQueueTask *cb_queue, } else { cb->set_cb_first_handle_ts(ObTimeUtility::fast_current_time()); CLOG_LOG(TRACE, "cb on_wait", K(lsn), K(cb->__get_scn()), KPC(cb_queue), KPC(this)); - // 等待确认日志位点推进或者角色切换 + // Wait for log position advancement or role switch ret = OB_EAGAIN; } if (OB_SUCC(ret) && !is_queue_empty) { @@ -519,7 +523,7 @@ int ObApplyStatus::try_handle_cb_queue(ObApplyServiceQueueTask *cb_queue, } } while (OB_SUCC(ret) && (!is_queue_empty) && (!is_timeslice_run_out)); if (OB_EAGAIN == ret) { - // end_lsn不够大时应该等待file_size_cb推此任务进线程池,所以对外需要屏蔽错误码 + // wait for file_size_cb to push this task into the thread pool when end_lsn is not large enough, so errors need to be masked externally ret = OB_SUCCESS; } } @@ -581,8 +585,7 @@ int ObApplyStatus::switch_to_follower() } return ret; } - -//需要锁保护 +//Needs lock protection int ObApplyStatus::switch_to_follower_() { int ret = OB_SUCCESS; @@ -593,7 +596,7 @@ int ObApplyStatus::switch_to_follower_() CLOG_LOG(INFO, "apply status has already been follower", KPC(this), K(ret)); } else { lib::ObMutexGuard guard(mutex_); - // truancate场景旧主的max_scn可能回退 + // truncate scenario the old leader's max_scn may roll back last_check_scn_.reset(); role_ = FOLLOWER; if (OB_FAIL(submit_task_to_apply_service_(submit_task_))) { @@ -604,8 +607,7 @@ int ObApplyStatus::switch_to_follower_() } return ret; } - -//单线程调用 +//Single-threaded call int ObApplyStatus::update_palf_committed_end_lsn(const palf::LSN &end_lsn, const SCN &end_scn, const int64_t proposal_id) @@ -633,12 +635,12 @@ int ObApplyStatus::update_palf_committed_end_lsn(const palf::LSN &end_lsn, } } else if ((proposal_id == curr_proposal_id && FOLLOWER == role_) || proposal_id < curr_proposal_id) { - // apply切为follower之后, 同proposal_id的日志不应该还能滑出 + // After apply switches to follower, logs with the same proposal_id should not be able to slide out ret = OB_ERR_UNEXPECTED; CLOG_LOG(ERROR, "invalid new end_lsn", KPC(this), K(proposal_id), K(end_lsn)); } else { CLOG_LOG(TRACE, "update_palf_committed_end_lsn skip", KPC(this), K(proposal_id), K(end_lsn)); - // palf已经切主,skip + // palf has already done a leader-follower switch, skip } } CLOG_LOG(TRACE, "update_palf_committed_end_lsn", KPC(this), K(proposal_id), K(end_lsn), KR(ret)); @@ -677,7 +679,7 @@ void ObApplyStatus::close_palf_handle() int ObApplyStatus::get_max_applied_scn(SCN &scn) { int ret = OB_SUCCESS; - //保证此接口不会被并发调用, 两把锁的顺序不能更改 + //Ensure this interface is not called concurrently, the order of the two locks cannot be changed RLockGuard rguard(lock_); lib::ObMutexGuard guard(mutex_); const SCN last_check_scn = last_check_scn_; @@ -685,7 +687,7 @@ int ObApplyStatus::get_max_applied_scn(SCN &scn) ret = OB_NOT_INIT; CLOG_LOG(ERROR, "apply status has not been inited", K(ret)); } else if (OB_UNLIKELY(is_in_stop_state_)) { - // stop后不会再上任, 始终返回上轮作为leader时缓存的值 + // After stopping, it will no longer take office, and will always return the cached value from the last round as leader } else if (FOLLOWER == role_) { //The max_applied_cb_scn_ undergoes asynchronous updating, and under circumstances where a //transiting to a follower role, there exists a possibility that its recorded value might underestimate the actual one. @@ -700,9 +702,9 @@ int ObApplyStatus::get_max_applied_scn(SCN &scn) } else if (OB_FAIL(is_apply_done(is_done, apply_end_lsn))) { CLOG_LOG(WARN, "check is_apply_done failed", K(ret), KPC(this)); } else if (!is_done) { - // follower期间cb未完全回调之前暂不做任何更新 - // 始终返回上轮作为leader时缓存的值 - // 所有cb回调完成后, 尝试推进一次最大连续回调位点 + // During the follower period, do not make any updates until cb is fully called back + // Always return the value cached from the last round when it was the leader + // All cb callbacks completed, attempt to advance the maximum consecutive callback point once } else if (max_applied_cb_scn_ < cur_palf_committed_end_scn) { max_applied_cb_scn_ = cur_palf_committed_end_scn; CLOG_LOG(INFO, "update max_applied_cb_scn_", K(cur_palf_committed_end_scn), KPC(this)); @@ -714,7 +716,7 @@ int ObApplyStatus::get_max_applied_scn(SCN &scn) //do nothing } } else if (!max_applied_cb_scn_.is_valid() || last_check_scn > max_applied_cb_scn_) { - // 检查last_check_scn_是否都已经回调完成 + // Check if last_check_scn_ has already been callback completed bool is_done = true; for (int64_t i = 0; OB_SUCC(ret) && is_done && i < APPLY_TASK_QUEUE_SIZE; ++i) { if (OB_FAIL(cb_queues_[i].is_snapshot_apply_done(is_done))) { @@ -835,7 +837,7 @@ int ObApplyStatus::update_last_check_scn_() } else if (OB_FAIL(palf_handle_.get_role(palf_role, palf_proposal_id, is_pending_state))) { CLOG_LOG(WARN, "palf get_role failed", K(ret), K(ls_id_)); } else if (max_applied_cb_scn_.is_valid() && palf_max_scn < max_applied_cb_scn_) { - //防御性检查, palf的max_scn不应该回退到已达成一致的max_applied_cb_scn_之前 + //Defensive check, palf's max_scn should not regress to before the agreed max_applied_cb_scn_ ret = OB_ERR_UNEXPECTED; CLOG_LOG(ERROR, "invalid palf_max_scn", K(ret), K(ls_id_), K(palf_max_scn), KPC(this)); } else if ((palf_proposal_id != curr_proposal_id) || (FOLLOWER == palf_role)) { @@ -843,7 +845,7 @@ int ObApplyStatus::update_last_check_scn_() ret = OB_ERR_UNEXPECTED; CLOG_LOG(ERROR, "invalid palf_proposal_id", K(ret), K(ls_id_), K(palf_proposal_id), KPC(this)); } else { - // palf已经切主, max_scn可能包含其他新主的日志, do nothing + // palf has switched leader, max_scn may contain logs from the new leader, do nothing CLOG_LOG(TRACE, "skip update_last_check_scn", K(ret), K(ls_id_), K(palf_max_scn), K(palf_proposal_id), KPC(this)); } } else if (OB_FAIL(ap_sv_->wait_append_sync(ls_id_))) { @@ -1103,7 +1105,7 @@ void ObLogApplyService::stop() { CLOG_LOG(INFO, "ObLogApplyService stop begin"); ATOMIC_STORE(&is_running_, false); - //保证handle_drop时不再会有新任务进入线程池 + //Ensure that no new tasks will enter the thread pool when handle_drop is called TG_STOP(tg_id_); CLOG_LOG(INFO, "ObLogApplyService stop finish"); } @@ -1120,9 +1122,9 @@ void ObLogApplyService::wait() CLOG_LOG(WARN, "ObLogApplyService failed to get queue number"); } TG_WAIT(tg_id_); - //此时可以保证不会有新的queue任务进入线程池, - //同时所有其他模块均调用了stop所以也不会有新的cb进入queue - //可以安全清理所有残留的cb + //At this point, it can be guaranteed that no new queue tasks will enter the thread pool, + //At the same time, all other modules have called stop, so no new cb will enter the queue + //It is safe to clean up all remaining cbs remove_all_ls_(); CLOG_LOG(INFO, "ObLogApplyService wait finish"); } @@ -1298,7 +1300,7 @@ int ObLogApplyService::push_task(ObApplyServiceTask *task) CLOG_LOG(ERROR, "task is NULL", K(ret)); } else { while (OB_FAIL(TG_PUSH_TASK(tg_id_, task)) && OB_EAGAIN == ret) { - //预期不会失败 + //Expected not to fail ob_throttle_usleep(1000, ret); //1ms CLOG_LOG(ERROR, "failed to push", K(ret)); } @@ -1421,7 +1423,7 @@ int ObLogApplyService::wait_append_sync(const share::ObLSID &ls_id) CLOG_LOG(WARN, "ObLogApplyService not init", K(ret)); } else if (OB_FAIL(ls_adapter_->wait_append_sync(ls_id))) { CLOG_LOG(WARN, "wait_append_sync failed", K(ret), K(ls_id)); - // TODO:@keqing.llt 发版前移除 + // TODO:@keqing.llt Remove before release } else { int64_t cost_time = ObTimeUtility::fast_current_time() - start_ts; if (cost_time > 10 * 1000) { //10ms @@ -1495,8 +1497,7 @@ int ObLogApplyService::handle_submit_task_(ObApplyStatus *apply_status) } return ret; } - -//析构时调用,归还所有日志流的计数 +// Called during destruction, return the count of all log streams int ObLogApplyService::remove_all_ls_() { int ret = OB_SUCCESS; diff --git a/src/logservice/applyservice/ob_log_apply_service.h b/src/logservice/applyservice/ob_log_apply_service.h index da8534ab9..ebc4cce8c 100644 --- a/src/logservice/applyservice/ob_log_apply_service.h +++ b/src/logservice/applyservice/ob_log_apply_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_APPLY_SERVICE_ @@ -46,8 +50,7 @@ enum class ObApplyServiceTaskType SUBMIT_LOG_TASK = 1, APPLY_LOG_TASK = 2, }; - -//虚拟表统计 +//Virtual table statistics struct LSApplyStat { int64_t ls_id_; @@ -163,27 +166,27 @@ class ObApplyStatus int stop(); void inc_ref(); int64_t dec_ref(); - //任务相关 + //task related int push_append_cb(AppendCb *cb); int try_submit_cb_queues(); int try_handle_cb_queue(ObApplyServiceQueueTask *cb_queue, bool &is_timeslice_run_out); int is_apply_done(bool &is_done, palf::LSN &end_lsn); - //主备切换相关 - //int can_switch_to_follower(bool &can_revoke); //非最大保护模式不需要 + //leader-follower switch related + //int can_switch_to_follower(bool &can_revoke); //Non-maximum protection mode does not require int switch_to_leader(const int64_t new_proposal_id); int switch_to_follower(); - //palf相关 + //palf related int update_palf_committed_end_lsn(const palf::LSN &end_lsn, const share::SCN &end_scn, const int64_t proposal_id); share::SCN get_palf_committed_end_scn() const; int unregister_file_size_cb(); void close_palf_handle(); - //最大连续回调位点 + //maximum consecutive callback point int get_max_applied_scn(share::SCN &scn); int stat(LSApplyStat &stat) const; int handle_drop_cb(); int diagnose(ApplyDiagnoseInfo &diagnose_info); - // offline相关 + // offline related // // The constraint between palf and apply: // @@ -220,7 +223,7 @@ class ObApplyStatus int update_last_check_scn_(); int handle_drop_cb_queue_(ObApplyServiceQueueTask &cb_queue); int switch_to_follower_(); - //从cb中获取打点信息 + //Get profiling information from cb void get_cb_trace_(AppendCb *cb, int64_t &append_start_time, int64_t &append_finish_time, @@ -242,7 +245,7 @@ class ObApplyStatus const int64_t WRLOCK_RETRY_INTERVAL_US = 20 * 1000; // 20ms private: bool is_inited_; - bool is_in_stop_state_; //stop后不能上任, 残留的cb会继续处理 + bool is_in_stop_state_; // after stop, it cannot take over, remaining cb will continue to be processed int64_t ref_cnt_; // guarantee the effectiveness of self memory share::ObLSID ls_id_; common::ObRole role_; @@ -252,22 +255,22 @@ class ObApplyStatus share::SCN palf_committed_end_scn_; //LSN standy_committed_end_lsn_; //palf::LSN min_committed_end_lsn_; - share::SCN last_check_scn_; //当前待确认的最大连续回调位点 - share::SCN max_applied_cb_scn_; //该位点前的cb保证都已经回调完成 + share::SCN last_check_scn_; //The maximum continuous callback point to be confirmed currently + share::SCN max_applied_cb_scn_; // The callbacks for cb before this point are guaranteed to be completed ObApplyServiceSubmitTask submit_task_; ObApplyServiceQueueTask cb_queues_[APPLY_TASK_QUEUE_SIZE]; palf::PalfEnv *palf_env_; palf::PalfHandle palf_handle_; ObApplyFsCb fs_cb_; - mutable RWLock lock_; //保护role_, proposal_id_及is_in_stop_state_ - mutable lib::ObMutex mutex_; //互斥获取最大连续位点不会被并发调用 + mutable RWLock lock_; // protect role_, proposal_id_ and is_in_stop_state_ + mutable lib::ObMutex mutex_; // Mutex for acquiring the maximum consecutive checkpoint will not be called concurrently mutable int64_t get_info_debug_time_; mutable int64_t try_wrlock_debug_time_; - ObMiniStat::ObStatItem cb_append_stat_; //获取lsn和ts的耗时 - ObMiniStat::ObStatItem cb_wait_thread_stat_; //等待首次线程调度的耗时, 此次处理不一定会回调 - ObMiniStat::ObStatItem cb_wait_commit_stat_; //从第一次被处理到真正回调之间的耗时 - ObMiniStat::ObStatItem cb_execute_stat_; //cb执行on_success/on_failure的耗时 - ObMiniStat::ObStatItem cb_stat_; //cb从产生到执行on_success的耗时 + ObMiniStat::ObStatItem cb_append_stat_; //Get the time cost of obtaining lsn and ts + ObMiniStat::ObStatItem cb_wait_thread_stat_; //Waiting time for the first thread scheduling, this processing may not result in a callback + ObMiniStat::ObStatItem cb_wait_commit_stat_; //Time spent from the first processing to the actual callback + ObMiniStat::ObStatItem cb_execute_stat_; //cb execute on_success/on_failure time consumption + ObMiniStat::ObStatItem cb_stat_; // Time taken from cb generation to on_success execution }; class ObLogApplyService : public lib::TGLinkTaskHandler @@ -325,7 +328,7 @@ class ObLogApplyService : public lib::TGLinkTaskHandler private: int ret_code_; }; - //删除并清理所有cb + //Delete and clean up all cb class ResetApplyStatusFunctor { public: diff --git a/src/logservice/common_util/ob_log_ls_define.cpp b/src/logservice/common_util/ob_log_ls_define.cpp index 98bd62bbd..e71f752b5 100644 --- a/src/logservice/common_util/ob_log_ls_define.cpp +++ b/src/logservice/common_util/ob_log_ls_define.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_log_ls_define.h" diff --git a/src/logservice/common_util/ob_log_ls_define.h b/src/logservice/common_util/ob_log_ls_define.h index 50e79c31d..f9b0746bf 100644 --- a/src/logservice/common_util/ob_log_ls_define.h +++ b/src/logservice/common_util/ob_log_ls_define.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_COMMON_LS_DEFINE_H_ diff --git a/src/logservice/common_util/ob_log_table_operator.h b/src/logservice/common_util/ob_log_table_operator.h index ec7a79f5c..fd53f6d6f 100644 --- a/src/logservice/common_util/ob_log_table_operator.h +++ b/src/logservice/common_util/ob_log_table_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_COMMON_TABLE_OPERATOR_H_ diff --git a/src/logservice/common_util/ob_log_time_utils.cpp b/src/logservice/common_util/ob_log_time_utils.cpp index 599fd5f15..784f2b720 100644 --- a/src/logservice/common_util/ob_log_time_utils.cpp +++ b/src/logservice/common_util/ob_log_time_utils.cpp @@ -1,15 +1,18 @@ -/** -* Copyright (c) 2023 OceanBase -* OceanBase CE is licensed under Mulan PubL v2. -* You can use this software according to the terms and conditions of the Mulan PubL v2. -* You may obtain a copy of Mulan PubL v2 at: -* http://license.coscl.org.cn/MulanPubL-2.0 -* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -* See the Mulan PubL v2 for more details. -* -*/ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #include "ob_log_time_utils.h" diff --git a/src/logservice/common_util/ob_log_time_utils.h b/src/logservice/common_util/ob_log_time_utils.h index fd5a5bcd3..6da063ad3 100644 --- a/src/logservice/common_util/ob_log_time_utils.h +++ b/src/logservice/common_util/ob_log_time_utils.h @@ -1,15 +1,18 @@ -/** -* Copyright (c) 2023 OceanBase -* OceanBase CE is licensed under Mulan PubL v2. -* You can use this software according to the terms and conditions of the Mulan PubL v2. -* You may obtain a copy of Mulan PubL v2 at: -* http://license.coscl.org.cn/MulanPubL-2.0 -* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -* See the Mulan PubL v2 for more details. -* -*/ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #ifndef OCEANBASE_LOGSERVICE_COMMON_TIME_UTILS_H_ #define OCEANBASE_LOGSERVICE_COMMON_TIME_UTILS_H_ diff --git a/src/logservice/leader_coordinator/common_define.h b/src/logservice/leader_coordinator/common_define.h index 7b61058a0..305ec6591 100644 --- a/src/logservice/leader_coordinator/common_define.h +++ b/src/logservice/leader_coordinator/common_define.h @@ -1,17 +1,21 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_COORDINATOR_COMMON_DEFINE_H #define LOGSERVICE_COORDINATOR_COMMON_DEFINE_H #define COORDINATOR_LOG_(args...) COORDINATOR_LOG(args, PRINT_WRAPPER) #define LC_TIME_GUARD(threshold) TIMEGUARD_INIT(COORDINATOR, threshold, 60_s) -#endif \ No newline at end of file +#endif diff --git a/src/logservice/leader_coordinator/election_priority_impl/election_priority_impl.cpp b/src/logservice/leader_coordinator/election_priority_impl/election_priority_impl.cpp index 2eb3ee3f7..e1305a580 100644 --- a/src/logservice/leader_coordinator/election_priority_impl/election_priority_impl.cpp +++ b/src/logservice/leader_coordinator/election_priority_impl/election_priority_impl.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "election_priority_impl.h" @@ -124,7 +128,7 @@ int ElectionPriorityImpl::deserialize(const char* buf, const int64_t data_len, i } else if (OB_UNLIKELY(!functor.is_decoded_success())) { COORDINATOR_LOG_(INFO, "this type not found in tuple, maybe is a new priority type, just skip the buffer"); pos = functor.get_started_pos(); - pos += data_size;// 跳过这个对象 + pos += data_size;// skip this object } else { COORDINATOR_LOG_(DEBUG, "decode element success"); } @@ -191,7 +195,7 @@ int ElectionPriorityImpl::compare_with(const ElectionPriority &rhs, { LC_TIME_GUARD(1_s); int ret = OB_SUCCESS; - // 这里如果转型失败直接抛异常,但设计上转型不会失败 + // Here, if the cast fails, an exception is thrown directly, but by design, the cast will not fail const ElectionPriorityImpl &rhs_impl = dynamic_cast(rhs); GetClosestVersionPriority functor1(compare_version); GetClosestVersionPriority functor2(compare_version); @@ -301,4 +305,4 @@ bool ElectionPriorityImpl::has_fatal_failure() const } } -} \ No newline at end of file +} diff --git a/src/logservice/leader_coordinator/election_priority_impl/election_priority_impl.h b/src/logservice/leader_coordinator/election_priority_impl/election_priority_impl.h index f89cc6d77..feef6f2f6 100644 --- a/src/logservice/leader_coordinator/election_priority_impl/election_priority_impl.h +++ b/src/logservice/leader_coordinator/election_priority_impl/election_priority_impl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_COORDINATOR_ELECTION_PRIORITY_IMPL_H @@ -43,15 +47,15 @@ struct AbstractPriority { friend class unittest::TestElectionPriority; AbstractPriority() : is_valid_(false) {} - // 判断该优先级从哪个版本开始生效 + // Determine from which version this priority starts to take effect virtual uint64_t get_started_version() const = 0; - // 序列化相关 + // Serialization related virtual int serialize(char* buf, const int64_t buf_len, int64_t& pos) const = 0; virtual int deserialize(const char* buf, const int64_t data_len, int64_t& pos) = 0; virtual int64_t get_serialize_size(void) const = 0; - // 相同优先级版本的比较策略 + // Comparison strategy for versions with the same priority virtual int compare(const AbstractPriority &rhs, int &result, ObStringHolder &reason) const = 0; - // 刷新优先级的方法 + // The method to refresh priority int refresh(const share::ObLSID &ls_id) { int ret = OB_SUCCESS; is_valid_ = false; @@ -60,9 +64,9 @@ struct AbstractPriority } return ret; } - // 判断字段内容是否有效的方法,或者refresh()成功后也是true + // The method to determine if the field content is valid, or true after refresh() succeeds bool is_valid() const { return is_valid_; } - // fatal failure将绕过RCS在选举层面直接切主 + // fatal failure will bypass RCS and directly perform a leader switch at the election level bool has_fatal_failure() const { return is_valid_ && has_fatal_failure_(); } virtual TO_STRING_KV(K_(is_valid)); protected: @@ -82,16 +86,16 @@ struct PriorityV1 : public AbstractPriority PriorityV1() : is_observer_stopped_(false), is_server_stopped_(false), is_zone_stopped_(false), is_primary_region_(false), is_in_blacklist_(false), is_manual_leader_(false), zone_priority_(INT64_MAX) {scn_.set_min();} - // 判断该优先级策略是否适用于特定的版本 + // Determine whether this priority strategy is applicable to a specific version virtual uint64_t get_started_version() const override { return CLUSTER_VERSION_1_0_0_0; } - // 相同优先级版本的比较策略 + // Comparison strategy for versions with the same priority virtual int compare(const AbstractPriority &rhs, int &result, ObStringHolder &reason) const override; // int assign(const PriorityV1 &rhs); TO_STRING_KV(K_(is_valid), K_(is_observer_stopped), K_(is_server_stopped), K_(is_zone_stopped), K_(fatal_failures), K_(is_primary_region), K_(serious_failures), K_(is_in_blacklist), K_(in_blacklist_reason), K_(scn), K_(is_manual_leader), K_(zone_priority)); protected: - // 刷新优先级的方法 + // The method to refresh priority virtual int refresh_(const share::ObLSID &ls_id) override; virtual bool has_fatal_failure_() const override; int get_scn_(const share::ObLSID &ls_id, share::SCN &scn); @@ -138,13 +142,13 @@ class ElectionPriorityImpl : public palf::election::ElectionPriority ElectionPriorityImpl(const share::ObLSID ls_id) : ls_id_(ls_id), lock_(common::ObLatchIds::ELECTION_LOCK) {} virtual ~ElectionPriorityImpl() {} void set_ls_id(const share::ObLSID ls_id); - // 优先级需要序列化能力,以便通过消息传递给其他副本 + // Priority needs serialization capability to be passed to other replicas via messages virtual int serialize(char* buf, const int64_t buf_len, int64_t& pos) const; virtual int deserialize(const char* buf, const int64_t data_len, int64_t& pos); virtual int64_t get_serialize_size(void) const; - // 主动刷新选举优先级的方法 + // The method for actively refreshing election priority virtual int refresh(); - // 在priority间进行比较的方法 + // The method for comparing between priorities virtual int compare_with(const palf::election::ElectionPriority &rhs, const uint64_t compare_version, const bool decentralized_voting, @@ -152,7 +156,7 @@ class ElectionPriorityImpl : public palf::election::ElectionPriority ObStringHolder &reason) const; virtual int get_size_of_impl_type() const; virtual void placement_new_impl(void *ptr) const; - // fatal failure跳过RCS直接切主 + // fatal failure skip RCS directly switch to leader virtual bool has_fatal_failure() const; int64_t to_string(char *buf, const int64_t buf_len) const override; private: diff --git a/src/logservice/leader_coordinator/election_priority_impl/election_priority_v1.cpp b/src/logservice/leader_coordinator/election_priority_impl/election_priority_v1.cpp index bb3a13368..0228d6b41 100644 --- a/src/logservice/leader_coordinator/election_priority_impl/election_priority_v1.cpp +++ b/src/logservice/leader_coordinator/election_priority_impl/election_priority_v1.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "logservice/ob_log_service.h" @@ -29,35 +33,35 @@ int PriorityV1::compare(const AbstractPriority &rhs, int &result, ObStringHolder LC_TIME_GUARD(1_s); #define PRINT_WRAPPER KR(ret), K(MTL_ID()), K(*this), K(rhs), K(result), K(reason) int ret = OB_SUCCESS; - // 这里如果转型失败直接抛异常,但设计上转型不会失败 + // Here, if the cast fails, an exception is thrown directly, but by design, the cast will not fail const PriorityV1 &rhs_impl = dynamic_cast(rhs); - if (COMPARE_OUT(compare_observer_stopped_(ret, rhs_impl))) {// kill -15 导致observer stop + if (COMPARE_OUT(compare_observer_stopped_(ret, rhs_impl))) {// SIGTERM causes observer to stop (void) reason.assign("OBSERVER STOP"); COORDINATOR_LOG_(TRACE, "compare done! get compared result from is_observer_stopped_"); - } else if (COMPARE_OUT(compare_server_stopped_flag_(ret, rhs_impl))) {// 比较server是否被stop + } else if (COMPARE_OUT(compare_server_stopped_flag_(ret, rhs_impl))) {// Compare whether the server is stopped (void) reason.assign("SERVER STOPPED"); COORDINATOR_LOG_(TRACE, "compare done! get compared result from server_stopped_flag_"); - } else if (COMPARE_OUT(compare_zone_stopped_flag_(ret, rhs_impl))) {// 比较zone是否被stop + } else if (COMPARE_OUT(compare_zone_stopped_flag_(ret, rhs_impl))) {// Compare whether the zone is stopped (void) reason.assign("ZONE STOPPED"); COORDINATOR_LOG_(TRACE, "compare done! get compared result from zone_stopped_flag_"); - } else if (COMPARE_OUT(compare_fatal_failures_(ret, rhs_impl))) {// 比较致命的异常 + } else if (COMPARE_OUT(compare_fatal_failures_(ret, rhs_impl))) {// Compare fatal failures (void) reason.assign("FATAL FAILURE"); COORDINATOR_LOG_(TRACE, "compare done! get compared result from fatal_failures_"); - } else if (COMPARE_OUT(compare_scn_(ret, rhs_impl))) {// 避免切换至回放位点过小的副本 + } else if (COMPARE_OUT(compare_scn_(ret, rhs_impl))) {// Avoid switching to a replica with a replay point that is too small (void) reason.assign("LOG TS"); COORDINATOR_LOG_(TRACE, "compare done! get compared resultfrom scn_"); - } else if (COMPARE_OUT(compare_in_blacklist_flag_(ret, rhs_impl, reason))) {// 比较是否被标记删除 + } else if (COMPARE_OUT(compare_in_blacklist_flag_(ret, rhs_impl, reason))) {// Compare if marked for deletion COORDINATOR_LOG_(TRACE, "compare done! get compared result from in_blacklist_flag_"); - } else if (COMPARE_OUT(compare_manual_leader_flag_(ret, rhs_impl))) {// 比较是否存在用户指定的leader + } else if (COMPARE_OUT(compare_manual_leader_flag_(ret, rhs_impl))) {// Compare if there is a user-specified leader (void) reason.assign("MANUAL LEADER"); COORDINATOR_LOG_(TRACE, "compare done! get compared result from manual_leader_flag_"); - } else if (COMPARE_OUT(compare_primary_region_(ret, rhs_impl))) {// 通常Leader不能选出primary region + } else if (COMPARE_OUT(compare_primary_region_(ret, rhs_impl))) {// Normally Leader cannot elect primary region (void) reason.assign("PRIMARY REGION"); COORDINATOR_LOG_(TRACE, "compare done! get compared result from primary_region_"); - } else if (COMPARE_OUT(compare_serious_failures_(ret, rhs_impl))) {// 比较会导致切主的异常 + } else if (COMPARE_OUT(compare_serious_failures_(ret, rhs_impl))) {// Comparison will lead to a leader-follower switch exception (void) reason.assign("SERIOUS FAILURE"); COORDINATOR_LOG_(TRACE, "compare done! get compared result from serious_failures_"); - } else if (COMPARE_OUT(compare_zone_priority_(ret, rhs_impl))) {// 比较RS设置的zone priority + } else if (COMPARE_OUT(compare_zone_priority_(ret, rhs_impl))) {// Compare RS set zone priority (void) reason.assign("ZONE PRIORITY"); COORDINATOR_LOG_(TRACE, "compare done! get compared result from zone_priority_"); } else if (CLICK_FAIL(ret)) { diff --git a/src/logservice/leader_coordinator/failure_event.h b/src/logservice/leader_coordinator/failure_event.h index 66b11bfa1..4b217829f 100644 --- a/src/logservice/leader_coordinator/failure_event.h +++ b/src/logservice/leader_coordinator/failure_event.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_COORDINATOR_FAILURE_EVENT_H @@ -27,12 +31,12 @@ namespace coordinator enum class FailureType { INVALID_FAILURE = 0, - FATAL_ERROR_OCCUR = 1,// 致命错误,通常是在防御性代码中发现了bug - RESOURCE_NOT_ENOUGH = 2,// 资源不足,如磁盘与内存,通常为环境原因所致 - PROCESS_HANG = 3,// 流程阻塞,发现某主要流程一直不结束或者不断重试却不能成功 - MAJORITY_FAILURE = 4,// 多数派异常,如副本的网络与多数派断连 + FATAL_ERROR_OCCUR = 1,// Fatal error, usually a bug is found in defensive code + RESOURCE_NOT_ENOUGH = 2,// Resource insufficient, such as disk and memory, usually caused by environmental factors + PROCESS_HANG = 3,// Process blocking, a major process is found to never end or keep retrying without success + MAJORITY_FAILURE = 4,// Majority failure, such as a replica's network disconnecting from the majority SCHEMA_NOT_REFRESHED = 5, // sql may failed when tenant schema not refreshed yet - ENTER_ELECTION_SILENT = 6, // 副本进入选举静默状态 + ENTER_ELECTION_SILENT = 6, // Replica enters election silent state }; enum class FailureModule @@ -48,9 +52,9 @@ enum class FailureModule enum class FailureLevel { UNKNOWN_LEVEL = 0, - FATAL = 1,// 该级别的异常是非预期的,是在防御性代码中发现致命错误汇报上来的,具有比SERIOUS_FAILURE更高的切主优先级 - SERIOUS = 2,// 该级别的异常是预期内的,常为环境因素所致,出现此种异常将触发切主 - NOTICE = 3,// 该级别的异常只用作展示,在内部表中显示出来展示给用户,但是不会影响选举的优先级,也不会触发切主 + FATAL = 1,// This level of exception is unexpected and is reported from defensive code indicating a critical error, with a higher leader-follower switch priority than SERIOUS_FAILURE + SERIOUS = 2,// This level of exception is expected, often caused by environmental factors, and the occurrence of such an exception will trigger a leader switch + NOTICE = 3,// This level of exception is only used for display, shown in the internal table to the user, but will not affect the election priority, nor will it trigger a leader switch }; inline const char *obj_to_cstring(FailureType type) diff --git a/src/logservice/leader_coordinator/ob_failure_detector.cpp b/src/logservice/leader_coordinator/ob_failure_detector.cpp index 640f3dc55..4c2219f8a 100644 --- a/src/logservice/leader_coordinator/ob_failure_detector.cpp +++ b/src/logservice/leader_coordinator/ob_failure_detector.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_failure_detector.h" diff --git a/src/logservice/leader_coordinator/ob_failure_detector.h b/src/logservice/leader_coordinator/ob_failure_detector.h index 751f58f77..ecef082d4 100644 --- a/src/logservice/leader_coordinator/ob_failure_detector.h +++ b/src/logservice/leader_coordinator/ob_failure_detector.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_COORDINATOR_FAILURE_DETECTOR_H @@ -30,18 +34,17 @@ namespace coordinator class ObLeaderCoordinator; /** - * @description: ObFailureDetector探测各模块的失败,记录并影响选举优先级 - * [FailureEvent的值语义] - * FailureEvent由三个枚举字段和一个info_字段组成,info_字段的类型是ObStringHolder,它在堆上开辟内存空间,使用RAII管理所掌管的字符串的生命周期 - * 约定每个模块所注册的每个failure都是不同的,用户不应该多次重复注册同一个FailureEvent,ObFailureDetector将检查已注册的异常事件, - * 并将拒绝用户注册一个已经存在的FailureEvent,用户需要在FailureEvent.info_字段的内容上作文章以区分同一个模块注册的两种不同的failure。 - * [Failure的不同等级] - * 除非用户显示指定,FailureEvent具有默认的SERIOUS等级,该等级的Failure将触发切主。 - * 除此之外,可以显示指定NOTICE等级以及FATAL等级,前者不影响选举优先级仅作内部表展示,后者将比一般的Failure事件具备更高的切主优先级 - * [从异常中恢复] - * 用户可以选择注册一个recover_detect_operation,该操作在后台以1次/s的频率探测失败是否恢复, - * 约定recover_detect_operation返回true时表示异常恢复,用户应当保证recover_detect_operation的调用时间足够短(应在ms量级),以避免阻塞后台线程池 - * 用户也可以选择调用remove_failure_event(event)接口来主动取消异常事件,当event == failure的时候,取消对应failure的异常记录 + * @description: ObFailureDetector detects failures in each module, records them, and affects the election priority + * [Value semantics of FailureEvent] + * FailureEvent consists of three enumeration fields and one info_ field. The type of the info_ field is ObStringHolder, which allocates memory space on the heap and uses RAII to manage the lifecycle of the string it holds. + * It is agreed that each failure registered by each module is different. Users should not register the same FailureEvent multiple times. ObFailureDetector will check the registered failure events and reject a user's attempt to register an already existing FailureEvent. Users need to make use of the content in the FailureEvent.info_ field to distinguish between two different failures registered by the same module. + * [Different levels of Failure] + * Unless specified by the user, FailureEvent has a default level of SERIOUS, which triggers a leader switch. + * In addition, users can specify NOTICE and FATAL levels explicitly. The former does not affect the election priority and is only displayed in internal tables, while the latter has a higher priority for leader switch compared to general Failure events. + * [Recovering from failures] + * Users can choose to register a recover_detect_operation, which probes in the background at a frequency of 1 time/s whether the failure has recovered. + * It is agreed that returning true from recover_detect_operation indicates that the anomaly has been restored. Users should ensure that the call time of recover_detect_operation is sufficiently short (in the ms range) to avoid blocking the background thread pool. + * Users can also choose to call the remove_failure_event(event) interface to proactively cancel the failure event. When event == failure, the corresponding failure record is canceled. * @Date: 2022-01-10 10:21:28 */ class ObFailureDetector @@ -56,22 +59,22 @@ class ObFailureDetector static void mtl_stop(ObFailureDetector *&p_failure_detector); static void mtl_wait(ObFailureDetector *&p_failure_detector); /** - * @description: 设置一个不可自动恢复的failure,需要由注册的模块手动调用remove_failure_event()接口恢复failure,否则将持续存在 - * @param {FailureEvent} event failure事件,定义在failure_event.h中 + * @description: Set an irrecoverable failure that needs to be manually restored by the registered module through the remove_failure_event() interface; otherwise, it will persist. + * @param {FailureEvent} event Failure event, defined in failure_event.h * @return {*} * @Date: 2021-12-29 11:13:25 */ int add_failure_event(const FailureEvent &event); /** - * @description: 由外部设置的failure事件,并设置相应的恢复检测逻辑 - * @param {FailureEvent} event failure事件,定义在failure_event.h中 - * @param {ObFunction} recover_detect_operation 检测failure恢复的操作,会被周期性调用 + * @description: The failure event set by external and the corresponding recovery detection logic + * @param {FailureEvent} event failure event, defined in failure_event.h + * @param {ObFunction} recover_detect_operation The operation to detect failure recovery, which will be periodically called * @return {*} * @Date: 2021-12-29 10:27:54 */ /** - * @description: 用户选择注销一个曾经注册过的failure事件 - * @param {FailureEvent} event 一个曾经注册过的failure事件 + * @description: User selects to unregister a previously registered failure event + * @param {FailureEvent} event A previously registered failure event * @return {*} * @Date: 2022-01-09 15:08:22 */ @@ -79,7 +82,7 @@ class ObFailureDetector int get_specified_level_event(FailureLevel level, ObIArray &results); public: /** - * @description: 定期探测异常是否恢复的定时任务 + * @description: Timed task for periodically detecting if anomalies have recovered * @param {*} * @return {*} * @Date: 2022-01-04 21:12:00 diff --git a/src/logservice/leader_coordinator/ob_leader_coordinator.cpp b/src/logservice/leader_coordinator/ob_leader_coordinator.cpp index 7832d2ddd..11c9d43a0 100644 --- a/src/logservice/leader_coordinator/ob_leader_coordinator.cpp +++ b/src/logservice/leader_coordinator/ob_leader_coordinator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_leader_coordinator.h" diff --git a/src/logservice/leader_coordinator/ob_leader_coordinator.h b/src/logservice/leader_coordinator/ob_leader_coordinator.h index 70f657082..12f3d9848 100644 --- a/src/logservice/leader_coordinator/ob_leader_coordinator.h +++ b/src/logservice/leader_coordinator/ob_leader_coordinator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_COORDINATOR_INTERFACE_OB_LEADER_COORDINATOR_H @@ -31,8 +35,7 @@ namespace logservice { namespace coordinator { - -// 该结构存储的信息是周期性刷新的, 非本机的优先级信息缓存在该结构里 +// This structure stores information that is periodically refreshed, and non-local priority information is cached in this structure. typedef common::ObTuple>/*remove_member_info*/> LsElectionReferenceInfoRowTypeForUser; public: /** - * @description: 创建出一个数据结构映射自__all_ls_election_reference_info中的某一行,由租户ID和日志流ID确定,通过该数据结构的接口可以修改__all_ls_election_reference_info中对应行的内容 - * @param {uint64_t} tenant_id 租户ID - * @param {ObLSID &} ls_id 日志流ID + * @description: Create a data structure mapping to a row in __all_ls_election_reference_info, determined by the tenant ID and log stream ID, through which the content of the corresponding row in __all_ls_election_reference_info can be modified via the interface of this data structure + * @param {uint64_t} tenant_id tenant ID + * @param {ObLSID &} ls_id log stream ID * @Date: 2022-01-29 16:45:33 */ LsElectionReferenceInfoRow(const uint64_t tenant_id, const share::ObLSID &ls_id); ~LsElectionReferenceInfoRow(); /** - * @description: 当且仅当对应的行在__all_ls_election_reference_info表存在时,修改zone_priority列的内容 - * @param {ObArray>} &zone_list_list 选举参考的zone优先级,表示为二维数组,形如{{z1,z2},{z3},{z4,z5}}:z1和z2具有最高优先级,z3次之,z4和z5最低 - * @return {int} 错误码 + * @description: Modify the content of the zone_priority column only when the corresponding row exists in the __all_ls_election_reference_info table + * @param {ObArray>} &zone_list_list Election reference zone priorities, represented as a two-dimensional array, e.g., {{z1,z2},{z3},{z4,z5}}: z1 and z2 have the highest priority, z3 is next, and z4 and z5 are the lowest + * @return {int} Error code * @Date: 2022-01-29 16:41:02 */ int change_zone_priority(const ObArray> &zone_list_list); /** - * @description: 当且仅当对应的行在__all_ls_election_reference_info表存在时,修改manual_leader_server列的内容 - * @param {ObAddr} &manual_leader_server 指定的server地址 - * @return {int} 错误码 + * @description: Modify the content of the manual_leader_server column only when the corresponding row exists in the __all_ls_election_reference_info table + * @param {ObAddr} &manual_leader_server Specified server address + * @return {int} Error code * @Date: 2022-01-29 16:41:53 */ int change_manual_leader(const common::ObAddr &manual_leader_server); /** - * @description: 当且仅当对应的行在__all_ls_election_reference_info表存在时,且要移除的server在removed_member_info中不存在时,在removed_member_info列中增加被删除的server及原因 - * @param {ObAddr} &server 不允许当leader的server - * @param {ObString} &reason 不允许当leader的原因 + * @description: Add the server to be removed and the reason to the removed_member_info column only if the corresponding row exists in the __all_ls_election_reference_info table, and the server to be removed does not exist in the removed_member_info. + * @param {ObAddr} &server Server that is not allowed to be leader + * @param {ObString} &reason Reason why the server is not allowed to be leader * @return {*} * @Date: 2022-01-29 16:43:19 */ int add_server_to_blacklist(const common::ObAddr &server, InsertElectionBlacklistReason reason); /** - * @description: 当且仅当对应的行在__all_ls_election_reference_info表存在时,且要移除的server在removed_member_info中存在时,在removed_member_info列中移除被删除的server - * @param {ObAddr} &server 已经被记录的不允许当leader的server + * @description: Remove the deleted server from the removed_member_info column only if the corresponding row exists in the __all_ls_election_reference_info table and the server to be removed exists in removed_member_info. + * @param {ObAddr} &server The server that has been recorded as not allowed to be a leader. * @return {*} * @Date: 2022-01-29 16:44:51 */ int delete_server_from_blacklist(const common::ObAddr &server); /** - * @description: 将该原因的选举黑名单设置为对应 server,会清除掉选举黑名单中已有的该原因的 server - * @param {ObAddr} &server 不允许当leader的server - * @param {ObString} &reason 不允许当leader的原因 + * @description: Set the election blacklist for this reason to the corresponding server, which will clear the server of this reason from the existing election blacklist + * @param {ObAddr} &server Server that is not allowed to be leader + * @param {ObString} &reason Reason why the server is not allowed to be leader * @return {*} * @Date: 2022-01-29 16:43:19 */ @@ -128,15 +132,15 @@ class LsElectionReferenceInfoRow private: const uint64_t tenant_id_; const share::ObLSID ls_id_; - uint64_t exec_tenant_id_;// 事务执行读写操作时使用的tenant_id + uint64_t exec_tenant_id_;// tenant_id used by the transaction when performing read and write operations ObMySQLTransaction trans_; - LsElectionReferenceInfoRowTypeForTable row_for_table_;// 对内部表友好的数据组织形式 - LsElectionReferenceInfoRowTypeForUser row_for_user_;// 对用户友好的数据组织形式 + LsElectionReferenceInfoRowTypeForTable row_for_table_;// Data organization form friendly to internal tables + LsElectionReferenceInfoRowTypeForUser row_for_user_;// Data organization form friendly to users }; class TableAccessor { - struct ServerZoneNameCache// zone name获取成功一次即可,避免每次都访问内部表 + struct ServerZoneNameCache// zone name retrieval is successful once, avoid accessing the internal table every time { void set_zone_name_to_global_cache(const ObStringHolder &zone_name) { ObSpinLockGuard lg(lock_); diff --git a/src/logservice/logrpc/ob_log_request_handler.cpp b/src/logservice/logrpc/ob_log_request_handler.cpp index 29c34de84..4f4491ef2 100755 --- a/src/logservice/logrpc/ob_log_request_handler.cpp +++ b/src/logservice/logrpc/ob_log_request_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_log_request_handler.h" #include "logservice/ob_log_service.h" diff --git a/src/logservice/logrpc/ob_log_request_handler.h b/src/logservice/logrpc/ob_log_request_handler.h index 4b08e07c0..9d99108bb 100644 --- a/src/logservice/logrpc/ob_log_request_handler.h +++ b/src/logservice/logrpc/ob_log_request_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_LOG_REQUEST_HANDLER_ diff --git a/src/logservice/logrpc/ob_log_rpc_processor.h b/src/logservice/logrpc/ob_log_rpc_processor.h index 31aa2c3f9..9801e15bf 100644 --- a/src/logservice/logrpc/ob_log_rpc_processor.h +++ b/src/logservice/logrpc/ob_log_rpc_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_LOG_RPC_PROCESSOR_H_ diff --git a/src/logservice/logrpc/ob_log_rpc_proxy.h b/src/logservice/logrpc/ob_log_rpc_proxy.h index 65143623d..d1ec281f3 100644 --- a/src/logservice/logrpc/ob_log_rpc_proxy.h +++ b/src/logservice/logrpc/ob_log_rpc_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_LOG_RPC_PROXY_ diff --git a/src/logservice/logrpc/ob_log_rpc_req.cpp b/src/logservice/logrpc/ob_log_rpc_req.cpp index ea31a0867..c90b2648b 100644 --- a/src/logservice/logrpc/ob_log_rpc_req.cpp +++ b/src/logservice/logrpc/ob_log_rpc_req.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_log_rpc_req.h" diff --git a/src/logservice/logrpc/ob_log_rpc_req.h b/src/logservice/logrpc/ob_log_rpc_req.h index a321b1e2e..e46047288 100644 --- a/src/logservice/logrpc/ob_log_rpc_req.h +++ b/src/logservice/logrpc/ob_log_rpc_req.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_LOG_RPC_REQ_H_ diff --git a/src/logservice/ob_append_callback.cpp b/src/logservice/ob_append_callback.cpp index a469ed15a..0721accea 100644 --- a/src/logservice/ob_append_callback.cpp +++ b/src/logservice/ob_append_callback.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_append_callback.h" diff --git a/src/logservice/ob_append_callback.h b/src/logservice/ob_append_callback.h index c296f010b..a662cb581 100644 --- a/src/logservice/ob_append_callback.h +++ b/src/logservice/ob_append_callback.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_APPEND_CALLBACK_ @@ -71,9 +75,9 @@ class AppendCb : public AppendCbBase int64_t get_cb_first_handle_ts() const { return cb_first_handle_ts_; } virtual const char *get_cb_name() const = 0; public: - int64_t append_start_ts_; //提交到palf的起始时刻 - int64_t append_finish_ts_; //palf提交完成时刻,即提交到apply service起始时刻 - int64_t cb_first_handle_ts_; //cb第一次被处理的时刻,不一定调用on_success + int64_t append_start_ts_; // start timestamp for submission to palf + int64_t append_finish_ts_; // palf submission completion timestamp, i.e., the start time of submission to apply service + int64_t cb_first_handle_ts_; // the moment cb is first handled, not necessarily calling on_success }; } // end namespace logservice diff --git a/src/logservice/ob_garbage_collector.cpp b/src/logservice/ob_garbage_collector.cpp index 94cf5c586..161c8be64 100644 --- a/src/logservice/ob_garbage_collector.cpp +++ b/src/logservice/ob_garbage_collector.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_garbage_collector.h" @@ -272,8 +276,7 @@ ObGCLSLog::ObGCLSLog() { reset(); } - -//GC类型日志回放要求同类型内按序, 考虑到回放的性能, 使用前向barrier +//GC type log replay requires in-order within the same type, considering replay performance, forward barrier is used ObGCLSLog::ObGCLSLog(const int16_t log_type) : header_(ObLogBaseType::GC_LS_LOG_BASE_TYPE, ObReplayBarrierType::STRICT_BARRIER), version_(GC_LOG_VERSION), @@ -574,7 +577,7 @@ int ObGCHandler::gc_check_invalid_member_seq(const int64_t gc_seq, bool &need_gc WLockGuard wlock_guard(rwlock_); CLOG_LOG(INFO, "gc_check_invalid_member_seq", K(gc_seq), K(gc_seq_invalid_member_)); if (gc_seq == gc_seq_invalid_member_ + 1) { - //连续两轮都不在leader成员列表中 + //Not in the leader member list for two consecutive rounds need_gc = true; } gc_seq_invalid_member_ = gc_seq; @@ -972,7 +975,7 @@ int ObGCHandler::submit_log_(const ObGCLSLOGType log_type, bool &is_success) } if (OB_SUCC(ret)) { const ObLSID ls_id = ls_->get_ls_id(); - // 此处需要考虑能否做成异步 + // Here it needs to be considered whether it can be made asynchronous bool is_finished = false; int64_t WAIT_TIME = 10 * 1000L; // 10ms constexpr int64_t MIN = 60 * 1000 * 1000; @@ -1049,7 +1052,7 @@ int ObGCHandler::block_ls_transfer_in_(const SCN &block_scn) int ret = OB_SUCCESS; LSGCState gc_state = INVALID_LS_GC_STATE; ObLSID ls_id = ls_->get_ls_id(); - //过滤重复回放场景 + //Filter duplicate replay scenarios if (OB_FAIL(ls_->get_gc_state(gc_state))) { CLOG_LOG(WARN, "get_gc_state failed", K(ls_id), K(gc_state)); } else if (!is_valid_ls_gc_state(gc_state)) { @@ -1088,7 +1091,7 @@ int ObGCHandler::offline_ls_(const SCN &offline_scn) int ret = OB_SUCCESS; LSGCState gc_state = INVALID_LS_GC_STATE; ObLSID ls_id = ls_->get_ls_id(); - //过滤重复回放场景 + //Filter duplicate replay scenarios if (OB_FAIL(ls_->get_gc_state(gc_state))) { CLOG_LOG(WARN, "get_gc_state failed", K(ls_id), K(gc_state)); } else if (!is_valid_ls_gc_state(gc_state)) { diff --git a/src/logservice/ob_garbage_collector.h b/src/logservice/ob_garbage_collector.h index 468cfb60a..03873c0ed 100644 --- a/src/logservice/ob_garbage_collector.h +++ b/src/logservice/ob_garbage_collector.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_GARBAGE_COLLECTOR_ @@ -58,8 +62,7 @@ enum ObGCLSLOGType OFFLINE_LS = 2, GC_LS_LOG_TYPE_MAX_TYPE = 3, }; - -// 记录LS当前GC状态,状态不能回退,增删状态需要注意对应的bool接口的正确性 +// Record LS current GC status, status cannot be rolled back, adding or deleting status should pay attention to the correctness of the corresponding bool interface enum LSGCState { INVALID_LS_GC_STATE = 0, @@ -149,7 +152,7 @@ class ObGarbageCollector : public share::ObThreadPool void destroy(); void run1(); public: - //当前轮次GC查询LS的状态,状态不能回退,增删状态需要注意对应的bool接口的正确性 + //Current round GC queries the status of LS, the status cannot go backward, adding or deleting states should pay attention to the correctness of the corresponding bool interface enum LSStatus { LS_INVALID_STATUS = 0, @@ -164,9 +167,9 @@ class ObGarbageCollector : public share::ObThreadPool enum GCReason { - INVALID_GC_REASON = 0, //不需要GC - NOT_IN_LEADER_MEMBER_LIST = 1, //不在成员列表中 - LS_STATUS_ENTRY_NOT_EXIST = 2, //日志流状态表已删除该日志流 + INVALID_GC_REASON = 0, //No need for GC + NOT_IN_LEADER_MEMBER_LIST = 1, // Not in member list + LS_STATUS_ENTRY_NOT_EXIST = 2, //Log stream status table has deleted this log stream MAX_GC_REASON = 3, }; @@ -199,7 +202,7 @@ class ObGarbageCollector : public share::ObThreadPool bool is_need_gc_ls_status_(const LSStatus &status); bool is_normal_ls_status_(const LSStatus &status); bool is_need_delete_entry_ls_status_(const LSStatus &status); - //member list相关 + //member list related int gc_check_member_list_(ObGCCandidateArray &gc_candidates); int construct_server_ls_map_for_member_list_(ServerLSMap &server_ls_map) const; int handle_each_ls_for_member_list_(ServerLSMap &server_ls_map, @@ -207,7 +210,7 @@ class ObGarbageCollector : public share::ObThreadPool int construct_server_ls_map_(ServerLSMap &server_ls_map, const common::ObAddr &server, const share::ObLSID &id) const; - //日志流状态表相关 + //Log stream status table related void gc_check_ls_status_(ObGCCandidateArray &gc_candidates); int gc_check_ls_status_(storage::ObLS &ls, ObGCCandidateArray &gc_candidates); @@ -360,7 +363,7 @@ class ObGCHandler : public ObIReplaySubHandler, bool is_inited_; mutable RWLock rwlock_; //for leader revoke/takeover submit log storage::ObLS *ls_; - int64_t gc_seq_invalid_member_; //缓存gc检查当前ls不在成员列表时的轮次 + int64_t gc_seq_invalid_member_; // cache gc check current ls not in member list round int64_t gc_start_ts_; int64_t block_tx_ts_; int64_t block_log_debug_time_; diff --git a/src/logservice/ob_locality_adapter.cpp b/src/logservice/ob_locality_adapter.cpp index 6415188e8..04d2dbff3 100644 --- a/src/logservice/ob_locality_adapter.cpp +++ b/src/logservice/ob_locality_adapter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_locality_adapter.h" diff --git a/src/logservice/ob_locality_adapter.h b/src/logservice/ob_locality_adapter.h index 767581f78..8df73dfe1 100644 --- a/src/logservice/ob_locality_adapter.h +++ b/src/logservice/ob_locality_adapter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_LOCALITY_ADAPTER_H_ diff --git a/src/logservice/ob_location_adapter.cpp b/src/logservice/ob_location_adapter.cpp index b64bc3bfd..61659a737 100644 --- a/src/logservice/ob_location_adapter.cpp +++ b/src/logservice/ob_location_adapter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_location_adapter.h" diff --git a/src/logservice/ob_location_adapter.h b/src/logservice/ob_location_adapter.h index 675547219..d2f66771a 100644 --- a/src/logservice/ob_location_adapter.h +++ b/src/logservice/ob_location_adapter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_LOCATION_ADAPTER_H_ diff --git a/src/logservice/ob_log_base_header.cpp b/src/logservice/ob_log_base_header.cpp index eda91c4ab..f09e30c2d 100644 --- a/src/logservice/ob_log_base_header.cpp +++ b/src/logservice/ob_log_base_header.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_log_base_header.h" diff --git a/src/logservice/ob_log_base_header.h b/src/logservice/ob_log_base_header.h index 95d8cb251..eb2bd7343 100644 --- a/src/logservice/ob_log_base_header.h +++ b/src/logservice/ob_log_base_header.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_LOG_BASE_HEADER_ @@ -22,15 +26,15 @@ namespace oceanbase { namespace logservice { -// ObReplayBarrierType为follower回放日志时的barrier类型, 分为以下三类 +// ObReplayBarrierType is the barrier type for follower log replay, divided into the following three categories // 1. STRICT_BARRIER: -// 此日志能回放的前提条件为比此日志的log ts小的日志都已回放完, -// 并且在此日志的回放完成之前, 比此日志的log ts大的日志都不会回放. +// The prerequisite condition for replaying this log is that all logs with a log ts smaller than this log have already been replayed, +// And before the replay of this log is complete, logs with a log ts greater than this log will not be replayed. // 2. PRE_BARRIER: -// 此日志能回放的前提条件为比此日志的log ts小的日志都已回放完, -// 但此日志的回放完成之前, 比此日志的log ts大的日志可以回放. +// The prerequisite condition for replaying this log is that all logs with a log ts smaller than this log have already been replayed, +// But the replay of this log can be completed before logs with a log ts greater than this log are replayed. // 3. NO_NEED_BARRIER: -// 此日志无任何特殊回放条件, 也不会对其他日志的回放有任何影响 +// This log has no special replay conditions and will not affect the replay of any other logs enum ObReplayBarrierType { INVALID_BARRIER = 0, diff --git a/src/logservice/ob_log_base_type.h b/src/logservice/ob_log_base_type.h index 248dd9578..9b8405c4c 100644 --- a/src/logservice/ob_log_base_type.h +++ b/src/logservice/ob_log_base_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_LOG_BASE_TYPE_ @@ -353,20 +357,20 @@ class ObIRoleChangeSubHandler virtual void switch_to_follower_forcedly() = 0; virtual int switch_to_leader() = 0; // @retval - // OB_SUCCESS, 角色切换执行成功 - // OB_LS_NEED_REVOKE, 角色切换执行失败, 需要主动卸任 - // OTHERS , 角色切换执行失败, 不需要主动卸任 + // OB_SUCCESS, role switch execution succeeded + // OB_LS_NEED_REVOKE, role switch execution failed, need to step down proactively + // OTHERS , role switch execution failed, no need to resign proactively // - // 新增OB_LS_NEED_REVOKE的原因是, switch_to_follower_gracefully, 包含两步: - // a. 执行leader->follower; - // b. 执行follower->leader. + // The reason for adding OB_LS_NEED_REVOKE is that switch_to_follower_gracefully includes two steps: + // a. Execute leader->follower; + // b. Execute follower->leader switch. // - // a. 执行成功, 表示可以执行后续的切主工作 - // a. 执行失败, 需要执行1.b - // b. 执行成功, 表示这次切主操作执行失败, 但不需要主动卸任 - // b. 执行失败, 表示这次切主操作执行失败, 但需要主动卸任 + // a. Execution successful, indicates that the subsequent leader switch work can be performed + // a. Execution failed, need to execute 1.b + // b. Execution successful, indicates that this leader switch operation failed, but does not require an active resignation + // b. Execution failed, indicates that this leader switch operation failed, but needs to step down proactively // - // 经过协商, 决定采用错误码的方式区分上述各种异常. + // After negotiation, it was decided to use error codes to distinguish the above various exceptions. virtual int switch_to_follower_gracefully() = 0; virtual int resume_leader() = 0; VIRTUAL_TO_STRING_KV("ObIRoleChangeSubHandler", "Dummy"); diff --git a/src/logservice/ob_log_external_storage_handler.cpp b/src/logservice/ob_log_external_storage_handler.cpp index 7a8d6bca5..e2402484b 100644 --- a/src/logservice/ob_log_external_storage_handler.cpp +++ b/src/logservice/ob_log_external_storage_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_log_external_storage_handler.h" diff --git a/src/logservice/ob_log_external_storage_handler.h b/src/logservice/ob_log_external_storage_handler.h index cc4a63a5a..93f2ca129 100644 --- a/src/logservice/ob_log_external_storage_handler.h +++ b/src/logservice/ob_log_external_storage_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEABASE_LOGSERVICE_OB_LOG_EXTERNAL_STORAGE_H_ diff --git a/src/logservice/ob_log_external_storage_io_task.cpp b/src/logservice/ob_log_external_storage_io_task.cpp index ef097726f..e1e739931 100644 --- a/src/logservice/ob_log_external_storage_io_task.cpp +++ b/src/logservice/ob_log_external_storage_io_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_log_external_storage_io_task.h" #include "lib/string/ob_string.h" // ObString diff --git a/src/logservice/ob_log_external_storage_utils.cpp b/src/logservice/ob_log_external_storage_utils.cpp index d97267edb..834723c39 100644 --- a/src/logservice/ob_log_external_storage_utils.cpp +++ b/src/logservice/ob_log_external_storage_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_log_external_storage_utils.h" #include "share/ob_device_manager.h" // ObDeviceManager @@ -35,7 +39,7 @@ int get_and_init_io_device(const ObString &uri, opt.key_ = "storage_info"; opt.value_.value_str = storage_info.ptr(); share::ObBackupStorageInfo tmp_storage_info; - // TODO(zjf225077): 删除这一套ObLogExternalStorageIOTaskHandleAdapter,统一使用ObBackupIoAdapter + // TODO(zjf225077): Remove this set of ObLogExternalStorageIOTaskHandleAdapter, and unify the use of ObBackupIoAdapter ObStorageIdMod storage_id_mod(storage_id, ObStorageUsedMod::STORAGE_USED_CLOG); if (OB_FAIL(tmp_storage_info.set(uri.ptr(), storage_info.ptr()))) { CLOG_LOG(WARN, "set ObBackupStorageInfo failed", K(uri), KP(io_device)); diff --git a/src/logservice/ob_log_external_storage_utils.h b/src/logservice/ob_log_external_storage_utils.h index 92921b946..9753255fe 100644 --- a/src/logservice/ob_log_external_storage_utils.h +++ b/src/logservice/ob_log_external_storage_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEABASE_LOGSERVICE_OB_LOG_EXTERNAL_STORAGE_UTILS_H_ #define OCEABASE_LOGSERVICE_OB_LOG_EXTERNAL_STORAGE_UTILS_H_ diff --git a/src/logservice/ob_log_flashback_service.cpp b/src/logservice/ob_log_flashback_service.cpp index e0a2e808d..455207d77 100644 --- a/src/logservice/ob_log_flashback_service.cpp +++ b/src/logservice/ob_log_flashback_service.cpp @@ -1,12 +1,18 @@ -// Copyright (c) 2021 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define USING_LOG_PREFIX CLOG #include "ob_log_flashback_service.h" diff --git a/src/logservice/ob_log_flashback_service.h b/src/logservice/ob_log_flashback_service.h index 35c8bfe20..534e42678 100644 --- a/src/logservice/ob_log_flashback_service.h +++ b/src/logservice/ob_log_flashback_service.h @@ -1,12 +1,18 @@ -// Copyright (c) 2021 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #ifndef OCEANBASE_LOGSERVICE_OB_LOG_FLASHBACK_SERVICE_ #define OCEANBASE_LOGSERVICE_OB_LOG_FLASHBACK_SERVICE_ diff --git a/src/logservice/ob_log_handler.cpp b/src/logservice/ob_log_handler.cpp index 493fb95f8..d68092f5f 100755 --- a/src/logservice/ob_log_handler.cpp +++ b/src/logservice/ob_log_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF @@ -141,7 +145,7 @@ int ObLogHandler::stop() if (IS_INIT) { is_in_stop_state_ = true; common::TCWLockGuard deps_guard(deps_lock_); - //unregister_file_size_cb不能在apply status锁内, 可能会导致死锁 + //unregister_file_size_cb cannot be inside the apply status lock, it may cause a deadlock apply_status_->unregister_file_size_cb(); tg.click("unreg cb end"); if (OB_FAIL(apply_status_->stop())) { @@ -160,9 +164,8 @@ int ObLogHandler::stop() } return ret; } - -//判断is_apply_done依赖log handler不能再继续append -//所以需要is_in_stop_state_置true表示stop阶段已经不能再提交日志 +//Determine if is_apply_done depends on log handler, no further append can be made +//So need to set is_in_stop_state_ to true to indicate that no more logs can be submitted in the stop phase int ObLogHandler::safe_to_destroy(bool &is_safe_destroy) { int ret = OB_SUCCESS; @@ -1707,7 +1710,7 @@ int ObLogHandler::get_max_decided_scn(SCN &scn) if (IS_NOT_INIT) { ret = OB_NOT_INIT; } else if (is_in_stop_state_) { - //和replay service统一返回4109 + // and replay service return 4109 uniformly ret = OB_STATE_NOT_MATCH; } else if (is_offline()) { ret = OB_STATE_NOT_MATCH; @@ -1722,7 +1725,7 @@ int ObLogHandler::get_max_decided_scn(SCN &scn) CLOG_LOG(WARN, "failed to get_max_replayed_scn, replay status is not enabled", K(ret), K(id)); } if (OB_STATE_NOT_MATCH == ret && max_applied_scn.is_valid()) { - //回放尚未enable,但是apply service中拿到的最大连续回调位点合法 + //Replay is not enabled, but the maximum consecutive callback point obtained in the apply service is valid ret = OB_SUCCESS; scn = max_applied_scn > SCN::min_scn() ? max_applied_scn : SCN::min_scn(); if (palf_reach_time_interval(1000 * 1000, get_max_decided_scn_debug_time_)) { diff --git a/src/logservice/ob_log_handler.h b/src/logservice/ob_log_handler.h index 8a6492153..813a2b061 100755 --- a/src/logservice/ob_log_handler.h +++ b/src/logservice/ob_log_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_LOG_HANDLER_ @@ -888,7 +892,7 @@ class ObLogHandler : public ObILogHandler, public ObLogHandlerBase DISALLOW_COPY_AND_ASSIGN(ObLogHandler); private: common::ObAddr self_; - //log_handler会高频调用apply_status, 减少通过applyservice哈希的开销 + //log_handler will frequently call apply_status, reducing the overhead of hashing through applyservice ObApplyStatus *apply_status_; ObLogApplyService *apply_service_; ObLogReplayService *replay_service_; diff --git a/src/logservice/ob_log_handler_base.cpp b/src/logservice/ob_log_handler_base.cpp index 838adbb32..e67bd2726 100644 --- a/src/logservice/ob_log_handler_base.cpp +++ b/src/logservice/ob_log_handler_base.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_log_handler_base.h" @@ -71,7 +75,7 @@ int ObLogHandlerBase::get_role(common::ObRole &role, int64_t &proposal_id) const bool is_pending_state = false; int64_t curr_palf_proposal_id; ObRole curr_palf_role; - // 获取当前的proposal_id + // Get the current proposal_id RLockGuard guard(lock_); const int64_t saved_proposal_id = ATOMIC_LOAD(&proposal_id_); const ObRole saved_role = ATOMIC_LOAD(&role_); @@ -85,7 +89,7 @@ int ObLogHandlerBase::get_role(common::ObRole &role, int64_t &proposal_id) const } else if (OB_FAIL(palf_handle_.get_role(curr_palf_role, curr_palf_proposal_id, is_pending_state))) { CLOG_LOG(WARN, "get_role failed", K(ret)); } else if (curr_palf_proposal_id != saved_proposal_id) { - // palf的proposal_id已经发生变化,返回FOLLOWER + // palf's proposal_id has changed, return FOLLOWER role = FOLLOWER; proposal_id = saved_proposal_id; } else { diff --git a/src/logservice/ob_log_handler_base.h b/src/logservice/ob_log_handler_base.h index 7d1defcc0..b2e8140e8 100644 --- a/src/logservice/ob_log_handler_base.h +++ b/src/logservice/ob_log_handler_base.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_LOG_HANDLER_BASE_ diff --git a/src/logservice/ob_log_monitor.cpp b/src/logservice/ob_log_monitor.cpp index 848a6c48f..da250a74e 100644 --- a/src/logservice/ob_log_monitor.cpp +++ b/src/logservice/ob_log_monitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_log_monitor.h" @@ -386,4 +390,4 @@ int ObLogMonitor::record_election_silent_event(const bool is_silent, const int64 #undef LOG_MONITOR_EVENT_FMT_PREFIX } // end namespace logservice -} // end namespace oceanbase \ No newline at end of file +} // end namespace oceanbase diff --git a/src/logservice/ob_log_monitor.h b/src/logservice/ob_log_monitor.h index 9d47419b9..fecca282c 100644 --- a/src/logservice/ob_log_monitor.h +++ b/src/logservice/ob_log_monitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_LOG_MONITOR_H_ diff --git a/src/logservice/ob_log_service.cpp b/src/logservice/ob_log_service.cpp index e6bf5fc7e..e91d011a9 100644 --- a/src/logservice/ob_log_service.cpp +++ b/src/logservice/ob_log_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX CLOG @@ -70,7 +74,7 @@ int ObLogService::mtl_init(ObLogService* &logservice) const ObAddr &self = GCTX.self_addr(); const int64_t tenant_id = MTL_ID(); observer::ObSrvNetworkFrame *net_frame = GCTX.net_frame_; - //log_disk_usage_limit_size无法主动从配置项获取, 需要在mtl初始化时作为入参传入 + //log_disk_usage_limit_size cannot be actively obtained from the configuration item, and needs to be passed as a parameter during mtl initialization const palf::PalfOptions &palf_options = MTL_INIT_CTX()->palf_options_; const char *tenant_clog_dir = MTL_INIT_CTX()->tenant_clog_dir_; const char *clog_dir = OB_FILE_SYSTEM_ROUTER.get_clog_dir(); @@ -568,7 +572,7 @@ int ObLogService::update_palf_options_except_disk_usage_limit_size() if (OB_FAIL(common::ObCompressorPool::get_instance().get_compressor_type( tenant_config->log_transport_compress_func, compressor_type))) { CLOG_LOG(ERROR, "log_transport_compress_func invalid.", K(ret)); - //需要获取log_disk_usage_limit_size + //Need to get log_disk_usage_limit_size } else if (OB_FAIL(palf_env_->get_options(palf_opts))) { CLOG_LOG(WARN, "palf get_options failed", K(ret)); } else { @@ -590,8 +594,7 @@ int ObLogService::update_palf_options_except_disk_usage_limit_size() } return ret; } - -//log_disk_usage_limit_size无法主动感知,只能通过上层触发时传入 +//log_disk_usage_limit_size cannot be proactively detected, it can only be passed in when triggered by the upper layer int ObLogService::update_log_disk_usage_limit_size(const int64_t log_disk_usage_limit_size) { int ret = OB_SUCCESS; diff --git a/src/logservice/ob_log_service.h b/src/logservice/ob_log_service.h index 58e9af727..e23923f95 100644 --- a/src/logservice/ob_log_service.h +++ b/src/logservice/ob_log_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_LOG_SERVICE_ @@ -117,30 +121,29 @@ class ObLogService common::ObMySQLProxy *sql_proxy, IObNetKeepAliveAdapter *net_keepalive_adapter, storage::ObLocalityManager *locality_manager); - //--日志流相关接口-- - //新建日志流接口,该接口会创建日志流对应的目录,新建一个以PalfBaeInfo为日志基点的日志流。 - //其中包括生成并初始化对应的ObReplayStatus结构 - // @param [in] id,日志流标识符 - // @param [in] replica_type,日志流的副本类型 - // @param [in] tenant_role, 租户角色, 以此决定Palf使用模式(APPEND/RAW_WRITE) - // @param [in] palf_base_info, 日志同步基点信息 - // @param [out] log_handler,新建日志流以ObLogHandler形式返回,保证上层使用日志流时的生命周期 + //--Log stream related interfaces-- + //New log stream interface, this interface will create the corresponding directory for the log stream and create a new log stream with PalfBaseInfo as the log base point. + //This includes generating and initializing the corresponding ObReplayStatus structure + // @param [in] id, log stream identifier + // @param [in] replica_type, the replica type of the log stream + // @param [in] tenant_role, tenant role, this decides the Palf usage mode (APPEND/RAW_WRITE) + // @param [in] palf_base_info, log synchronization base point information + // @param [out] log_handler, new log stream returned in the form of ObLogHandler, ensuring the lifecycle of the log stream when used by upper layers int create_ls(const share::ObLSID &id, const common::ObReplicaType &replica_type, const share::ObTenantRole &tenant_role, const palf::PalfBaseInfo &palf_base_info, const bool allow_log_sync, ObLogHandler &log_handler); - - //删除日志流接口:外层调用create_ls()之后,后续流程失败,需要调用remove_ls() + //Delete log stream interface: After the outer call to create_ls(), if subsequent processes fail, remove_ls() needs to be called int remove_ls(const share::ObLSID &id, ObLogHandler &log_handler); int check_palf_exist(const share::ObLSID &id, bool &exist) const; - //宕机重启恢复日志流接口,包括生成并初始化对应的ObReplayStatus结构 - // @param [in] id,日志流标识符 - // @param [out] log_handler,新建日志流以ObLogHandler形式返回,保证上层使用日志流时的生命周期 - // @param [out] restore_handler,新建日志流以ObLogRestoreHandler形式返回,用于备库同步日志 + //Downtime restart recovery log stream interface, including generating and initializing the corresponding ObReplayStatus structure + // @param [in] id, log stream identifier + // @param [out] log_handler, new log stream returned in the form of ObLogHandler, ensuring the lifecycle of the log stream when used by upper layers + // @param [out] restore_handler, new log stream returned in the form of ObLogRestoreHandler, used for follower synchronization logs int add_ls(const share::ObLSID &id, ObLogHandler &log_handler); diff --git a/src/logservice/ob_ls_adapter.cpp b/src/logservice/ob_ls_adapter.cpp index aafee7463..07685a0a4 100644 --- a/src/logservice/ob_ls_adapter.cpp +++ b/src/logservice/ob_ls_adapter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_ls_adapter.h" diff --git a/src/logservice/ob_ls_adapter.h b/src/logservice/ob_ls_adapter.h index af3b9eb63..3781191b1 100644 --- a/src/logservice/ob_ls_adapter.h +++ b/src/logservice/ob_ls_adapter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_LS_ADAPTER_H_ @@ -37,8 +41,8 @@ class ObLSAdapter virtual int wait_append_sync(const share::ObLSID &ls_id); private: const int64_t MAX_SINGLE_REPLAY_WARNING_TIME_THRESOLD = 100 * 1000; //100ms - const int64_t MAX_SINGLE_REPLAY_ERROR_TIME_THRESOLD = 2 * 1000 * 1000; //2s 单条日志回放执行时间超过此值报error - const int64_t MAX_SINGLE_RETRY_WARNING_TIME_THRESOLD = 5 * 1000 * 1000; //5s 单条日志回放重试超过此值报error + const int64_t MAX_SINGLE_REPLAY_ERROR_TIME_THRESOLD = 2 * 1000 * 1000; // 2s Single log replay execution time exceeding this value reports error + const int64_t MAX_SINGLE_RETRY_WARNING_TIME_THRESOLD = 5 * 1000 * 1000; // 5s Single log replay retry exceeds this value reports error bool is_inited_; storage::ObLSService *ls_service_; }; diff --git a/src/logservice/ob_net_keepalive_adapter.cpp b/src/logservice/ob_net_keepalive_adapter.cpp index e97165142..b38a0d129 100644 --- a/src/logservice/ob_net_keepalive_adapter.cpp +++ b/src/logservice/ob_net_keepalive_adapter.cpp @@ -1,12 +1,18 @@ -// Copyright (c) 2021 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #include "ob_net_keepalive_adapter.h" #include "rpc/obrpc/ob_net_keepalive.h" // ObNetKeepAlive diff --git a/src/logservice/ob_net_keepalive_adapter.h b/src/logservice/ob_net_keepalive_adapter.h index 6be1e4736..89327a589 100644 --- a/src/logservice/ob_net_keepalive_adapter.h +++ b/src/logservice/ob_net_keepalive_adapter.h @@ -1,12 +1,18 @@ -// Copyright (c) 2021 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #ifndef OCEANBASE_LOGSERVICE_OB_NET_KEEPALIVE_ADPATER_H_ #define OCEANBASE_LOGSERVICE_OB_NET_KEEPALIVE_ADPATER_H_ diff --git a/src/logservice/ob_reconfig_checker_adapter.cpp b/src/logservice/ob_reconfig_checker_adapter.cpp index 7d35ef017..60cb60c63 100644 --- a/src/logservice/ob_reconfig_checker_adapter.cpp +++ b/src/logservice/ob_reconfig_checker_adapter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_reconfig_checker_adapter.h" diff --git a/src/logservice/ob_reconfig_checker_adapter.h b/src/logservice/ob_reconfig_checker_adapter.h index 0b09b12d3..a3f2fe755 100644 --- a/src/logservice/ob_reconfig_checker_adapter.h +++ b/src/logservice/ob_reconfig_checker_adapter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_RECONFIG_CHECKER_ADAPTER_H_ diff --git a/src/logservice/ob_reporter_adapter.cpp b/src/logservice/ob_reporter_adapter.cpp index 9837ca4ff..d9a811105 100644 --- a/src/logservice/ob_reporter_adapter.cpp +++ b/src/logservice/ob_reporter_adapter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_reporter_adapter.h" @@ -68,4 +72,4 @@ int ObLogReporterAdapter::report_replica_info(const int64_t palf_id) } } // end namespace logservice -} // end namespace oceanbase \ No newline at end of file +} // end namespace oceanbase diff --git a/src/logservice/ob_reporter_adapter.h b/src/logservice/ob_reporter_adapter.h index 044a67b17..49469ad1e 100644 --- a/src/logservice/ob_reporter_adapter.h +++ b/src/logservice/ob_reporter_adapter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_REPORTER_ADAPTER_H_ diff --git a/src/logservice/ob_server_log_block_mgr.cpp b/src/logservice/ob_server_log_block_mgr.cpp index dc0336037..8f6079623 100644 --- a/src/logservice/ob_server_log_block_mgr.cpp +++ b/src/logservice/ob_server_log_block_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX CLOG diff --git a/src/logservice/ob_server_log_block_mgr.h b/src/logservice/ob_server_log_block_mgr.h index dfdecf532..fc0fc8670 100644 --- a/src/logservice/ob_server_log_block_mgr.h +++ b/src/logservice/ob_server_log_block_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_SERVER_LOG_BLOCK_MGR_ @@ -257,14 +261,12 @@ class ObServerLogBlockMgr : public palf::ILogBlockPool int remove_resizing_tmp_dir_(const char *dir_path, const palf::FileDesc &in_dir_fd); int do_resize_(const LogPoolMeta &old_log_pool_meta, const int64_t resize_block_cnt, LogPoolMeta &new_log_pool_meta); - - // 原子性的保证: - // 1. 临时的扩容目录 - // 2. 移动失败会重试 + // Atomic guarantee: + // 1. temporary expansion directory + // 2. Movement failure will retry int do_expand_(const LogPoolMeta &new_log_meta, const int64_t resize_block_cnt); - - // 原子性的保证: - // 1. 删除操作失败会重试 + // Atomic guarantee: + // 1. Deletion operation failure will retry int do_shrink_(const LogPoolMeta &new_log_meta, const int64_t resize_block_cnt); int allocate_blocks_at_tmp_dir_(const palf::FileDesc &dir_fd, const palf::block_id_t start_block_id, diff --git a/src/logservice/ob_switch_leader_adapter.cpp b/src/logservice/ob_switch_leader_adapter.cpp index fb95a336c..670329a53 100644 --- a/src/logservice/ob_switch_leader_adapter.cpp +++ b/src/logservice/ob_switch_leader_adapter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "logservice/ob_switch_leader_adapter.h" diff --git a/src/logservice/ob_switch_leader_adapter.h b/src/logservice/ob_switch_leader_adapter.h index 9e92d7e49..fea9d64ca 100644 --- a/src/logservice/ob_switch_leader_adapter.h +++ b/src/logservice/ob_switch_leader_adapter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_LEADER_SWITCH_ @@ -34,4 +38,4 @@ class ObSwitchLeaderAdapter }; } // end namespace logservice } // end namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/src/logservice/palf/block_gc_timer_task.cpp b/src/logservice/palf/block_gc_timer_task.cpp index 051eeb36d..b2e3a413c 100644 --- a/src/logservice/palf/block_gc_timer_task.cpp +++ b/src/logservice/palf/block_gc_timer_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "block_gc_timer_task.h" diff --git a/src/logservice/palf/block_gc_timer_task.h b/src/logservice/palf/block_gc_timer_task.h index b168c3eb9..912465374 100644 --- a/src/logservice/palf/block_gc_timer_task.h +++ b/src/logservice/palf/block_gc_timer_task.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_PALF_FILE_GC_TIMER_TASK_ diff --git a/src/logservice/palf/election/algorithm/election_impl.cpp b/src/logservice/palf/election/algorithm/election_impl.cpp index e64975f75..110b94fec 100644 --- a/src/logservice/palf/election/algorithm/election_impl.cpp +++ b/src/logservice/palf/election/algorithm/election_impl.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "election_impl.h" diff --git a/src/logservice/palf/election/algorithm/election_impl.h b/src/logservice/palf/election/algorithm/election_impl.h index d91052502..8b5bcefe9 100644 --- a/src/logservice/palf/election/algorithm/election_impl.h +++ b/src/logservice/palf/election/algorithm/election_impl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_PALF_ELECTION_ALGORITHM_OB_ELECTION_IMPL_H @@ -67,8 +71,8 @@ class ElectionImpl : public Election virtual int change_leader_to(const common::ObAddr &dest_addr) override final; virtual int temporarily_downgrade_protocol_priority(const int64_t time_us, const char *reason) override final; /** - * @description: 返回选举对象当前的角色和epoch - * @param {ObRole} &role 当前的角色,LEADER always + * @description: Return the current role and epoch of the election object + * @param {ObRole} &role Current role, LEADER always * @param {int64_t} &epoch 1 always * @return {int} OB_SUCCESS always * @Date: 2025-07-16 19:57:06 @@ -83,8 +87,8 @@ class ElectionImpl : public Election return ret; } /** - * @description: 获取当前的leader及其epoch - * @param {common::ObAddr} 自己的addr + * @description: Get the current leader and its epoch + * @param {common::ObAddr} own addr * @param {int64_t} 1 always * @return {int} OB_SUCCESS always * @Date: 2025-07-16 19:56:06 diff --git a/src/logservice/palf/election/interface/election.h b/src/logservice/palf/election/interface/election.h index be0ffcb60..4986e64e5 100644 --- a/src/logservice/palf/election/interface/election.h +++ b/src/logservice/palf/election/interface/election.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_PALF_ELECTION_INTERFACE_OB_I_ELECTION_H @@ -36,11 +40,11 @@ typedef common::ObSpinLockGuard LockGuard; enum class RoleChangeReason { - DevoteToBeLeader = 1, // 无主选举从Follower成为Leader - ChangeLeaderToBeLeader = 2, // 切主流程新主从Follower成为Leader - LeaseExpiredToRevoke = 3, // 有主连任失败,Lease超时,从Leader变为Follower - ChangeLeaderToRevoke = 4, // 切主流程旧主从Leader变为Follower - StopToRevoke = 5,// 选举leader调用stop接口后leader卸任 + DevoteToBeLeader = 1, // Leader election from Follower to Leader + ChangeLeaderToBeLeader = 2, // leader-follower switch new Follower becomes Leader + LeaseExpiredToRevoke = 3, // Leader re-election failed, Lease expired, switch from Leader to Follower + ChangeLeaderToRevoke = 4, // leader-follower switch old Leader becomes Follower + StopToRevoke = 5,// After the leader calls the stop interface during an election, the leader steps down }; class ElectionPrepareRequestMsg; @@ -59,24 +63,24 @@ class Election virtual ~Election() {} virtual void stop() = 0; virtual int can_set_memberlist(const palf::LogConfigVersion &new_config_version) const = 0; - // 设置成员列表 + // Set member list virtual int set_memberlist(const MemberList &new_member_list) = 0; - // 获取选举当前的角色 + // Get the current role of the election virtual int get_role(common::ObRole &role, int64_t &epoch) const = 0; - // 如果自己是leader,那么拿到的就是准确的leader,如果自己不是leader,那么拿到lease的owner + // If oneself is the leader, then the accurate leader is obtained; if oneself is not the leader, then the owner of the lease is obtained virtual int get_current_leader_likely(common::ObAddr &addr, int64_t &cur_leader_epoch) const = 0; - // 供role change service使用 + // for role change service use virtual int change_leader_to(const common::ObAddr &dest_addr) = 0; virtual int temporarily_downgrade_protocol_priority(const int64_t time_us, const char *reason) = 0; - // 拿本机地址 + // Get local address virtual const common::ObAddr &get_self_addr() const = 0; - // 打印日志 + // print log virtual int64_t to_string(char *buf, const int64_t buf_len) const = 0; - // 设置选举优先级 + // Set election priority virtual int set_priority(ElectionPriority *priority) = 0; virtual int reset_priority() = 0; - // 处理消息 + // Process message virtual int handle_message(const ElectionPrepareRequestMsg &msg) = 0; virtual int handle_message(const ElectionAcceptRequestMsg &msg) = 0; virtual int handle_message(const ElectionPrepareResponseMsg &msg) = 0; diff --git a/src/logservice/palf/election/interface/election_msg_handler.h b/src/logservice/palf/election/interface/election_msg_handler.h index 76ed4ecf2..aa9ae7ab5 100644 --- a/src/logservice/palf/election/interface/election_msg_handler.h +++ b/src/logservice/palf/election/interface/election_msg_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_PALF_ELECTION_INTERFACE_OB_I_ELECTION_MSG_HANDLER_H @@ -31,7 +35,7 @@ class ElectionChangeLeaderMsg; class ElectionMsgSender { -// 需要由外部实现的消息发送接口 +// Need to be implemented externally message sending interface public: virtual int broadcast(const ElectionPrepareRequestMsg &msg, const common::ObIArray &list) const = 0; @@ -46,4 +50,4 @@ class ElectionMsgSender } } -#endif \ No newline at end of file +#endif diff --git a/src/logservice/palf/election/interface/election_priority.h b/src/logservice/palf/election/interface/election_priority.h index de45e7a36..81a4d88bd 100644 --- a/src/logservice/palf/election/interface/election_priority.h +++ b/src/logservice/palf/election/interface/election_priority.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_PALF_ELECTION_INTERFACE_OB_I_ELECTION_PRIORITY_H @@ -28,15 +32,15 @@ class ElectionPriority { public: virtual ~ElectionPriority() {} - // 在日志中打印priority的能力 + // Print the capability to log priority virtual int64_t to_string(char *buf, const int64_t buf_len) const = 0; - // 优先级需要序列化能力,以便通过消息传递给其他副本 + // Priority needs serialization capability to be passed to other replicas via messages virtual int serialize(char* buf, const int64_t buf_len, int64_t& pos) const = 0; virtual int deserialize(const char* buf, const int64_t data_len, int64_t& pos) = 0; virtual int64_t get_serialize_size(void) const = 0; - // 主动刷新选举优先级的方法 + // The method for actively refreshing election priority virtual int refresh() = 0; - // 在priority间进行比较的方法 + // The method for comparing between priorities virtual int compare_with(const ElectionPriority &rhs, const uint64_t compare_version, const bool decentralized_voting, @@ -44,11 +48,11 @@ class ElectionPriority common::ObStringHolder &reason) const = 0; virtual int get_size_of_impl_type() const = 0; virtual void placement_new_impl(void *ptr) const = 0; - // 跳过RCS直接切主 + // Skip RCS and directly switch to leader virtual bool has_fatal_failure() const = 0; }; } } } -#endif \ No newline at end of file +#endif diff --git a/src/logservice/palf/election/message/election_message.cpp b/src/logservice/palf/election/message/election_message.cpp index 86e1354b3..6995bea83 100644 --- a/src/logservice/palf/election/message/election_message.cpp +++ b/src/logservice/palf/election/message/election_message.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "election_message.h" diff --git a/src/logservice/palf/election/message/election_message.h b/src/logservice/palf/election/message/election_message.h index b560e1a21..f6d5d5528 100644 --- a/src/logservice/palf/election/message/election_message.h +++ b/src/logservice/palf/election/message/election_message.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_PALF_ELECTION_MESSAGE_OB_ELECTION_MESSAGE_H @@ -204,7 +208,7 @@ class ElectionPrepareResponseMsgMiddle : public ElectionMsgBase TO_STRING_KV(BASE, K_(accepted), K_(lease), K_(request_debug_ts)); #undef BASE private: - bool accepted_;// 请求是否被接受 + bool accepted_;// Whether the request was accepted Lease lease_;// may be "EMPTY" ElectionMsgDebugTs request_debug_ts_; }; @@ -474,4 +478,4 @@ class ElectionChangeLeaderMsg : public ElectionChangeLeaderMsgMiddle }// namespace palf }// namesapce oceanbase -#endif \ No newline at end of file +#endif diff --git a/src/logservice/palf/election/utils/election_args_checker.h b/src/logservice/palf/election/utils/election_args_checker.h index 7b6c4cb76..6ce7c5247 100644 --- a/src/logservice/palf/election/utils/election_args_checker.h +++ b/src/logservice/palf/election/utils/election_args_checker.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_PALF_ELECTION_UTILS_OB_ELECTION_ARGS_CHECKER_H diff --git a/src/logservice/palf/election/utils/election_common_define.h b/src/logservice/palf/election/utils/election_common_define.h index 46db77d98..ac1938f58 100644 --- a/src/logservice/palf/election/utils/election_common_define.h +++ b/src/logservice/palf/election/utils/election_common_define.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_PALF_ELECTION_UTILS_OB_ELECTION_COMMON_DEFINE_H @@ -112,14 +116,14 @@ enum class PRIORITY_SEED_BIT : uint64_t constexpr int64_t MSG_DELAY_WARN_THRESHOLD = 200_ms; constexpr int64_t MAX_LEASE_TIME = 10_s; constexpr int64_t PRIORITY_BUFFER_SIZE = 512; -constexpr int64_t INVALID_VALUE = -1;// 所有int64_t变量的初始默认无效值 +constexpr int64_t INVALID_VALUE = -1;// The initial default invalid value for all int64_t variables constexpr int64_t CACHE_EXPIRATION_TIME = 5_s; -extern int64_t MAX_TST; // 最大单程消息延迟,暂设为1s,在单测中会将其调低,日后可改为配置项,现阶段先用全局变量代替 -inline int64_t CALCULATE_RENEW_LEASE_INTERVAL() { return std::min(0.5 * MAX_TST, 500_ms); }// 续约周期固定为消息延迟的一半,最大不超过500ms -inline int64_t CALCULATE_TIME_WINDOW_SPAN_TS() { return 2 * MAX_TST; }// 时间窗口的长度,为两个最大单程消息延迟, 默认为2s -inline int64_t CALCULATE_MAX_ELECT_COST_TIME() { return 10 * MAX_TST; }// 一次选举可能出现的最大耗时设置,默认为10s -inline int64_t CALCULATE_LEASE_INTERVAL() { return 4 * MAX_TST; }// 4个消息延迟,默认是4s -inline int64_t CALCULATE_TRIGGER_ELECT_WATER_MARK() { return std::min(MAX_TST, 1_s); }// 触发无主选举的Lease剩余水位线,1个最大消息延迟,最大不超过1s +extern int64_t MAX_TST; // Maximum one-way message delay, temporarily set to 1s, it will be lowered in unit tests, can be changed to a configuration item later, for now use a global variable as a substitute +inline int64_t CALCULATE_RENEW_LEASE_INTERVAL() { return std::min(0.5 * MAX_TST, 500_ms); }// Renewal interval is fixed at half of the message delay, with a maximum of 500ms +inline int64_t CALCULATE_TIME_WINDOW_SPAN_TS() { return 2 * MAX_TST; }// The length of the time window, which is two times the maximum one-way message delay, default is 2s +inline int64_t CALCULATE_MAX_ELECT_COST_TIME() { return 10 * MAX_TST; }// The maximum time an election may take, default is 10s +inline int64_t CALCULATE_LEASE_INTERVAL() { return 4 * MAX_TST; }// 4 message delays, default is 4s +inline int64_t CALCULATE_TRIGGER_ELECT_WATER_MARK() { return std::min(MAX_TST, 1_s); }// Water mark for triggering leader election, 1 max message delay, not exceeding 1s }// namespace election }// namespace palf diff --git a/src/logservice/palf/election/utils/election_event_recorder.cpp b/src/logservice/palf/election/utils/election_event_recorder.cpp index 1fe727a4a..4cc32f819 100644 --- a/src/logservice/palf/election/utils/election_event_recorder.cpp +++ b/src/logservice/palf/election/utils/election_event_recorder.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/ob_server_event_history_table_operator.h" diff --git a/src/logservice/palf/election/utils/election_event_recorder.h b/src/logservice/palf/election/utils/election_event_recorder.h index de8cbbe21..76b76cfae 100644 --- a/src/logservice/palf/election/utils/election_event_recorder.h +++ b/src/logservice/palf/election/utils/election_event_recorder.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_PALF_ELECTION_UTILS_ELECTION_EVENT_HISTORY_ACCESSOR_H @@ -80,17 +84,17 @@ class EventRecorder ls_id_(ls_id), self_addr_(self_addr), timer_(timer), need_report_(true) {} void set_need_report(const bool need_report) { need_report_ = need_report; } // proposer event - int report_decentralized_to_be_leader_event(const MemberListWithStates &member_list_with_states);// 当选Leader - int report_leader_lease_expired_event(const MemberListWithStates &member_list_with_states);// Leader续约失败卸任 - int report_directly_change_leader_event(const ObAddr &dest_svr, const ObStringHolder &reason);// Leader直接切主,不走RCS流程 - int report_prepare_change_leader_event(const ObAddr &dest_svr, const ObStringHolder &reason);// 旧Leader准备切主 - int report_change_leader_to_revoke_event(const ObAddr &dest_svr);// 旧Leader卸任 - int report_change_leader_to_takeover_event(const ObAddr &addr);// 新Leader上任 - int report_member_list_changed_event(const MemberList &old_list, const MemberList &new_list);// 修改成员列表 + int report_decentralized_to_be_leader_event(const MemberListWithStates &member_list_with_states);// Elected as Leader + int report_leader_lease_expired_event(const MemberListWithStates &member_list_with_states);// Leader lease renewal failed, resigning + int report_directly_change_leader_event(const ObAddr &dest_svr, const ObStringHolder &reason);// Leader directly switch to leader without going through the RCS process + int report_prepare_change_leader_event(const ObAddr &dest_svr, const ObStringHolder &reason);// Old Leader prepares for leader-follower switch + int report_change_leader_to_revoke_event(const ObAddr &dest_svr);// Old Leader resigns + int report_change_leader_to_takeover_event(const ObAddr &addr);// New Leader takes over + int report_member_list_changed_event(const MemberList &old_list, const MemberList &new_list);// Modify member list // acceptor event - int report_vote_event(const ObAddr &dest_svr, const ObStringHolder &reason);// 一呼百应prepare阶段投票 - int report_acceptor_lease_expired_event(const Lease &lease);// Lease到期 - int report_acceptor_witness_change_leader_event(const ObAddr &old_leader, const ObAddr &new_leader);// 见证切主事件 + int report_vote_event(const ObAddr &dest_svr, const ObStringHolder &reason);// one-to-all prepare phase voting + int report_acceptor_lease_expired_event(const Lease &lease);// Lease expired + int report_acceptor_witness_change_leader_event(const ObAddr &old_leader, const ObAddr &new_leader);// witness leader switch event int64_t to_string(char *buf, const int64_t len) const; private: int report_event_(ElectionEventType type, const common::ObString &info); @@ -104,4 +108,4 @@ class EventRecorder } } -#endif \ No newline at end of file +#endif diff --git a/src/logservice/palf/election/utils/election_member_list.cpp b/src/logservice/palf/election/utils/election_member_list.cpp index 965a5610f..adab990bd 100644 --- a/src/logservice/palf/election/utils/election_member_list.cpp +++ b/src/logservice/palf/election/utils/election_member_list.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "election_member_list.h" @@ -56,30 +60,30 @@ bool MemberList::operator==(const MemberList &rhs) const { ELECT_TIME_GUARD(500_ms); bool ret = false; - // 检查旧的成员组的信息是否一致 + // Check if the information of the old member group is consistent int valid_member_list_count = 0; valid_member_list_count += rhs.is_valid() ? 1 : 0; valid_member_list_count += this->is_valid() ? 1 : 0; - if (valid_member_list_count == 0) {// 两个都是无效的 + if (valid_member_list_count == 0) {// both are invalid} ret = true; - } else if (valid_member_list_count == 2) {// 两个都是有效的 + } else if (valid_member_list_count == 2) {// both are valid if (membership_version_ == rhs.membership_version_ && replica_num_ == rhs.replica_num_) { - // 成员版本号和副本数量相等 - if (addr_list_.count() == rhs.addr_list_.count()) {// 成员列表的数量一致 + // Member version number and replica count are equal + if (addr_list_.count() == rhs.addr_list_.count()) {// The number of members in the list is consistent ret = true; for (int64_t i = 0; i < addr_list_.count() && ret; ++i) { - // 判断对于自己成员列表中的每一个成员是否都能在rhs中找到 - if (addr_list_[i] != rhs.addr_list_[i]) {// 要求成员列表的顺序和成员是一致的 + // Determine if every member in our member list can be found in rhs + if (addr_list_[i] != rhs.addr_list_[i]) {// The order and members of the member list must be consistent ret = false; } } - } else {// 成员列表的数量不一致 + } else {// The number of members in the list is inconsistent ret = false; } - } else {// 成员版本号和副本数量不等 + } else {// member version number and replica count are not equal ret = false; } - } else {// 其中一个有效,一个无效 + } else {// one is valid, the other is invalid ret = false; } return ret; diff --git a/src/logservice/palf/election/utils/election_member_list.h b/src/logservice/palf/election/utils/election_member_list.h index 61f47254e..cada7065e 100644 --- a/src/logservice/palf/election/utils/election_member_list.h +++ b/src/logservice/palf/election/utils/election_member_list.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_PALF_ELECTION_UTILS_OB_ELECTION_MEMBERLIST_H @@ -51,4 +55,4 @@ class MemberList } } -#endif \ No newline at end of file +#endif diff --git a/src/logservice/palf/election/utils/election_utils.cpp b/src/logservice/palf/election/utils/election_utils.cpp index e10474dd7..b8c25e11b 100644 --- a/src/logservice/palf/election/utils/election_utils.cpp +++ b/src/logservice/palf/election/utils/election_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "election_utils.h" @@ -179,8 +183,8 @@ int MemberListWithStates::record_accept_ok(const ElectionAcceptResponseMsg &acce if (ok_count < (p_impl_->member_list_.get_replica_num() / 2 + 1)) { ret = OB_ELECTION_BELOW_MAJORITY; } - // 这里不能返回OVER_MAJORITY,因为在续约阶段,所有的accept_ok_promise_not_vote_before_local_ts_都是 - // 有效的,并且这里不判断OVER_MAJORITY的另一个好处是,每一次返回accept ok都可能把leader lease向后推进 + // Here we cannot return OVER_MAJORITY, because during the renewal phase, all accept_ok_promise_not_vote_before_local_ts_ are + // valid, and another benefit here is that every return of accept ok may advance the leader lease } return ret; } @@ -337,7 +341,7 @@ void Lease::get_owner_and_ballot(ObAddr &owner, int64_t &ballot) const } bool Lease::is_expired() const -{ // is_expired()只支持在本地判断 +{ // is_expired() only supports local judgment TCRLockGuard guard(lock_); return get_monotonic_ts() > lease_end_ts_; } @@ -355,7 +359,7 @@ void Lease::reset() } bool Lease::is_empty() const -{ // is_empty()支持在任意机器上判断 +{ // is_empty() supports checking on any machine TCRLockGuard guard(lock_); return !owner_.is_valid() && lease_end_ts_ == -1; } diff --git a/src/logservice/palf/election/utils/election_utils.h b/src/logservice/palf/election/utils/election_utils.h index 9320917c5..85da4df6d 100644 --- a/src/logservice/palf/election/utils/election_utils.h +++ b/src/logservice/palf/election/utils/election_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_PALF_ELECTION_UTILS_OB_ELECTION_UTILS_H @@ -128,7 +132,7 @@ inline int get_sorted_majority_one_desc(const common::ObArray &array, T &majo } if (OB_SUCC(ret)) { (void) bubble_sort_desc(temp_array); - majority_element = temp_array[temp_array.count() / 2];// 从高到低排序取第n/2 + 1个值 + majority_element = temp_array[temp_array.count() / 2]; // From high to low sort and take the n/2 + 1th value } return ret; } @@ -229,9 +233,9 @@ class Lease TO_STRING_KV(K_(owner), LEASE_END, K_(ballot_number)); #undef LEASE_END private: - common::ObAddr owner_; // 发出Lease的Proposer - int64_t lease_end_ts_; // 即Lease End - int64_t ballot_number_; // 即paxos中的proposal id + common::ObAddr owner_; // Proposer that issues the Lease + int64_t lease_end_ts_; // i.e. Lease End + int64_t ballot_number_; // proposal id in paxos RWLock lock_; }; @@ -335,28 +339,27 @@ void MemberListWithStates::print_array_in_pretty_way_(char *buf, const int64_t b } } }; - -// 从排查问题的经验来看,选举模块已经稳定,没有发生因为自身问题导致的无主 -// 但测试环境中还是经常会出现无主报错,这通常是其他原因引起的,例如: -// 1. palf工作线程卡住,无法处理消息 -// 2. observer内存耗尽,可以发出但是无法接收消息 -// 3. server处于stop状态,但是没有完全退出,可以发出但是无法接收消息 -// 4. 多数派core,无法选主 -// 5. 其他由于observer内部其他模块异常导致的消息收发问题。 +// From the experience of troubleshooting, the election module has been stable, and there have been no cases of leaderless state caused by its own issues +// But errors without a leader still frequently occur in the test environment, this is usually caused by other reasons, for example: +// 1. palf worker thread is stuck and unable to process messages +// 2. observer memory exhausted, can send but cannot receive messages +// 3. server is in stop state, but has not completely exited, can send but cannot receive messages +// 4. Majority core, unable to elect leader +// 5. Other message reception and transmission issues caused by exceptions in other modules within the observer. // -// 尽管真实的网络环境正常,但由于observer内部的问题,以上情况对于选举模块来说等同于网络分区/单向网络连通 -// 设计以下数据结构用来记录消息收发的情况,用于快速提供信息排查问题: -// 1. 发过多少消息,什么类型,分别发给了哪些server,最后一次给他们发出消息的时间戳是多少 -// 2. 收到多少消息,什么类型,分别来自哪些server,最后一次收到他们发来消息的时间戳是多少 +// Although the real network environment is normal, due to internal issues in the observer, the above situation is equivalent to a network partition/unidirectional network connectivity for the election module +// Design the following data structure to record message sending and receiving situations, used for quick information retrieval to troubleshoot issues: +// 1. How many messages have been sent, what types they are, to which servers they were sent, and the timestamp of the last message sent to them +// 2. How many messages received, what type, from which servers, and the timestamp of the last message received from them class ElectionMsgCounter { - // 按IP地址分类 + // Classify by IP address class AddrMsgCounter { - // 按消息类型分类 + // Classify by message type struct MsgCounter { - // 统计消息收发数量以及最后一次收发的时间戳 + // Statistics of message send/receive counts and the timestamp of the last send/receive struct Counter { Counter() : send_count_(0), receive_count_(0), last_send_ts_(0), last_received_ts_(0) {} @@ -404,7 +407,7 @@ class ElectionMsgCounter MsgCounter *find(const common::ObAddr &addr); MsgCounter *find_or_reuse_item_(const common::ObAddr &addr); int idx_; - // 按副本IP分类, 维护最近通信的MAP_SIZE个消息收发记录 + // Classify by replica IP, maintain the most recent MAP_SIZE message send/receive records ObTuple addr_mapper_[MAP_SIZE]; }; public: diff --git a/src/logservice/palf/fetch_log_engine.cpp b/src/logservice/palf/fetch_log_engine.cpp index d395b1f26..8f8e8c505 100644 --- a/src/logservice/palf/fetch_log_engine.cpp +++ b/src/logservice/palf/fetch_log_engine.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "fetch_log_engine.h" diff --git a/src/logservice/palf/fetch_log_engine.h b/src/logservice/palf/fetch_log_engine.h index 29bf85102..f034540a6 100644 --- a/src/logservice/palf/fetch_log_engine.h +++ b/src/logservice/palf/fetch_log_engine.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_FETCH_LOG_ENGINE_ diff --git a/src/logservice/palf/fixed_sliding_window.h b/src/logservice/palf/fixed_sliding_window.h index 514e75710..1b8b1a85e 100644 --- a/src/logservice/palf/fixed_sliding_window.h +++ b/src/logservice/palf/fixed_sliding_window.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_FIXED_SLIDING_WINDOW_ diff --git a/src/logservice/palf/log_ack_info.h b/src/logservice/palf/log_ack_info.h index 075ddc1cc..8471f3e97 100644 --- a/src/logservice/palf/log_ack_info.h +++ b/src/logservice/palf/log_ack_info.h @@ -1,12 +1,18 @@ -// Copyright (c) 2021 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #ifndef OCEANBASE_LOGSERVICE_LOG_ACK_INFO_ #define OCEANBASE_LOGSERVICE_LOG_ACK_INFO_ @@ -65,9 +71,9 @@ struct LogMemberAckInfo last_flushed_end_lsn_(last_flushed_end_lsn) { } common::ObMember member_; - // 降级时 double check + // Downgrade when double check int64_t last_ack_time_us_; - // 升级时double check + // Upgrade time double check LSN last_flushed_end_lsn_; void operator=(const LogMemberAckInfo &ack_info) diff --git a/src/logservice/palf/log_block_handler.cpp b/src/logservice/palf/log_block_handler.cpp index 3dcd74992..2cbe0ad39 100644 --- a/src/logservice/palf/log_block_handler.cpp +++ b/src/logservice/palf/log_block_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_block_handler.h" diff --git a/src/logservice/palf/log_block_handler.h b/src/logservice/palf/log_block_handler.h index 6b22fd4ef..3de667f6f 100644 --- a/src/logservice/palf/log_block_handler.h +++ b/src/logservice/palf/log_block_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_FILE_HANDLER_ diff --git a/src/logservice/palf/log_block_header.cpp b/src/logservice/palf/log_block_header.cpp index 5fe479a7d..c9b21e98a 100644 --- a/src/logservice/palf/log_block_header.cpp +++ b/src/logservice/palf/log_block_header.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_block_header.h" diff --git a/src/logservice/palf/log_block_header.h b/src/logservice/palf/log_block_header.h index 7bc510331..607d45c97 100644 --- a/src/logservice/palf/log_block_header.h +++ b/src/logservice/palf/log_block_header.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_BLOCK_HEADER_ diff --git a/src/logservice/palf/log_block_mgr.cpp b/src/logservice/palf/log_block_mgr.cpp index 8254d2069..5b806588b 100644 --- a/src/logservice/palf/log_block_mgr.cpp +++ b/src/logservice/palf/log_block_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_block_mgr.h" @@ -335,7 +339,7 @@ int LogBlockMgr::rename_tmp_block_handler_to_normal(const block_id_t block_id) // For block gc, truncate will not concurrent with delete(truncate and delete block will not // operate the same range). // For migrate(truncate prefix), only one log io worker to execute truncate suffix and prefix. -// TODO by runlin: 即使truncate_prefix_block的工作由GC线程完成, 也不应该存在并发 +// TODO by runlin: Even if the work of truncate_prefix_block is done by the GC thread, there should not be any concurrency int LogBlockMgr::do_truncate_(const block_id_t block_id, const offset_t offset) { diff --git a/src/logservice/palf/log_block_mgr.h b/src/logservice/palf/log_block_mgr.h index d63561c8a..ca2a06c07 100644 --- a/src/logservice/palf/log_block_mgr.h +++ b/src/logservice/palf/log_block_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_FILE_MGR_ diff --git a/src/logservice/palf/log_block_pool_interface.cpp b/src/logservice/palf/log_block_pool_interface.cpp index 8ce2d2cb2..b3774734f 100644 --- a/src/logservice/palf/log_block_pool_interface.cpp +++ b/src/logservice/palf/log_block_pool_interface.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_block_pool_interface.h" diff --git a/src/logservice/palf/log_block_pool_interface.h b/src/logservice/palf/log_block_pool_interface.h index 0ae936d9e..483443d82 100644 --- a/src/logservice/palf/log_block_pool_interface.h +++ b/src/logservice/palf/log_block_pool_interface.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_BLOCK_POOL_INTERFACE_ diff --git a/src/logservice/palf/log_cache.cpp b/src/logservice/palf/log_cache.cpp index a95e49e1d..2f57a8f95 100644 --- a/src/logservice/palf/log_cache.cpp +++ b/src/logservice/palf/log_cache.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF diff --git a/src/logservice/palf/log_cache.h b/src/logservice/palf/log_cache.h index db3cdae34..b290f22aa 100644 --- a/src/logservice/palf/log_cache.h +++ b/src/logservice/palf/log_cache.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_PALF_LOG_CACHE_ diff --git a/src/logservice/palf/log_checksum.cpp b/src/logservice/palf/log_checksum.cpp index 9b26dfc57..0071ff3f7 100644 --- a/src/logservice/palf/log_checksum.cpp +++ b/src/logservice/palf/log_checksum.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_checksum.h" diff --git a/src/logservice/palf/log_checksum.h b/src/logservice/palf/log_checksum.h index e17699298..b11c2212b 100644 --- a/src/logservice/palf/log_checksum.h +++ b/src/logservice/palf/log_checksum.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_CHECKSUM_ diff --git a/src/logservice/palf/log_config_mgr.cpp b/src/logservice/palf/log_config_mgr.cpp index 55e21d951..6e2814102 100755 --- a/src/logservice/palf/log_config_mgr.cpp +++ b/src/logservice/palf/log_config_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF diff --git a/src/logservice/palf/log_config_mgr.h b/src/logservice/palf/log_config_mgr.h index 2270b75fb..42f9a0440 100755 --- a/src/logservice/palf/log_config_mgr.h +++ b/src/logservice/palf/log_config_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_CONFIG_MGR_ @@ -472,8 +476,7 @@ class LogConfigMgr // for PalfHandleImpl::receive_config_log virtual bool can_receive_config_log(const common::ObAddr &leader, const LogConfigMeta &meta) const; virtual int after_flush_config_log(const LogConfigVersion &config_version); - - // follower接收到成员变更日志需要进行前向校验 + // follower receives member change log and needs to perform forward validation virtual int receive_config_log(const common::ObAddr &leader, const LogConfigMeta &meta); // for PalfHandleImpl::ack_config_log diff --git a/src/logservice/palf/log_define.cpp b/src/logservice/palf/log_define.cpp index 9d96dc3f5..8fbaa16f9 100644 --- a/src/logservice/palf/log_define.cpp +++ b/src/logservice/palf/log_define.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_define.h" diff --git a/src/logservice/palf/log_define.h b/src/logservice/palf/log_define.h index db9054c14..b97a02211 100644 --- a/src/logservice/palf/log_define.h +++ b/src/logservice/palf/log_define.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_DEFINE_ @@ -67,7 +71,7 @@ const int64_t PALF_PHY_BLOCK_SIZE = 1 << 26; const int64_t PALF_BLOCK_SIZE = PALF_PHY_BLOCK_SIZE - MAX_INFO_BLOCK_SIZE; // log block size is 64M-MAX_INFO_BLOCK_SIZE by default. const int64_t PALF_META_BLOCK_SIZE = PALF_PHY_BLOCK_SIZE - MAX_INFO_BLOCK_SIZE; // meta block size is 64M-MAX_INFO_BLOCK_SIZE by default. -constexpr int64_t CLOG_FILE_TAIL_PADDING_TRIGGER = 4096; // 文件尾剩余空间补padding阈值 +constexpr int64_t CLOG_FILE_TAIL_PADDING_TRIGGER = 4096; // Threshold for padding the remaining space at the end of the file // The valid group_entry (not padding entry) size range is: // (0, (MAX_LOG_BODY_SIZE + MAX_LOG_HEADER_SIZE) ). // The padding group_entry size range is: @@ -121,7 +125,7 @@ const int64_t PALF_SYNC_RPC_TIMEOUT_US = 2 * 1000 * 1000; const int64_t PALF_LOG_SYNC_DELAY_THRESHOLD_US = 3 * 1000 * 1000L; // 3 s constexpr int64_t INVALID_PROPOSAL_ID = INT64_MAX; constexpr int64_t PALF_MAX_PROPOSAL_ID = INT64_MAX - 1; -constexpr int64_t PALF_INITIAL_PROPOSAL_ID = 0; +constexpr int64_t PALF_INITIAL_PROPOSAL_ID = 1; constexpr char PADDING_LOG_CONTENT_CHAR = '\0'; const int64_t MIN_WRITING_THTOTTLING_TRIGGER_PERCENTAGE = 40; constexpr int64_t PALF_IO_WAIT_EVENT_TIMEOUT_MS = 100; diff --git a/src/logservice/palf/log_engine.cpp b/src/logservice/palf/log_engine.cpp index 9e072471e..e541bbabd 100644 --- a/src/logservice/palf/log_engine.cpp +++ b/src/logservice/palf/log_engine.cpp @@ -1,13 +1,17 @@ -/**log_engine.cpp - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF diff --git a/src/logservice/palf/log_engine.h b/src/logservice/palf/log_engine.h index 9c045676f..bf3c169ba 100644 --- a/src/logservice/palf/log_engine.h +++ b/src/logservice/palf/log_engine.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_ENGINE_ diff --git a/src/logservice/palf/log_entry.cpp b/src/logservice/palf/log_entry.cpp index c6afa480e..00a1e613b 100644 --- a/src/logservice/palf/log_entry.cpp +++ b/src/logservice/palf/log_entry.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_entry.h" diff --git a/src/logservice/palf/log_entry.h b/src/logservice/palf/log_entry.h index a55e2ad35..81d0a96df 100644 --- a/src/logservice/palf/log_entry.h +++ b/src/logservice/palf/log_entry.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_ENTRY_ diff --git a/src/logservice/palf/log_entry_header.cpp b/src/logservice/palf/log_entry_header.cpp index b464ce70d..1bda20a55 100644 --- a/src/logservice/palf/log_entry_header.cpp +++ b/src/logservice/palf/log_entry_header.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_entry_header.h" diff --git a/src/logservice/palf/log_entry_header.h b/src/logservice/palf/log_entry_header.h index 31b3f0fd1..8fed2b5eb 100644 --- a/src/logservice/palf/log_entry_header.h +++ b/src/logservice/palf/log_entry_header.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_ENTRY_HEADER_ diff --git a/src/logservice/palf/log_group_buffer.cpp b/src/logservice/palf/log_group_buffer.cpp index 510c33d4f..f57589f5f 100644 --- a/src/logservice/palf/log_group_buffer.cpp +++ b/src/logservice/palf/log_group_buffer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_group_buffer.h" @@ -96,10 +100,10 @@ void LogGroupBuffer::destroy() int LogGroupBuffer::get_buffer_pos_(const LSN &lsn, int64_t &start_pos) const { - // 根据lsn获取buffer中对应的位置 - // 转换方法依赖buffer start_lsn之后的文件size不变 - // 如果文件size发生了变化,buffer append到切文件位置时需要做barrier处理 - // 等前一个文件都pop出去后整体reuse为下一个文件 + // Get the corresponding position in the buffer according to lsn + // The conversion method relies on the file size not changing after buffer start_lsn + // If the file size has changed, a barrier needs to be handled when buffer appends to the cut file position + // Wait until the previous file is all popped out before reusing it for the next file int ret = OB_SUCCESS; LSN start_lsn; get_buffer_start_lsn_(start_lsn); @@ -159,8 +163,7 @@ bool LogGroupBuffer::can_handle_new_log(const LSN &lsn, } return bool_ret; } - -// 获取完整的log buffer(含log_group_entry_header) +// Get the complete log buffer (including log_group_entry_header) int LogGroupBuffer::get_log_buf(const LSN &lsn, const int64_t total_len, LogWriteBuf &log_buf) { int ret = OB_SUCCESS; @@ -214,11 +217,11 @@ int LogGroupBuffer::fill(const LSN &lsn, ret = OB_ERR_UNEXPECTED; PALF_LOG(WARN, "lsn is less than start_lsn", K(ret), K(lsn), K(end_lsn), K(start_lsn), K(reuse_lsn)); } else if (end_lsn <= reuse_lsn) { - // 要填充的终点预期应该比buffer复用的起点大 + // The expected end point to be filled should be greater than the start point of buffer reuse ret = OB_ERR_UNEXPECTED; PALF_LOG(WARN, "end_lsn is less than reuse_lsn", K(ret), K(lsn), K(end_lsn), K(start_lsn), K(reuse_lsn)); } else if (end_lsn > reuse_lsn + available_buf_size) { - // double check: 要填充的终点超过了buffer可复用的范围 + // double check: the endpoint to be filled exceeds the reusable range of the buffer ret = OB_EAGAIN; PALF_LOG(WARN, "end_lsn is greater than reuse end pos", K(ret), K(lsn), K(end_lsn), K(reuse_lsn), K(available_buf_size)); } else if (OB_FAIL(get_buffer_pos_(lsn, start_pos))) { @@ -257,12 +260,12 @@ int LogGroupBuffer::fill_padding_body(const LSN &lsn, ret = OB_ERR_UNEXPECTED; PALF_LOG(WARN, "lsn is less than start_lsn", K(ret), K(lsn), K_(start_lsn)); } else if (end_lsn <= reuse_lsn) { - // 要填充的终点预期应该比buffer复用的起点大 + // The expected endpoint to be filled should be greater than the start point of buffer reuse ret = OB_ERR_UNEXPECTED; PALF_LOG(WARN, "end_lsn is less than reuse_lsn", K(ret), K(lsn), K(end_lsn), K(reuse_lsn)); } else if (end_lsn > reuse_lsn + available_buf_size) { - // double check: 要填充的终点超过了buffer可复用的范围 - // 因为wait()成功后调用fill()之前buffer的start_lsn_可能发生更新 + // double check: the endpoint to be filled exceeds the reusable range of the buffer + // Because start_lsn_ of the buffer may be updated between a successful wait() and the call to fill() ret = OB_EAGAIN; PALF_LOG(WARN, "end_lsn is greater than reuse end pos", K(ret), K(lsn), K(end_lsn), K(reuse_lsn), K(available_buf_size)); } else if (OB_FAIL(get_buffer_pos_(lsn, start_pos))) { @@ -337,8 +340,7 @@ int LogGroupBuffer::check_log_buf_wrapped(const LSN &lsn, const int64_t log_len, } return ret; } - -// 依赖palf_handle_impl的写锁确保调用本接口期间无并发更新group_buffer操作 +// Depend on the write lock of palf_handle_impl to ensure no concurrent updates to group_buffer during the call to this interface int LogGroupBuffer::to_leader() { int ret = OB_SUCCESS; @@ -355,8 +357,7 @@ int LogGroupBuffer::to_leader() PALF_LOG(INFO, "to_leader finished", K(ret), K_(available_buffer_size), K_(reserved_buffer_size)); return ret; } - -// 依赖palf_handle_impl的写锁确保调用本接口期间无并发更新group_buffer操作 +// Depend on the write lock of palf_handle_impl to ensure no concurrent updates to group_buffer during the call to this interface int LogGroupBuffer::to_follower() { int ret = OB_SUCCESS; diff --git a/src/logservice/palf/log_group_buffer.h b/src/logservice/palf/log_group_buffer.h index eef896cc5..5b2a45e1f 100644 --- a/src/logservice/palf/log_group_buffer.h +++ b/src/logservice/palf/log_group_buffer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_LOG_BUFFER_ @@ -32,14 +36,13 @@ class LogGroupBuffer int init(const LSN &start_lsn); void reset(); void destroy(); - // - // 功能: 将日志体填充到聚合buffer + // Function: Fill the log body into the aggregation buffer // - // @param [in] lsn, 聚合buffer中填充起始偏移量 - // @param [in] data, 数据内容指针 - // @param [in] data_len, 数据长度 - // @param [in] cb, 回调对象指针 + // @param [in] lsn, starting offset for filling in the aggregation buffer + // @param [in] data, data content pointer + // @param [in] data_len, data length + // @param [in] cb, callback object pointer // // return code: // OB_SUCCESS @@ -100,21 +103,21 @@ class LogGroupBuffer const char *data, const int64_t data_len); private: - // buffer起始位置对应的lsn + // buffer start position corresponding lsn LSN start_lsn_; - // buffer可复用起点对应的lsn, 与max_flushed_end_lsn预期最终是相等的. - // 所有更新max_flushed_end_lsn的逻辑都要考虑一并更新该值. + // buffer reusable start point corresponding lsn, which is expected to be equal to max_flushed_end_lsn eventually. + // All logic that updates max_flushed_end_lsn should also consider updating this value. LSN reuse_lsn_; // lock for truncate operation. mutable common::ObSpinLock truncate_lock_; // This field is used for recording the readable begin lsn. // It won't fallback. LSN readable_begin_lsn_; - // 分配的buffer size + // allocated buffer size int64_t reserved_buffer_size_; - // 当前可用的buffer size + // current available buffer size int64_t available_buffer_size_; - // buffer指针 + // buffer pointer char *data_buf_; bool is_inited_; private: diff --git a/src/logservice/palf/log_group_entry.cpp b/src/logservice/palf/log_group_entry.cpp index b08374ddd..1bd2027b7 100644 --- a/src/logservice/palf/log_group_entry.cpp +++ b/src/logservice/palf/log_group_entry.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_group_entry.h" diff --git a/src/logservice/palf/log_group_entry.h b/src/logservice/palf/log_group_entry.h index 3f2734dee..4f625a7c5 100644 --- a/src/logservice/palf/log_group_entry.h +++ b/src/logservice/palf/log_group_entry.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_GROUP_ENTRY_ diff --git a/src/logservice/palf/log_group_entry_header.cpp b/src/logservice/palf/log_group_entry_header.cpp index 0afb76014..c437c4319 100644 --- a/src/logservice/palf/log_group_entry_header.cpp +++ b/src/logservice/palf/log_group_entry_header.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_group_entry_header.h" // LogGroupEntryHeader diff --git a/src/logservice/palf/log_group_entry_header.h b/src/logservice/palf/log_group_entry_header.h index ce5801e8b..eb305d63f 100644 --- a/src/logservice/palf/log_group_entry_header.h +++ b/src/logservice/palf/log_group_entry_header.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_GROUP_ENTRY_HEADER_ diff --git a/src/logservice/palf/log_io_adapter.cpp b/src/logservice/palf/log_io_adapter.cpp index 3e7e0c926..86269de6c 100644 --- a/src/logservice/palf/log_io_adapter.cpp +++ b/src/logservice/palf/log_io_adapter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF diff --git a/src/logservice/palf/log_io_adapter.h b/src/logservice/palf/log_io_adapter.h index 75a0a180b..8b08eee3b 100644 --- a/src/logservice/palf/log_io_adapter.h +++ b/src/logservice/palf/log_io_adapter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_IO_ADAPTER_ @@ -105,4 +109,4 @@ class LogIOAdapter #define LOG_IO_DEVICE_WRAPPER ::oceanbase::palf::LogIODeviceWrapper::get_instance() } -#endif \ No newline at end of file +#endif diff --git a/src/logservice/palf/log_io_context.cpp b/src/logservice/palf/log_io_context.cpp index 5ac11d9b2..b42fa48e5 100644 --- a/src/logservice/palf/log_io_context.cpp +++ b/src/logservice/palf/log_io_context.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF diff --git a/src/logservice/palf/log_io_context.h b/src/logservice/palf/log_io_context.h index 1ea27407c..70470e33f 100644 --- a/src/logservice/palf/log_io_context.h +++ b/src/logservice/palf/log_io_context.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_IO_CONTEXT_ diff --git a/src/logservice/palf/log_io_task.cpp b/src/logservice/palf/log_io_task.cpp index 5ff8e1805..2fa540ac1 100644 --- a/src/logservice/palf/log_io_task.cpp +++ b/src/logservice/palf/log_io_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF diff --git a/src/logservice/palf/log_io_task.h b/src/logservice/palf/log_io_task.h index 4b41e051c..bff15a4fb 100644 --- a/src/logservice/palf/log_io_task.h +++ b/src/logservice/palf/log_io_task.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_IO_TASK_ diff --git a/src/logservice/palf/log_io_task_cb_thread_pool.cpp b/src/logservice/palf/log_io_task_cb_thread_pool.cpp index 14662925d..673ae2c7d 100644 --- a/src/logservice/palf/log_io_task_cb_thread_pool.cpp +++ b/src/logservice/palf/log_io_task_cb_thread_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_io_task_cb_thread_pool.h" diff --git a/src/logservice/palf/log_io_task_cb_thread_pool.h b/src/logservice/palf/log_io_task_cb_thread_pool.h index 6fe888474..7858a8ff8 100644 --- a/src/logservice/palf/log_io_task_cb_thread_pool.h +++ b/src/logservice/palf/log_io_task_cb_thread_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_IO_TASK_CB_THREAD_POOL_ diff --git a/src/logservice/palf/log_io_task_cb_utils.cpp b/src/logservice/palf/log_io_task_cb_utils.cpp index c6070cdc6..536235fa0 100644 --- a/src/logservice/palf/log_io_task_cb_utils.cpp +++ b/src/logservice/palf/log_io_task_cb_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_io_task_cb_utils.h" diff --git a/src/logservice/palf/log_io_task_cb_utils.h b/src/logservice/palf/log_io_task_cb_utils.h index 34232a72f..3268f7d08 100644 --- a/src/logservice/palf/log_io_task_cb_utils.h +++ b/src/logservice/palf/log_io_task_cb_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef LOGSERVICE_LOG_IO_TASK_CB_UTILS_ diff --git a/src/logservice/palf/log_io_utils.cpp b/src/logservice/palf/log_io_utils.cpp index 873377422..354feb6b3 100644 --- a/src/logservice/palf/log_io_utils.cpp +++ b/src/logservice/palf/log_io_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include // FALLOC_FL_ZERO_RANGE for linux kernel 3.15 diff --git a/src/logservice/palf/log_io_utils.h b/src/logservice/palf/log_io_utils.h index 8fbb43951..bbd26a48b 100644 --- a/src/logservice/palf/log_io_utils.h +++ b/src/logservice/palf/log_io_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_IO_UTILS_ diff --git a/src/logservice/palf/log_io_worker.cpp b/src/logservice/palf/log_io_worker.cpp index e50264834..2ef26636d 100644 --- a/src/logservice/palf/log_io_worker.cpp +++ b/src/logservice/palf/log_io_worker.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF diff --git a/src/logservice/palf/log_io_worker.h b/src/logservice/palf/log_io_worker.h index 91e4ca9fa..3698b9469 100644 --- a/src/logservice/palf/log_io_worker.h +++ b/src/logservice/palf/log_io_worker.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVIVE_LOG_IO_WORKER_ diff --git a/src/logservice/palf/log_io_worker_wrapper.cpp b/src/logservice/palf/log_io_worker_wrapper.cpp index 8e7b085bb..24fead9fc 100644 --- a/src/logservice/palf/log_io_worker_wrapper.cpp +++ b/src/logservice/palf/log_io_worker_wrapper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF diff --git a/src/logservice/palf/log_io_worker_wrapper.h b/src/logservice/palf/log_io_worker_wrapper.h index 1966f681f..b4bd51df1 100644 --- a/src/logservice/palf/log_io_worker_wrapper.h +++ b/src/logservice/palf/log_io_worker_wrapper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVIVE_LOG_IO_WORKER_WRAPPER_ diff --git a/src/logservice/palf/log_iterator_impl.h b/src/logservice/palf/log_iterator_impl.h index 058529aeb..8799a8c19 100644 --- a/src/logservice/palf/log_iterator_impl.h +++ b/src/logservice/palf/log_iterator_impl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_ITERATOR_ diff --git a/src/logservice/palf/log_iterator_info.h b/src/logservice/palf/log_iterator_info.h index 87e2ee054..69d6de706 100644 --- a/src/logservice/palf/log_iterator_info.h +++ b/src/logservice/palf/log_iterator_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include // UINT64_MAX #include "lib/ob_errno.h" // errno @@ -129,4 +133,4 @@ class LogIteratorInfo LSN start_lsn_; }; } -} \ No newline at end of file +} diff --git a/src/logservice/palf/log_iterator_storage.cpp b/src/logservice/palf/log_iterator_storage.cpp index eab3b5939..8695c3362 100644 --- a/src/logservice/palf/log_iterator_storage.cpp +++ b/src/logservice/palf/log_iterator_storage.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_iterator_storage.h" diff --git a/src/logservice/palf/log_iterator_storage.h b/src/logservice/palf/log_iterator_storage.h index 46b9866c0..a58db9bf2 100644 --- a/src/logservice/palf/log_iterator_storage.h +++ b/src/logservice/palf/log_iterator_storage.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_ITERATOR_STORAGE_ diff --git a/src/logservice/palf/log_learner.cpp b/src/logservice/palf/log_learner.cpp index 88d7697eb..9b18005f8 100644 --- a/src/logservice/palf/log_learner.cpp +++ b/src/logservice/palf/log_learner.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_learner.h" diff --git a/src/logservice/palf/log_learner.h b/src/logservice/palf/log_learner.h index 69997a18d..2b07d3843 100644 --- a/src/logservice/palf/log_learner.h +++ b/src/logservice/palf/log_learner.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_LEARNER_H_ diff --git a/src/logservice/palf/log_loop_thread.cpp b/src/logservice/palf/log_loop_thread.cpp index 418d6d4f3..1259ab2a2 100644 --- a/src/logservice/palf/log_loop_thread.cpp +++ b/src/logservice/palf/log_loop_thread.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_loop_thread.h" diff --git a/src/logservice/palf/log_loop_thread.h b/src/logservice/palf/log_loop_thread.h index 860bc1588..630f616aa 100644 --- a/src/logservice/palf/log_loop_thread.h +++ b/src/logservice/palf/log_loop_thread.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_LOOP_THREAD_ diff --git a/src/logservice/palf/log_meta.cpp b/src/logservice/palf/log_meta.cpp index b060e07c9..6b1ca5aea 100755 --- a/src/logservice/palf/log_meta.cpp +++ b/src/logservice/palf/log_meta.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_meta.h" diff --git a/src/logservice/palf/log_meta.h b/src/logservice/palf/log_meta.h index da6f66aa6..bcb348498 100644 --- a/src/logservice/palf/log_meta.h +++ b/src/logservice/palf/log_meta.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_META_ diff --git a/src/logservice/palf/log_meta_entry.cpp b/src/logservice/palf/log_meta_entry.cpp index e5e4aa8b3..5d1946968 100644 --- a/src/logservice/palf/log_meta_entry.cpp +++ b/src/logservice/palf/log_meta_entry.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_meta_entry.h" diff --git a/src/logservice/palf/log_meta_entry.h b/src/logservice/palf/log_meta_entry.h index 0aed4aa17..d37db9d84 100644 --- a/src/logservice/palf/log_meta_entry.h +++ b/src/logservice/palf/log_meta_entry.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_META_ENTRY_ diff --git a/src/logservice/palf/log_meta_entry_header.cpp b/src/logservice/palf/log_meta_entry_header.cpp index 7b8912772..a78b0e27b 100644 --- a/src/logservice/palf/log_meta_entry_header.cpp +++ b/src/logservice/palf/log_meta_entry_header.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_meta_entry_header.h" diff --git a/src/logservice/palf/log_meta_entry_header.h b/src/logservice/palf/log_meta_entry_header.h index 3a7146acd..297f572b8 100644 --- a/src/logservice/palf/log_meta_entry_header.h +++ b/src/logservice/palf/log_meta_entry_header.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_META_HEADER_ diff --git a/src/logservice/palf/log_meta_info.cpp b/src/logservice/palf/log_meta_info.cpp index b753ad0bf..55805eec9 100755 --- a/src/logservice/palf/log_meta_info.cpp +++ b/src/logservice/palf/log_meta_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_meta_info.h" diff --git a/src/logservice/palf/log_meta_info.h b/src/logservice/palf/log_meta_info.h index 0a88b7dc2..f5b153083 100644 --- a/src/logservice/palf/log_meta_info.h +++ b/src/logservice/palf/log_meta_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_META_INFO_ diff --git a/src/logservice/palf/log_mode_mgr.cpp b/src/logservice/palf/log_mode_mgr.cpp index bfb03dd18..a03fd5d74 100644 --- a/src/logservice/palf/log_mode_mgr.cpp +++ b/src/logservice/palf/log_mode_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF diff --git a/src/logservice/palf/log_mode_mgr.h b/src/logservice/palf/log_mode_mgr.h index 1f4c97a7b..9a0ce2169 100644 --- a/src/logservice/palf/log_mode_mgr.h +++ b/src/logservice/palf/log_mode_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_MODE_MGR_ diff --git a/src/logservice/palf/log_net_service.cpp b/src/logservice/palf/log_net_service.cpp index d8ebd75c0..7a545d407 100644 --- a/src/logservice/palf/log_net_service.cpp +++ b/src/logservice/palf/log_net_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_net_service.h" diff --git a/src/logservice/palf/log_net_service.h b/src/logservice/palf/log_net_service.h index 1609fe480..36d02c83f 100644 --- a/src/logservice/palf/log_net_service.h +++ b/src/logservice/palf/log_net_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_NET_SERVICE_ diff --git a/src/logservice/palf/log_reader.cpp b/src/logservice/palf/log_reader.cpp index 998bcd8d9..3444e0f17 100644 --- a/src/logservice/palf/log_reader.cpp +++ b/src/logservice/palf/log_reader.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_reader.h" diff --git a/src/logservice/palf/log_reader.h b/src/logservice/palf/log_reader.h index 1e323c859..b74a552e1 100644 --- a/src/logservice/palf/log_reader.h +++ b/src/logservice/palf/log_reader.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_READER_ diff --git a/src/logservice/palf/log_reader_utils.cpp b/src/logservice/palf/log_reader_utils.cpp index 1823a2ce4..627159485 100644 --- a/src/logservice/palf/log_reader_utils.cpp +++ b/src/logservice/palf/log_reader_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "share/rc/ob_tenant_base.h" diff --git a/src/logservice/palf/log_reader_utils.h b/src/logservice/palf/log_reader_utils.h index 998ccff9f..3007e077c 100644 --- a/src/logservice/palf/log_reader_utils.h +++ b/src/logservice/palf/log_reader_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_READER_UTILS_ diff --git a/src/logservice/palf/log_reconfirm.cpp b/src/logservice/palf/log_reconfirm.cpp index 38bf85d12..09008cf39 100644 --- a/src/logservice/palf/log_reconfirm.cpp +++ b/src/logservice/palf/log_reconfirm.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF @@ -564,7 +568,7 @@ int LogReconfirm::reconfirm() && OB_EAGAIN != ret) { PALF_LOG(WARN, "confirm_start_working_log failed", K_(self), K_(palf_id)); } else { - // 记录进入start_working阶段时的end_lsn + // Record the end_lsn at the start of the start_working phase saved_end_lsn_ = last_end_lsn; state_ = START_WORKING; PALF_EVENT("Reconfirm come into START_WORKING state", palf_id_, K(new_proposal_id_), @@ -581,15 +585,15 @@ int LogReconfirm::reconfirm() const bool need_skip_log_barrier = mode_mgr_->need_skip_log_barrier(); const int64_t leader_epoch = state_mgr_->get_leader_epoch(); if (OB_SUCC(mm_->confirm_start_working_log(new_proposal_id_, leader_epoch, sw_config_version_))) { - // check_ms_log_committed()检查若未达成多数派会尝试重发start_working log - // 重发时依然用之前取的lsn和proposal_id,因此saved_end_lsn_也无需更新 + // check_ms_log_committed() checks if a majority is not reached, it will attempt to resend the start_working log + // Resend using the previously retrieved lsn and proposal_id, therefore saved_end_lsn_ also does not need to be updated const LSN curr_max_lsn = sw_->get_max_lsn(); if (curr_max_lsn != saved_end_lsn_) { ret = OB_ERR_UNEXPECTED; PALF_LOG(ERROR, "max_lsn is not equal to saved_end_lsn_, unexpected", K_(palf_id), K_(self), K(curr_max_lsn), K_(saved_end_lsn)); } else if (OB_FAIL(sw_->try_advance_committed_end_lsn(saved_end_lsn_))) { - // start_working达成多数派后,leader推进committed_end_lsn至之前记录的位点(预期等于当前的max_lsn) + // After start_working reaches a majority, leader advances committed_end_lsn to the previously recorded point (expected to equal the current max_lsn) } else if (!sw_->is_all_committed_log_slided_out(last_slide_lsn, last_slide_log_id, committed_end_lsn)) { // There is some log has not slided out, need wait and retry. if (palf_reach_time_interval(5 * 1000 * 1000, wait_slide_print_time_us_)) { diff --git a/src/logservice/palf/log_reconfirm.h b/src/logservice/palf/log_reconfirm.h index 3e97a9e72..5956fb191 100644 --- a/src/logservice/palf/log_reconfirm.h +++ b/src/logservice/palf/log_reconfirm.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_RECONFIRM_ diff --git a/src/logservice/palf/log_req.cpp b/src/logservice/palf/log_req.cpp index ed6a04831..b57b7b2e6 100644 --- a/src/logservice/palf/log_req.cpp +++ b/src/logservice/palf/log_req.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_req.h" @@ -366,7 +370,7 @@ LogChangeConfigMetaReq::~LogChangeConfigMetaReq() bool LogChangeConfigMetaReq::is_valid() const { return INVALID_PROPOSAL_ID != msg_proposal_id_ -// && INVALID_PROPOSAL_ID != prev_log_proposal_id_ // 对于日志流无写入的场景,prev_log是无效的 +// && INVALID_PROPOSAL_ID != prev_log_proposal_id_ // For scenarios where there is no write to the log stream, prev_log is invalid // && prev_lsn_.is_valid() && meta_.is_valid(); } diff --git a/src/logservice/palf/log_req.h b/src/logservice/palf/log_req.h index 7ba64ac51..ffb632188 100644 --- a/src/logservice/palf/log_req.h +++ b/src/logservice/palf/log_req.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_REQ_ diff --git a/src/logservice/palf/log_request_handler.cpp b/src/logservice/palf/log_request_handler.cpp index fd4100639..d6e5c820f 100644 --- a/src/logservice/palf/log_request_handler.cpp +++ b/src/logservice/palf/log_request_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_request_handler.h" diff --git a/src/logservice/palf/log_request_handler.h b/src/logservice/palf/log_request_handler.h index 4faa3893d..ca9f08c13 100644 --- a/src/logservice/palf/log_request_handler.h +++ b/src/logservice/palf/log_request_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_REQUEST_HANDLER_ diff --git a/src/logservice/palf/log_rpc.cpp b/src/logservice/palf/log_rpc.cpp index f29442b13..7a03fd54f 100644 --- a/src/logservice/palf/log_rpc.cpp +++ b/src/logservice/palf/log_rpc.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_rpc.h" diff --git a/src/logservice/palf/log_rpc.h b/src/logservice/palf/log_rpc.h index ecc83bbe9..04d444b08 100644 --- a/src/logservice/palf/log_rpc.h +++ b/src/logservice/palf/log_rpc.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_RPC_ diff --git a/src/logservice/palf/log_rpc_macros.h b/src/logservice/palf/log_rpc_macros.h index 9ba77dbcc..a80336650 100644 --- a/src/logservice/palf/log_rpc_macros.h +++ b/src/logservice/palf/log_rpc_macros.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_RPC_MACROS_ diff --git a/src/logservice/palf/log_rpc_packet.h b/src/logservice/palf/log_rpc_packet.h index 6581c1c74..9d23c22cb 100644 --- a/src/logservice/palf/log_rpc_packet.h +++ b/src/logservice/palf/log_rpc_packet.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_RPC_PACKET_ diff --git a/src/logservice/palf/log_rpc_processor.cpp b/src/logservice/palf/log_rpc_processor.cpp index a45740da2..6bce3f2e4 100644 --- a/src/logservice/palf/log_rpc_processor.cpp +++ b/src/logservice/palf/log_rpc_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_rpc_processor.h" diff --git a/src/logservice/palf/log_rpc_processor.h b/src/logservice/palf/log_rpc_processor.h index 5018d9fe7..77b0eaad9 100644 --- a/src/logservice/palf/log_rpc_processor.h +++ b/src/logservice/palf/log_rpc_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_RPC_PROCESSOR_ diff --git a/src/logservice/palf/log_rpc_proxy.cpp b/src/logservice/palf/log_rpc_proxy.cpp index 9bc2d57d6..ade0fddb8 100644 --- a/src/logservice/palf/log_rpc_proxy.cpp +++ b/src/logservice/palf/log_rpc_proxy.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_rpc_proxy.h" // LogRpcProxy diff --git a/src/logservice/palf/log_rpc_proxy.h b/src/logservice/palf/log_rpc_proxy.h index 82099f9b7..0b7c0d30e 100644 --- a/src/logservice/palf/log_rpc_proxy.h +++ b/src/logservice/palf/log_rpc_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_RPC_PROXY_ diff --git a/src/logservice/palf/log_shared_queue_thread.cpp b/src/logservice/palf/log_shared_queue_thread.cpp index 1c7fd47b9..d495a064e 100644 --- a/src/logservice/palf/log_shared_queue_thread.cpp +++ b/src/logservice/palf/log_shared_queue_thread.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_shared_queue_thread.h" diff --git a/src/logservice/palf/log_shared_queue_thread.h b/src/logservice/palf/log_shared_queue_thread.h index daceea3f7..1104f127a 100644 --- a/src/logservice/palf/log_shared_queue_thread.h +++ b/src/logservice/palf/log_shared_queue_thread.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_SHARED_QUEUE_THREAD_ diff --git a/src/logservice/palf/log_shared_task.cpp b/src/logservice/palf/log_shared_task.cpp index 24b016f2f..51660a664 100644 --- a/src/logservice/palf/log_shared_task.cpp +++ b/src/logservice/palf/log_shared_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_shared_task.h" diff --git a/src/logservice/palf/log_shared_task.h b/src/logservice/palf/log_shared_task.h index 1ef9a735a..863b2aa7f 100644 --- a/src/logservice/palf/log_shared_task.h +++ b/src/logservice/palf/log_shared_task.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_SHARED_TASK_ diff --git a/src/logservice/palf/log_simple_member_list.cpp b/src/logservice/palf/log_simple_member_list.cpp index 4bee9f839..326c233ac 100644 --- a/src/logservice/palf/log_simple_member_list.cpp +++ b/src/logservice/palf/log_simple_member_list.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_simple_member_list.h" diff --git a/src/logservice/palf/log_simple_member_list.h b/src/logservice/palf/log_simple_member_list.h index 09b0d90be..e8a21483e 100644 --- a/src/logservice/palf/log_simple_member_list.h +++ b/src/logservice/palf/log_simple_member_list.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_SIMPLE_MEMBER_LIST_H_ diff --git a/src/logservice/palf/log_sliding_window.cpp b/src/logservice/palf/log_sliding_window.cpp index b7e195632..0c56bea74 100644 --- a/src/logservice/palf/log_sliding_window.cpp +++ b/src/logservice/palf/log_sliding_window.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF @@ -314,7 +318,7 @@ bool LogSlidingWindow::can_receive_larger_log_(const int64_t log_id) const bool LogSlidingWindow::leader_can_submit_larger_log_(const int64_t log_id) const { - // leader submit new log时调用本接口 + // Call this interface when leader submits a new log bool bool_ret = true; const int64_t start_log_id = get_start_id(); // sw_end_log_id may be less than (start_log_id + PALF_SLIDING_WINDOW_SIZE), @@ -356,8 +360,8 @@ bool LogSlidingWindow::leader_can_submit_new_log_(const int64_t valid_log_size, if (OB_SUCCESS != (tmp_ret = lsn_allocator_.get_curr_end_lsn(curr_end_lsn))) { PALF_LOG_RET(WARN, tmp_ret, "get_curr_end_lsn failed", K(tmp_ret), K_(palf_id), K_(self), K(valid_log_size)); - // NB: 采用committed_lsn作为可复用起点的下界,避免写盘立即复用group_buffer导致follower的 - // group_buffer被uncommitted log填满而无法滑出 + // NB: Use committed_lsn as the lower bound of the reusable starting point to avoid reusing group_buffer immediately after writing to disk, which leads to the follower's + // group_buffer is filled with uncommitted logs and cannot slide out } else if (!group_buffer_.can_handle_new_log(curr_end_lsn, valid_log_size, curr_committed_end_lsn)) { if (REACH_TIME_INTERVAL(1000 * 1000)) { PALF_LOG_RET(WARN, OB_ERR_UNEXPECTED, "group_buffer_ cannot handle new log now", K(tmp_ret), K_(palf_id), K_(self), @@ -377,8 +381,8 @@ bool LogSlidingWindow::leader_can_submit_group_log_(const LSN &lsn, const int64_ int tmp_ret = OB_SUCCESS; LSN curr_committed_end_lsn; get_committed_end_lsn_(curr_committed_end_lsn); - // NB: 采用committed_lsn作为可复用起点的下界,避免写盘立即复用group_buffer导致follower的 - // group_buffer被uncommitted log填满而无法滑出 + // NB: Use committed_lsn as the lower bound of the reusable starting point to avoid reusing group_buffer immediately after writing to disk, which leads to follower's + // group_buffer is filled with uncommitted logs and cannot slide out if (!group_buffer_.can_handle_new_log(lsn, group_log_size, curr_committed_end_lsn)) { if (REACH_TIME_INTERVAL(1000 * 1000)) { PALF_LOG_RET(WARN, OB_ERR_UNEXPECTED, "group_buffer_ cannot handle new log now", K(tmp_ret), K_(palf_id), K_(self), @@ -393,15 +397,15 @@ bool LogSlidingWindow::leader_can_submit_group_log_(const LSN &lsn, const int64_ int LogSlidingWindow::leader_wait_sw_slot_ready_(const int64_t log_id) { - // 等待sw槽位ready - // 因为分配log_id时sw可能是满的 + // wait for sw slot ready + // Because log_id is allocated when sw might be full int ret = OB_SUCCESS; LogTask *log_task = NULL; LogTaskGuard guard(this); do { if (false == leader_can_submit_larger_log_(log_id)) { - // double check log_id是否超出leader sw的range限制, - // 这一步是必要的,因为多线程并发submit时可能使用同一个max_log_id通过前置检查 + // double check log_id whether exceeds leader sw's range limit, + // This step is necessary because multiple threads may concurrently submit using the same max_log_id through the pre-check ret = OB_EAGAIN; } else if (OB_FAIL(guard.get_log_task(log_id, log_task))) { if (OB_ERR_OUT_OF_UPPER_BOUND == ret) { @@ -521,10 +525,10 @@ int LogSlidingWindow::submit_log(const char *buf, ATOMIC_INC(&append_cnt_array_[array_idx]); } if (OB_SUCC(ret) && is_need_handle_next) { - // 这里无法使用log_id作为精确的调用条件,因为上一条日志和本条日志的处理可能并发 - // 比如上一条日志由本日志触发freeze后立即被其他线程处理了,此时本条日志还没fill完成故无法连续处理 - // 那么本条日志需要自己触发handle,这时候prev_log_id是小于本日志log_id的 - // 有了thread lease,这里可以不加log_id条件直接调用 + // Here log_id cannot be used as an exact invocation condition, because the processing of the previous log and this log may be concurrent + // For example, the previous log was immediately processed by another thread after being triggered to freeze by this log, at which point this log has not yet completed fill and thus cannot be processed consecutively + // Then this log entry needs to trigger handle itself, at this time prev_log_id is less than this log's log_id + // With thread lease, here we can call directly without the log_id condition bool is_committed_lsn_updated = false; (void) handle_next_submit_log_(is_committed_lsn_updated); } @@ -577,15 +581,15 @@ int LogSlidingWindow::try_freeze_prev_log_(const int64_t next_log_id, const LSN int LogSlidingWindow::wait_group_buffer_ready_(const LSN &lsn, const int64_t data_len) { int ret = OB_SUCCESS; - // NB: 尽管已经使用'committed_end_lsn_'限制了'leader_can_submit_new_log_', 但我们依旧需要判断'group_buffer_'是否已经可以复用: - // 1. 并发提交日志会导致所有日志都能进入到提交流程; - // 2. 不能够使用'committed_end_lsn_'判断'group_buffer_'是否可以被复用, 因为'committed_end_lsn_'可能大于'max_flushed_end_lsn'. + // NB: Although 'committed_end_lsn_' has been used to limit 'leader_can_submit_new_log_', we still need to determine if 'group_buffer_' can be reused: + // 1. Concurrent submission of logs will result in all logs entering the submission process; + // 2. Cannot use 'committed_end_lsn_' to determine if 'group_buffer_' can be reused, because 'committed_end_lsn_' may be greater than 'max_flushed_end_lsn'. int64_t wait_times = 0; LSN curr_committed_end_lsn; get_committed_end_lsn_(curr_committed_end_lsn); while (false == group_buffer_.can_handle_new_log(lsn, data_len, curr_committed_end_lsn)) { - // 要填充的终点超过了buffer可复用的范围 - // 需要重试直到可复用终点推大 + // The endpoint to be filled exceeds the range of the buffer that can be reused + // Need to retry until reusable endpoint can push large static const int64_t MAX_SLEEP_US = 100; ++wait_times; int64_t sleep_us = wait_times * 10; @@ -619,7 +623,7 @@ int LogSlidingWindow::append_to_group_log_(const LSN &lsn, } else if (OB_FAIL(guard.get_log_task(log_id, log_task))) { PALF_LOG(WARN, "get_log_task_ failed", K(ret), K(log_id), K_(palf_id), K_(self)); } else { - // Note: 此处无需判断log_task valid, 因为并发submit场景第一条log_entry可能还没更新log_task + // Note: There is no need to check if log_task is valid here, because in the concurrent submit scenario, the first log_entry may not have updated log_task yet LogEntryHeader log_entry_header; // Firstly, we need update log_task info, so that later alloc_log_id() can succeed as soon as possible. log_task->inc_update_max_scn(scn); @@ -1170,8 +1174,8 @@ int LogSlidingWindow::generate_group_entry_header_(const int64_t log_id, const LSN begin_lsn = header_info.begin_lsn_; LSN log_committed_end_lsn = header_info.committed_end_lsn_; if (!log_committed_end_lsn.is_valid()) { - // leader生成新日志时会走这个路径 - // follower直接用log_task中的committed_end_lsn_生成group header + // leader generates new log entries through this path + // follower directly use committed_end_lsn_ in log_task to generate group header log_committed_end_lsn = global_committed_end_lsn; } const int64_t data_len = header_info.data_len_; @@ -1432,11 +1436,11 @@ int LogSlidingWindow::after_flush_log(const FlushLogCbCtx &flush_cb_ctx) ret = OB_INVALID_ARGUMENT; PALF_LOG(WARN, "invalid argumetns", K(ret), K_(palf_id), K_(self), K(flush_cb_ctx)); } else if (is_truncating_ && log_end_lsn > last_truncate_lsn_) { - // truncate位点之后的日志无需执行回调 + // Logs after the truncate point do not need to execute callbacks PALF_LOG(INFO, "this log has been truncated, no need execute flush cb", K(ret), K_(palf_id), K_(self), K(flush_cb_ctx), K(log_end_lsn), K_(last_truncate_lsn)); } else if (is_rebuilding_ && log_end_lsn > last_rebuild_lsn_) { - // rebuild 位点之后的日志无需执行回调, 否则会错误更新 max_flushed_end_lsn + // logs after the rebuild point do not need to execute callbacks, otherwise it will incorrectly update max_flushed_end_lsn PALF_LOG(INFO, "this replica is rebuilding, no need execute flush cb", K(ret), K_(palf_id), K_(self), K(flush_cb_ctx), K(log_end_lsn), K_(last_truncate_lsn)); } else if (state_mgr_->get_proposal_id() != flush_cb_ctx.curr_proposal_id_) { @@ -1531,7 +1535,7 @@ int LogSlidingWindow::after_flush_log(const FlushLogCbCtx &flush_cb_ctx) } if (log_id == last_submit_log_id) { - // 非feedback mode需触发handle next log + // Non-feedback mode needs to trigger handle next log bool is_committed_lsn_updated = false; (void) handle_next_submit_log_(is_committed_lsn_updated); } @@ -1870,8 +1874,8 @@ void LogSlidingWindow::try_update_committed_lsn_for_fetch_( if (last_fetch_end_lsn.is_valid() && !last_committed_end_lsn.is_valid() && (log_end_lsn >= last_fetch_end_lsn || log_id == last_fetch_max_log_id)) { - // 本条日志是上一轮fetch的最后一条,更新last_fetch_committed_end_lsn_ - // 用于后续触发流式fetch + // This log is the last one from the previous fetch, update last_fetch_committed_end_lsn_ + // Used for subsequent triggering of streaming fetch need_update = true; } } @@ -1998,8 +2002,8 @@ int LogSlidingWindow::try_fetch_log(const FetchTriggerType &fetch_log_type, } } else if (all_invalid) { // generate default arguments - // 本接口由state_mgr调用,sw左边界不滑动时周期性触发fetch log - // 触发前需满足所有committed logs都已滑出, 并以committed_end_lsn作为新的fetch起点 + // This interface is called by state_mgr, and fetch log is periodically triggered when the left boundary of sw does not slide + // Trigger requires all committed logs to have slid out, and use committed_end_lsn as the new fetch starting point LSN last_slide_lsn; int64_t last_slide_log_id; LSN sw_start_lsn; @@ -2067,8 +2071,8 @@ int LogSlidingWindow::do_fetch_log_(const FetchTriggerType &trigger_type, K(fetch_start_log_id), K(dest), K(fetch_log_size)); } else { const int64_t last_slide_log_id = get_last_slide_log_id_(); - // 为了避免重复拉取,这里要用last_slide_log_id, 而不用sw_start_id, - // 因为sliding_cb()执行完之前sw_start_id还没推进,last_slide_log_id已经推进 + // To avoid duplicate pulls, here we use last_slide_log_id instead of sw_start_id, + // Because sliding_cb() has not advanced sw_start_id before it completes, last_slide_log_id has already advanced int64_t skip_log_count = fetch_start_log_id - (last_slide_log_id + 1); if (skip_log_count < 0) { // The log of fetch_start_log_id maybe has slid out @@ -2310,12 +2314,12 @@ int LogSlidingWindow::sliding_cb(const int64_t sn, const FixedSlidingWindowSlot void LogSlidingWindow::try_fetch_log_streamingly_(const LSN &log_end_lsn) { - // 本接口由sliding_cb()调用(单线程),触发流式拉取日志 + // This interface is called by sliding_cb() (single-threaded), triggering streaming log pull LSN last_committed_end_lsn; last_committed_end_lsn.val_ = ATOMIC_LOAD(&last_fetch_committed_end_lsn_.val_); if (last_committed_end_lsn.is_valid() && log_end_lsn == last_committed_end_lsn) { - // 本条日志的end_lsn与上一轮fetch的committed_end_lsn匹配时说明上一轮拉取的日志 - // 中committed logs都已滑出, 以 (last_submit_log_id + 1) 为新的起点触发下一轮fetch + // The end_lsn of this log matches the committed_end_lsn of the previous fetch, indicating that the logs pulled in the previous round + // All committed logs in the middle have slid out, trigger the next round of fetch with (last_submit_log_id + 1) as the new starting point LSN last_submit_lsn; LSN last_submit_end_lsn; int64_t last_submit_log_id = OB_INVALID_LOG_ID; @@ -2754,7 +2758,7 @@ int LogSlidingWindow::get_ack_info_array(LogMemberAckInfoList &ack_info_array) c if (OB_FAIL(member_list.get_member_by_index(i, tmp_server))) { PALF_LOG(WARN, "get_server_by_index failed", K(ret), K_(palf_id), K_(self)); } else if (OB_FAIL(match_lsn_map_.get(tmp_server.get_server(), tmp_val))) { - // 预期不应该失败,每次成员变更时同步更新保持map与member_list一致 + // Expectation is that it should not fail, synchronize the map with member_list on each member change PALF_LOG(WARN, "match_lsn_map_ get failed", K(ret), K_(palf_id), K_(self), K(tmp_server)); } else { LogMemberAckInfo ack_info; @@ -2955,8 +2959,8 @@ int LogSlidingWindow::truncate_for_rebuild(const PalfBaseInfo &palf_base_info) // 3) truncate lsn_allocator_ if (OB_SUCC(ret)) { - // 与普通truncate log场景不同的是,此处只会将last_log_meta改大,无回退的需求 - // 只有当curr_end_lsn < palf_base_info.curr_lsn_时才需要更新 + // Different from the ordinary truncate log scenario, here we only increase last_log_meta, with no need for rollback + // Only when curr_end_lsn < palf_base_info.curr_lsn_ does an update need to be made LSN curr_end_lsn; (void) lsn_allocator_.get_curr_end_lsn(curr_end_lsn); if (curr_end_lsn.is_valid() @@ -2969,7 +2973,7 @@ int LogSlidingWindow::truncate_for_rebuild(const PalfBaseInfo &palf_base_info) } } // 4) inc update last_submit_log info, max_flushed_log info, last_slide_log info and max_committed_log info - // NB: 不能回退这些值,否则后续会发生日志覆盖写,log_storage层会报错 + // NB: These values cannot be rolled back, otherwise log overwrite writing will occur subsequently, and the log_storage layer will report an error if (OB_SUCC(ret)) { LSN last_submit_lsn; LSN last_submit_end_lsn; @@ -3061,7 +3065,7 @@ int LogSlidingWindow::truncate(const TruncateLogInfo &truncate_log_info, const L // get prev log info if (OB_SUCC(ret)) { if (FIRST_VALID_LOG_ID == truncate_log_id) { - // 第一条日志需要truncate, prev_log_info生成为初始值 + // The first log needs to be truncated, prev_log_info is generated as the initial value LogInfo prev_log_info; prev_log_info.generate_by_default(); prev_log_id = prev_log_info.log_id_; @@ -3101,7 +3105,7 @@ int LogSlidingWindow::truncate(const TruncateLogInfo &truncate_log_info, const L // truncate max log meta of lsn_allocator (void) truncate_lsn_allocator_(truncate_begin_lsn, prev_log_id, prev_scn); // truncate last_submit_log info - // 当被truncate的log已经submit时才需要truncate last_submit_log_info + // Truncate last_submit_log_info only when the truncated log has been submitted const int64_t last_submit_log_id = get_last_submit_log_id_(); if (last_submit_log_id >= truncate_log_id) { (void) set_last_submit_log_info_(prev_lsn, truncate_begin_lsn, prev_log_id, prev_proposal_id); @@ -3111,11 +3115,11 @@ int LogSlidingWindow::truncate(const TruncateLogInfo &truncate_log_info, const L K(prev_accum_checksum)); } // truncate max_flushed_log info - // 考虑到sw中truncate位点之前可能存在空洞, 故这里需要与当前max_flushed_end_lsn做比较 + // Considering there might be holes before the truncate point in sw, we need to compare it with the current max_flushed_end_lsn here LSN max_flushed_end_lsn; get_max_flushed_end_lsn(max_flushed_end_lsn); if (max_flushed_end_lsn > truncate_begin_lsn) { - // flush位点已推过,需要truncate + // flush point has been pushed, need to truncate (void) truncate_max_flushed_log_info_(prev_lsn, truncate_begin_lsn, prev_proposal_id); (void) group_buffer_.truncate(truncate_begin_lsn); PALF_LOG(INFO, "truncate max_flushed_log_info_", K_(palf_id), K_(self), K(truncate_log_info), K(log_end_lsn), @@ -3319,9 +3323,9 @@ int LogSlidingWindow::receive_log(const common::ObAddr &src_server, } else { // Need update log_task, it means that PRE_FILL tag must be set by self. if (lsn < max_flushed_end_lsn) { - // lsn比max_flushed_end_lsn小, prev log可能不存在 - // 这种日志后续可能需要truncate(比如与源端不一致), 为了避免覆盖本地已有日志需先拒收, - // 等前面的日志更新后重新拉取 + // lsn is smaller than max_flushed_end_lsn, prev log may not exist + // This log may need to be truncated later (e.g., is inconsistent with the source), to avoid overwriting existing local logs, we need to reject it first, + // Wait for the previous log update and then pull again ret = OB_STATE_NOT_MATCH; PALF_LOG(WARN, "lsn is smaller than max_flushed_end_lsn, this log may need truncate later, cannot receive", K(ret), K_(palf_id), K_(self), K(lsn), K(log_end_lsn), K(max_flushed_end_lsn), K(group_entry_header), @@ -3339,8 +3343,8 @@ int LogSlidingWindow::receive_log(const common::ObAddr &src_server, buf_len - LogGroupEntryHeader::HEADER_SER_SIZE, min_scn))) { PALF_LOG(WARN, "get_min_scn_from_buf_ failed", K(ret), K_(palf_id), K_(self), K(lsn), K(group_entry_header)); // local log_task is invalid, receive it. - // 这里不需要wait_group_buffer_ready_,因为lsn是确定且唯一的,前置检查通过即可 - // fill需做内存copy, 故不能持有log_task的锁, 通过PRE_FILL控制至多一个线程执行fill. + // Here wait_group_buffer_ready_ is not needed, because lsn is determined and unique, a prior check is sufficient + // fill needs to do memory copy, hence it cannot hold the log_task's lock, use PRE_FILL to control that at most one thread executes fill. } else if (OB_FAIL(group_buffer_.fill(lsn, buf, buf_len))) { PALF_LOG(ERROR, "fill group buffer failed", K(ret), K_(palf_id), K_(self), K(group_entry_header)); } else if (OB_FAIL(try_update_max_lsn_(lsn, group_entry_header))) { @@ -3348,7 +3352,7 @@ int LogSlidingWindow::receive_log(const common::ObAddr &src_server, } else { log_task->lock(); if (log_task->is_valid()) { - // log_task可能被其他线程并发收取了,预期内容与本线程一致. + // log_task may be concurrently collected by other threads, expected content is consistent with this thread. ret = OB_ERR_UNEXPECTED; PALF_LOG(ERROR, "log_task has been updated during filling group buffer, unexpected", K(ret), K_(palf_id), K_(self), K(lsn), K(group_entry_header), KPC(log_task)); @@ -3379,8 +3383,8 @@ int LogSlidingWindow::receive_log(const common::ObAddr &src_server, && (PUSH_LOG == push_log_type || PUSH_LOG_WO_ACK == push_log_type) && last_fetch_end_lsn.is_valid() && log_end_lsn <= last_fetch_end_lsn) { - // 只有当收到push log的end_lsn和log_id均处于last fetch范围内时 - // 才能重置fetch info + // Only when the end_lsn and log_id received from push log are within the last fetch range + // can only reset fetch info (void) try_reset_last_fetch_log_info_(last_fetch_end_lsn, log_id); } } @@ -3538,8 +3542,8 @@ int LogSlidingWindow::submit_group_log(const LSN &lsn, } else if (OB_FAIL(get_min_scn_from_buf_(group_entry_header, buf + LogGroupEntryHeader::HEADER_SER_SIZE, buf_len - LogGroupEntryHeader::HEADER_SER_SIZE, min_scn))) { PALF_LOG(WARN, "get_min_scn_from_buf_ failed", K(ret), K_(palf_id), K_(self)); - // 这里不需要wait_group_buffer_ready_,因为lsn是确定且唯一的,因此前置检查通过即可. - // fill期间不能持有log_task的锁, 因为耗时可能较长. + // Here wait_group_buffer_ready_ is not needed, because lsn is determined and unique, thus a prior check is sufficient. + // During the fill period, the lock of log_task cannot be held, because it may take a long time. } else if (OB_FAIL(group_buffer_.fill(lsn, buf, buf_len))) { PALF_LOG(WARN, "fill group buffer failed", K(ret), K_(palf_id), K_(self)); } else if (OB_FAIL(try_update_max_lsn_(lsn, group_entry_header))) { @@ -3547,7 +3551,7 @@ int LogSlidingWindow::submit_group_log(const LSN &lsn, } else { // prev_log_proposal_id match or not exist, receive this log if (log_task->is_valid()) { - // log_task可能被其他线程并发收取了,预期内容与本线程一致. + // log_task may be concurrently collected by other threads, expected content is consistent with this thread. if (group_entry_header.get_log_proposal_id() != log_task->get_proposal_id()) { ret = OB_ERR_UNEXPECTED; PALF_LOG(ERROR, "log_task has been updated during filling group buffer, and log proposal_id does not match "\ @@ -3630,9 +3634,9 @@ bool LogSlidingWindow::need_update_log_task_(LogGroupEntryHeader &header, PALF_LOG(INFO, "receive log with same proposal_id", K(bool_ret), K_(palf_id), K_(self), K(log_id), K(log_end_lsn), K(need_send_ack), K(old_pid), KPC(log_task), K(header), K(max_flushed_end_lsn), KPC(log_task)); } else if (old_pid > new_pid) { - // 收到了proposal_id更小的日志,预期不应该出现. - // 这里间接依赖了: follower响应fetch log请求时只能返回committed logs, 因此在同一个proposal_id下, - // 不会有两个副本同时发送log_id相同但proposal_id不同的日志给同一个目的端. + // Received a log with a smaller proposal_id, which should not happen. + // Here it indirectly depends on: follower can only return committed logs when responding to fetch log requests, therefore under the same proposal_id, + // There will not be two replicas sending logs with the same log_id but different proposal_id to the same destination. PALF_LOG_RET(ERROR, OB_ERR_UNEXPECTED, "receive log with smaller proposal_id, unexpected error", K_(palf_id), K_(self), K(log_id), K(new_pid), KPC(log_task), K(header), KPC(log_task)); } else { @@ -3826,16 +3830,16 @@ bool LogSlidingWindow::pre_check_for_config_log(const int64_t &msg_proposal_id, } if (bool_ret && OB_INVALID_LOG_ID != match_log_id) { // if log matches, check if need truncate following logs - // 对于已经提交写盘/即将提交写盘(无空洞)的幽灵日志(proposal_id < msg_proposal_id), - // 需要立即执行truncate, - // 对于空洞之后无法提交写盘的幽灵日志,本轮leader未感知到它们的存在,可暂不处理, - // 因为这部分日志之后也不会提交写盘(msg_proposal_id确保空洞位置无法再收取旧主的日志), - // 后续如果自己当选为leader,依赖reconfirm前truncate掉所有未提交写盘日志的逻辑清理掉. - // 为了简化处理,我们只根据下一条日志决定是否truncate: - // - 如果下一条日志是空洞,那么空洞位置一定无法再收旧主的旧日志,故空洞之后的幽灵 - // 日志也不会写盘; - // - 如果下一条日志不是空洞,判断其proposal_id若比msg_proposal_id小,说明是幽灵 - // 日志,直接触发truncate,否则不是幽灵日志,无需处理. + // For ghost logs that have been submitted to disk / are about to be submitted to disk (no holes) (proposal_id < msg_proposal_id), + // Need to execute truncate immediately, + // For ghost logs that cannot be committed to disk after the hole, the current leader was unaware of their existence and can be left unhandled for now, + // Because this part of the log will not be submitted to disk later (msg_proposal_id ensures that old leader's logs cannot be received at the gap position), + // Subsequently, if elected as leader, rely on the logic before reconfirm to clean up all uncommitted write log entries truncated. + // For simplicity, we only decide whether to truncate based on the next log: + // - If the next log is a hole, then the hole position can no longer receive old logs from the old leader, hence the ghost entries after the hole + // Logs will not be written to disk; + // - If the next log is not a hole, judge its proposal_id if it is smaller than msg_proposal_id, indicating a ghost + // log, directly trigger truncate, otherwise it is not a ghost log, no need to handle. LogTask *log_task = NULL; LogTaskGuard guard(this); const int64_t next_log_id = match_log_id + 1; diff --git a/src/logservice/palf/log_sliding_window.h b/src/logservice/palf/log_sliding_window.h index 3014839e2..c63ec8bae 100755 --- a/src/logservice/palf/log_sliding_window.h +++ b/src/logservice/palf/log_sliding_window.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_SLIDING_WINDOW_ @@ -480,10 +484,10 @@ class LogSlidingWindow : public ISlidingCallBack const bool is_fetch_log) const; public: typedef common::ObLinearHashMap SvrMatchOffsetMap; - static const int64_t TMP_HEADER_SER_BUF_LEN = 256; // log header序列化的临时buffer大小 - static const int64_t APPEND_CNT_ARRAY_SIZE = 32; // append次数统计数组的size + static const int64_t TMP_HEADER_SER_BUF_LEN = 256; // temporary buffer size for log header serialization + static const int64_t APPEND_CNT_ARRAY_SIZE = 32; // size of the append count statistics array static const uint64_t APPEND_CNT_ARRAY_MASK = APPEND_CNT_ARRAY_SIZE - 1; - static const int64_t APPEND_CNT_LB_FOR_PERIOD_FREEZE = 140000; // 切为PERIOD_FREEZE_MODE的append count下界 + static const int64_t APPEND_CNT_LB_FOR_PERIOD_FREEZE = 140000; // Lower bound of append count to switch to PERIOD_FREEZE_MODE private: struct LogTaskGuard { @@ -554,19 +558,19 @@ class LogSlidingWindow : public ISlidingCallBack // last_fetch_req_time_: // record the request time of the last fetch operation. // last_fetch_end_lsn_: - // 记录本轮fetch的lsn终点,根据group_buffer容量算出 + // Record the LSN endpoint of this round's fetch, calculated based on the group_buffer capacity // last_fetch_max_log_id_: - // 记录本轮fetch的log_id终点,根据sw容量算出 - // 一轮fetch的日志数量不定,达到上述任意一个条件就结束. + // Record the log_id endpoint of this round fetch, calculated based on sw capacity + // The number of logs fetched in one round is uncertain, and it ends when any of the above conditions are met. // // last_fetch_committed_end_lsn_: - // 记录本轮fetch拉到所有日志后的committed_end_lsn, handle_next_submit_log_()时 - // 检查如果处理到本轮fetch的最后一条日志(log_id与last_fetch_max_log_id_相等或者 - // log_end_lsn越过了last_fetch_end_lsn_), 则更新该值. + // Record the committed_end_lsn after fetching all logs in this round, when handle_next_submit_log_() is called + // Check if the last log of this round fetch is processed (log_id is equal to last_fetch_max_log_id_ or + // update the value if log_end_lsn exceeds last_fetch_end_lsn_. // - // 流式fetch机制: - // 日志滑出时检查自己的end_lsn是否与last_fetch_committed_end_lsn_相等,是则触发下一轮fetch, - // 下一轮fetch的起点是(last_submit_log_id + 1). + // Streaming fetch mechanism: + // Check if the end_lsn is equal to last_fetch_committed_end_lsn_ when the log slides out, trigger the next fetch if true, + // The starting point for the next fetch is (last_submit_log_id + 1). // mutable common::ObSpinLock fetch_info_lock_; int64_t last_fetch_req_time_; diff --git a/src/logservice/palf/log_state_mgr.cpp b/src/logservice/palf/log_state_mgr.cpp index 64473e3f9..89222f63d 100644 --- a/src/logservice/palf/log_state_mgr.cpp +++ b/src/logservice/palf/log_state_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF @@ -163,7 +167,7 @@ void LogStateMgr::update_role_and_state_(const common::ObRole &new_role, const O if (ATOMIC_BCAS(&role_state_val_, old_val, new_val)) { // update success } else { - // 更新role/state时会加palf_handle的写锁,因此预期不应该失败 + // When updating role/state, a write lock on palf_handle is acquired, so the expectation is that it should not fail PALF_LOG_RET(ERROR, OB_ERR_UNEXPECTED, "update_role_and_state_ failed", K_(palf_id), K(old_val), K(new_val)); } } @@ -296,6 +300,9 @@ int LogStateMgr::switch_state() int64_t new_leader_epoch = OB_INVALID_TIMESTAMP; if (follower_need_update_role_(new_leader, new_leader_epoch)) { ret = follower_active_to_reconfirm_(new_leader_epoch); + if (OB_SUCC(ret)) { + ret = reconfirm_to_leader_active_(); + } } else { set_leader_and_epoch_(new_leader, new_leader_epoch); } @@ -572,8 +579,8 @@ int LogStateMgr::pending_to_follower_active_() { int ret = OB_SUCCESS; update_role_and_state_(FOLLOWER, ACTIVE); - // 需先更新role/state,再提交role_change_event - // 否则handle role_change event执行可能先执行导致角色切换失败 + // Need to update role/state first, then submit role_change_event + // Otherwise handle role_change event execution may occur first leading to role switch failure if (OB_FAIL(to_follower_active_())) { PALF_LOG(ERROR, "to_follower_active_ failed", K(ret), K_(palf_id)); } @@ -654,17 +661,20 @@ int LogStateMgr::reconfirm_to_leader_active_() LogConfigVersion config_version; if (OB_FAIL(mm_->get_config_version(config_version))) { PALF_LOG(WARN, "get_config_version failed", K(ret), K_(palf_id)); - } else if (OB_FAIL(mm_->get_alive_member_list_with_arb(member_list, replica_num))) { - PALF_LOG(WARN, "get_alive_member_list_with_arb failed", K(ret), K_(palf_id)); - } else if (!member_list.contains(self_)) { - PALF_LOG(ERROR, "curr_member_list doesn't contain self, revoke", K_(palf_id), - K(member_list), K_(self)); - } else if (OB_FAIL(sw_->to_leader_active())) { + } + // set_initial_member_list hasn't been called, so self_ may not be in member_list + // else if (OB_FAIL(mm_->get_alive_member_list_with_arb(member_list, replica_num))) { + // PALF_LOG(WARN, "get_alive_member_list_with_arb failed", K(ret), K_(palf_id)); + // } else if (!member_list.contains(self_)) { + // PALF_LOG(ERROR, "curr_member_list doesn't contain self, revoke", K_(palf_id), + // K(member_list), K_(self)); + // } + else if (OB_FAIL(sw_->to_leader_active())) { PALF_LOG(WARN, "sw leader_active failed", K(ret), K_(palf_id)); } else { update_role_and_state_(LEADER, ACTIVE); - // 需先更新role/state和committed_end_lsn,再提交role_change_event - // 否则handle role_change event执行可能先执行导致角色切换失败 + // Need to update role/state and committed_end_lsn first, then submit role_change_event + // Otherwise handle role_change event execution may occur first leading to role switch failure if (OB_FAIL(to_leader_active_())) { PALF_LOG(ERROR, "to_leader_active_ failed", K(ret), K_(palf_id)); } else if (OB_FAIL(mm_->submit_broadcast_leader_info(get_proposal_id()))) { diff --git a/src/logservice/palf/log_state_mgr.h b/src/logservice/palf/log_state_mgr.h index 8a2bb8272..0bd57d7d0 100644 --- a/src/logservice/palf/log_state_mgr.h +++ b/src/logservice/palf/log_state_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_STATE_MGR_ diff --git a/src/logservice/palf/log_storage.cpp b/src/logservice/palf/log_storage.cpp index f25933ecb..52e147ae7 100644 --- a/src/logservice/palf/log_storage.cpp +++ b/src/logservice/palf/log_storage.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF diff --git a/src/logservice/palf/log_storage.h b/src/logservice/palf/log_storage.h index e3293b3b4..5be055d43 100644 --- a/src/logservice/palf/log_storage.h +++ b/src/logservice/palf/log_storage.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_STORAGE_ @@ -165,9 +169,9 @@ class LogStorage : public ILogStorage int append_block_header_(const LSN &block_min_lsn, const share::SCN &block_min_scn); int update_block_header_(const block_id_t block_id, const LSN &block_min_lsn, const share::SCN &block_min_scn); bool need_switch_block_() const; - // 1. 使用group_entry_iterator迭代最后一个文件, 重建block_header; - // 2. 从iterator中获取终点信息; - // 3. 初始化dio_aligned_buf. + // 1. Use group_entry_iterator to iterate the last file, and rebuild block_header; + // 2. Get endpoint information from iterator; + // 3. Initialize dio_aligned_buf. template int locate_log_tail_and_last_valid_entry_header_(const block_id_t min_block_id, const block_id_t max_block_id, diff --git a/src/logservice/palf/log_storage_interface.h b/src/logservice/palf/log_storage_interface.h index e12853fc8..7778bc909 100644 --- a/src/logservice/palf/log_storage_interface.h +++ b/src/logservice/palf/log_storage_interface.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_I_LOG_STORAGE_ diff --git a/src/logservice/palf/log_task.cpp b/src/logservice/palf/log_task.cpp index 8e4319971..173e60c66 100644 --- a/src/logservice/palf/log_task.cpp +++ b/src/logservice/palf/log_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_task.h" @@ -202,7 +206,7 @@ int LogTask::set_initial_header_info(const LogTaskHeaderInfo &header_info) header_.proposal_id_ = header_info.proposal_id_; header_.min_scn_ = header_info.min_scn_; update_data_len(header_info.data_len_); - // Note: 这里不能直接赋值,需用inc_update,因为其他log_entry可能已经更新了max_scn_ + // Note: Here direct assignment cannot be used, inc_update must be used instead, because other log_entry may have already updated max_scn_ inc_update_max_scn(header_info.max_scn_); // The first log is responsible for changing state to valid. set_valid(); @@ -252,7 +256,7 @@ int LogTask::set_group_header(const LSN &lsn, const SCN &scn, const LogGroupEntr header_.min_scn_ = scn; header_.max_scn_ = group_entry_header.get_max_scn(); header_.data_len_ = group_entry_header.get_data_len(); // total len without log_group_entry_header - header_.committed_end_lsn_ = group_entry_header.get_committed_end_lsn(); // 乱序收日志时前面空洞补齐后需要该值 + header_.committed_end_lsn_ = group_entry_header.get_committed_end_lsn(); // Out-of-order log reception requires this value after filling in the preceding gaps header_.accum_checksum_ = group_entry_header.get_accum_checksum(); header_.is_raw_write_ = group_entry_header.is_raw_write(); set_valid(); // set valid diff --git a/src/logservice/palf/log_task.h b/src/logservice/palf/log_task.h index 1bdd55c63..16136199a 100644 --- a/src/logservice/palf/log_task.h +++ b/src/logservice/palf/log_task.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEABASE_LOGSERVICE_LOG_TASK_ @@ -37,10 +41,10 @@ struct LogTaskHeaderInfo int64_t data_len_; // total len without log_group_entry_header int64_t proposal_id_; // leader's proposal_id when generate this log LSN prev_lsn_; - int64_t prev_proposal_id_; // 乱序收日志需要校验该值 - LSN committed_end_lsn_; // 乱序收日志时前面空洞补齐后需要该值 - int64_t data_checksum_; // follower收日志时校验, 本地计算accum_checksum也需要用该值 - int64_t accum_checksum_; // follower乱序收日志时前面空洞补齐后与本地值做校验 + int64_t prev_proposal_id_; // Out-of-order log reception requires validation of this value + LSN committed_end_lsn_; // When logs are received out of order, this value is needed to fill in the preceding gaps + int64_t data_checksum_; // follower receives log for verification, local accum_checksum calculation also uses this value + int64_t accum_checksum_; // follower receives logs out of order and performs checksum validation after filling in preceding gaps with local values bool is_padding_log_; bool is_raw_write_; diff --git a/src/logservice/palf/log_throttle.cpp b/src/logservice/palf/log_throttle.cpp index bbd6d5055..ac76fce78 100644 --- a/src/logservice/palf/log_throttle.cpp +++ b/src/logservice/palf/log_throttle.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF diff --git a/src/logservice/palf/log_throttle.h b/src/logservice/palf/log_throttle.h index 1d57f8419..d89a1aca1 100644 --- a/src/logservice/palf/log_throttle.h +++ b/src/logservice/palf/log_throttle.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVIVE_LOG_THROTTLE_H diff --git a/src/logservice/palf/log_updater.cpp b/src/logservice/palf/log_updater.cpp index f40328dff..3fa6cca94 100644 --- a/src/logservice/palf/log_updater.cpp +++ b/src/logservice/palf/log_updater.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_updater.h" diff --git a/src/logservice/palf/log_updater.h b/src/logservice/palf/log_updater.h index 2b161f342..7dca1d0ec 100644 --- a/src/logservice/palf/log_updater.h +++ b/src/logservice/palf/log_updater.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_PALF_LOG_UPDATER_ diff --git a/src/logservice/palf/log_writer_utils.cpp b/src/logservice/palf/log_writer_utils.cpp index 92b24aba3..5e7a7db7e 100644 --- a/src/logservice/palf/log_writer_utils.cpp +++ b/src/logservice/palf/log_writer_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "log_writer_utils.h" diff --git a/src/logservice/palf/log_writer_utils.h b/src/logservice/palf/log_writer_utils.h index bde8da250..4cf7e0c7c 100644 --- a/src/logservice/palf/log_writer_utils.h +++ b/src/logservice/palf/log_writer_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_WRITER_ diff --git a/src/logservice/palf/lsn.cpp b/src/logservice/palf/lsn.cpp index 9fd8339f0..bc2a13eca 100644 --- a/src/logservice/palf/lsn.cpp +++ b/src/logservice/palf/lsn.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lsn.h" diff --git a/src/logservice/palf/lsn.h b/src/logservice/palf/lsn.h index 6526dc82a..a4fd04d0e 100644 --- a/src/logservice/palf/lsn.h +++ b/src/logservice/palf/lsn.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEABASE_LOGSERVICE_LSN_ diff --git a/src/logservice/palf/lsn_allocator.cpp b/src/logservice/palf/lsn_allocator.cpp index 4b061ef0d..9c12b976c 100644 --- a/src/logservice/palf/lsn_allocator.cpp +++ b/src/logservice/palf/lsn_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lsn_allocator.h" @@ -318,7 +322,7 @@ int LSNAllocator::try_freeze(LSN &last_lsn, int64_t &last_log_id) } int LSNAllocator::alloc_lsn_scn(const SCN &base_scn, - const int64_t size, // 已包含LogHeader size + const int64_t size, // already includes LogHeader size const int64_t log_id_upper_bound, const LSN &lsn_upper_bound, LSN &lsn, @@ -335,7 +339,7 @@ int LSNAllocator::alloc_lsn_scn(const SCN &base_scn, ret = OB_INVALID_ARGUMENT; PALF_LOG(WARN, "invalid arguments", K(ret), K(base_scn), K(size), K(log_id_upper_bound), K(lsn_upper_bound)); } else { - // 生成新日志时需加上log_group_entry_header的size + // When generating a new log, add the size of log_group_entry_header const int64_t new_group_log_size = size + LogGroupEntryHeader::HEADER_SER_SIZE; bool need_update_base = false; do { @@ -376,10 +380,10 @@ int LSNAllocator::alloc_lsn_scn(const SCN &base_scn, const uint64_t tmp_next_scn = std::max(base_scn.get_val_for_logservice(), last_scn + 1); if ((tmp_next_scn + 1) - scn_base_ >= LOG_TS_DELTA_UPPER_BOUND) { - // 对于可能生成的padding log, 也会占用一个scn + // For the possible padding log generated, it will also occupy one scn need_update_base = true; } else if ((last.log_id_delta_ + 2) >= LOG_ID_DELTA_UPPER_BOUND) { - // 对于可能生成的padding log, 也会占用一个log_id + // For the possible padding log, it will also occupy a log_id need_update_base = true; } else { // do nothing @@ -392,78 +396,78 @@ int LSNAllocator::alloc_lsn_scn(const SCN &base_scn, uint64_t tmp_next_block_id = lsn_2_block(LSN(last.lsn_val_), PALF_BLOCK_SIZE); uint64_t tmp_next_log_id_delta = last.log_id_delta_; uint64_t tmp_next_scn_delta = tmp_next_scn - scn_base_; - // 下一条日志是否需要cut + // Is the next log entry required to be cut? bool is_next_need_cut = false; const uint64_t last_block_offset = lsn_2_offset(LSN(last.lsn_val_), PALF_BLOCK_SIZE); uint64_t tmp_next_block_offset = 0; if (last.is_need_cut_) { - // 上一条日志不再聚合,需生成新日志 + // The previous log is no longer aggregated, a new log needs to be generated is_new_group_log = true; tmp_next_block_offset = last_block_offset + new_group_log_size; - // 判断新日志是否会达到/跨过2M边界,是则下一条日志要触发freeze + // Determine if the new log will reach/cross the 2MB boundary, if so, the next log should trigger freeze if ((last_block_offset & LOG_CUT_TRIGGER_MASK) + new_group_log_size >= LOG_CUT_TRIGGER) { is_next_need_cut = true; } } else if (last_block_offset > 0 && (last_block_offset & LOG_CUT_TRIGGER_MASK) == 0) { - // 上一条日志末尾恰好已到2M边界,预期不会出现,因为这种情况last.is_need_cut_一定为true + // The end of the previous log is exactly at the 2M boundary, which is expected not to happen, because in this case last.is_need_cut_ must be true ret = OB_ERR_UNEXPECTED; PALF_LOG(WARN, "last_block_offset is reach 2M boundary", K(ret), K(last_block_offset)); } else if (last_block_offset > 0 && ((last_block_offset & LOG_CUT_TRIGGER_MASK) + size) > LOG_CUT_TRIGGER) { - // 上一条日志聚合本条日志后会跨2M边界,本条日志不再聚合 + // The previous log aggregation with this log would cross the 2MB boundary, this log will not be aggregated is_new_group_log = true; is_next_need_cut = false; tmp_next_block_offset = last_block_offset + new_group_log_size; - // 判断新日志是否会达到/跨过2M边界,是则下一条日志要触发freeze + // Determine if the new log will reach/cross the 2MB boundary, if so, the next log should trigger freeze if ((last_block_offset & LOG_CUT_TRIGGER_MASK) + new_group_log_size >= LOG_CUT_TRIGGER) { is_next_need_cut = true; } } else { - // 聚合到上一条日志尾部 + // Aggregate to the end of the previous log is_new_group_log = false; is_next_need_cut = false; tmp_next_block_offset = last_block_offset + size; - // 判断新日志是否会达到/跨过2M边界,是则下一条日志要触发freeze + // Determine if the new log will reach/cross the 2MB boundary, if so, the next log should trigger freeze if ((last_block_offset & LOG_CUT_TRIGGER_MASK) + size >= LOG_CUT_TRIGGER) { is_next_need_cut = true; } } if (tmp_next_block_offset < PALF_BLOCK_SIZE) { - // 未超过文件size,需判断文件末尾空间是否小于4K - // 是则以padding形式聚合到日志末尾 - // 否则不处理 + // Not exceeded file size, need to determine if the space at the end of the file is less than 4K + // If so, aggregate in padding form to the end of the log + // Otherwise do not process if (PALF_BLOCK_SIZE - tmp_next_block_offset < CLOG_FILE_TAIL_PADDING_TRIGGER) { - // 文件尾小于4K, 需生成padding entry补齐,将新日志存到下一个文件中 + // File tail is less than 4K, need to generate padding entry to fill it up, and store new logs in the next file is_new_group_log = true; need_gen_padding_entry = true; - // padding_len包含padding_log的log_group_entry_header_size + // padding_len contains the log_group_entry_header_size of padding_log padding_len = PALF_BLOCK_SIZE - last_block_offset; tmp_next_block_id++; // block_id++ tmp_next_block_offset = new_group_log_size; is_next_need_cut = false; - // 判断新日志是否会达到/跨过2M边界,是则下一条日志要触发freeze + // Determine if the new log will reach/cross the 2MB boundary, if so, the next log should trigger freeze if (new_group_log_size >= LOG_CUT_TRIGGER) { is_next_need_cut = true; } } } else if (tmp_next_block_offset == PALF_BLOCK_SIZE) { - // 恰好到达文件尾 + // Exactly reached the end of the file tmp_next_block_id++; // block_id++ tmp_next_block_offset = 0; is_next_need_cut = true; } else { - // 当前文件无法容纳该日志, 需要切文件 - // 首先在本文件尾生成一个padding_entry,它的scn与后一条日志相同 - // 然后将新日志写到下一个文件开头 + // The current file cannot accommodate this log, a file switch is needed + // First generate a padding_entry at the end of this file, its scn is the same as the next log entry + // Then write the new log to the beginning of the next file is_new_group_log = true; need_gen_padding_entry = true; - // padding_len包含padding_log的log_group_entry_header_size + // padding_len contains the log_group_entry_header_size of padding_log padding_len = PALF_BLOCK_SIZE - last_block_offset; tmp_next_block_id++; // block_id++ tmp_next_block_offset = new_group_log_size; is_next_need_cut = false; - // 判断新日志是否会达到/跨过2M边界,是则下一条日志要触发freeze + // Determine if the new log will reach/cross the 2MB boundary, if so, the next log should trigger freeze if (new_group_log_size >= LOG_CUT_TRIGGER) { is_next_need_cut = true; } diff --git a/src/logservice/palf/lsn_allocator.h b/src/logservice/palf/lsn_allocator.h index a5a07a885..0eba88db3 100644 --- a/src/logservice/palf/lsn_allocator.h +++ b/src/logservice/palf/lsn_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_OFFSET_ALLOCATOR_ @@ -34,7 +38,7 @@ class LSNAllocator int get_log_block_size(const uint64_t block_id, int64_t &block_size) const { // TODO: by haofan - // 为了支持log文件大小可配置,需要为每个文件获取对应的size + // To support configurable log file size, it is necessary to obtain the corresponding size for each file UNUSED(block_id); block_size = PALF_BLOCK_SIZE; return OB_SUCCESS; @@ -44,16 +48,16 @@ class LSNAllocator int get_curr_end_lsn(LSN &curr_end_lsn) const; int try_freeze_by_time(LSN &last_lsn, int64_t &last_log_id); int try_freeze(LSN &last_lsn, int64_t &last_log_id); - // 功能: 为一条日志分配lsn, scn. + // Function: Assign lsn, scn to a log entry. // - // @param [in] base_scn: scn下界值 - // @param [in] size: 日志体长度,如果是聚合日志需包含LogHeader长度 + // @param [in] base_scn: lower bound value of scn + // @param [in] size: length of the log body, if it is an aggregated log, it should include the LogHeader length // - // @param [out] lsn: 分配的lsn - // @param [out] scn: 分配的scn - // @param [out] is_new_log: 是否需要生成新日志 - // @param [out] need_gen_padding_entry: 是否需要在本条日志之前生成padding_entry - // @param [out] padding_len: padding部分的总长度 + // @param [out] lsn: allocated lsn + // @param [out] scn: allocated scn + // @param [out] is_new_log: whether a new log needs to be generated + // @param [out] need_gen_padding_entry: whether a padding_entry needs to be generated before this log entry + // @param [out] padding_len: total length of the padding part // int alloc_lsn_scn(const share::SCN &base_scn, const int64_t size, @@ -65,24 +69,24 @@ class LSNAllocator bool &is_new_log, bool &need_gen_padding_entry, int64_t &padding_len); - // 更新last_lsn和log_timestamp - // receive_log/append_disk_log 时调用 + // Update last_lsn and log_timestamp + // called when receive_log/append_disk_log is invoked int inc_update_last_log_info(const LSN &lsn, const int64_t log_id, const share::SCN &scn); // inc update scn base, called by change access mode and to leader active int inc_update_scn_base(const share::SCN &scn); int truncate(const LSN &lsn, const int64_t log_id, const share::SCN &scn); - // 获取last_lsn和log_timestamp + // Get last_lsn and log_timestamp TO_STRING_KV("max_log_id", get_max_log_id(), "max_lsn", lsn_ts_meta_.lsn_val_, "max_scn", get_max_scn()); private: - static const int32_t LOG_ID_DELTA_BIT_CNT = 28; // log_id_delta部分的位数,可生成25万个log_id - static const int32_t LOG_TS_DELTA_BIT_CNT = 35; // scn_delta部分的位数, ns级别,约可用32秒 + static const int32_t LOG_ID_DELTA_BIT_CNT = 28; // number of bits for log_id_delta, can generate 250,000 log_ids + static const int32_t LOG_TS_DELTA_BIT_CNT = 35; // number of bits for scn_delta part, ns level, approximately available for 32 seconds static const int64_t LOG_ID_DELTA_UPPER_BOUND = (1ul << LOG_ID_DELTA_BIT_CNT) - 1000; static const int64_t LOG_TS_DELTA_UPPER_BOUND = (1ul << LOG_TS_DELTA_BIT_CNT) - 1000; - static const uint64_t LOG_CUT_TRIGGER = 1 << 21; // 聚合日志跨2M边界时切分 + static const uint64_t LOG_CUT_TRIGGER = 1 << 21; // Split log when it crosses the 2MB boundary static const uint64_t LOG_CUT_TRIGGER_MASK = (1 << 21) - 1; - static const uint64_t MAX_SUPPORTED_BLOCK_ID = 0xfffffffff - 1000; // block_id告警阈值 - static const uint64_t MAX_SUPPORTED_BLOCK_OFFSET = 0xfffffff; // block_offset的最大支持256MB + static const uint64_t MAX_SUPPORTED_BLOCK_ID = 0xfffffffff - 1000; // block_id alarm threshold + static const uint64_t MAX_SUPPORTED_BLOCK_OFFSET = 0xfffffff; // the maximum supported block_offset is 256MB private: union LSNTsMeta { diff --git a/src/logservice/palf/palf_base_info.cpp b/src/logservice/palf/palf_base_info.cpp index d3653e9d4..20d5f0b2e 100644 --- a/src/logservice/palf/palf_base_info.cpp +++ b/src/logservice/palf/palf_base_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "palf_base_info.h" @@ -105,7 +109,7 @@ void PalfBaseInfo::reset() bool PalfBaseInfo::is_valid() const { - // NB: prev_log_info_、curr_lsn_预期是有效值,其他字段可能无效(全局第一条日志的场景) + // NB: prev_log_info_ and curr_lsn_ are expected to be valid values, other fields may be invalid (scenario of the first global log) return (prev_log_info_.is_valid() && curr_lsn_.is_valid() && curr_lsn_ >= prev_log_info_.lsn_); } diff --git a/src/logservice/palf/palf_base_info.h b/src/logservice/palf/palf_base_info.h index 1952239d2..c90a17185 100644 --- a/src/logservice/palf/palf_base_info.h +++ b/src/logservice/palf/palf_base_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_PALF_BASE_INFO_ diff --git a/src/logservice/palf/palf_callback.h b/src/logservice/palf/palf_callback.h index 337e2b937..0cec6360e 100644 --- a/src/logservice/palf/palf_callback.h +++ b/src/logservice/palf/palf_callback.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_PALF_CALLBACK_ @@ -30,7 +34,7 @@ namespace palf class PalfFSCb { public: - // end_lsn返回的是最后一条已确认日志的下一位置 + // end_lsn returns the position of the next log after the last confirmed log virtual int update_end_lsn(int64_t id, const LSN &end_lsn, const share::SCN &end_scn, const int64_t proposal_id) = 0; }; @@ -44,7 +48,7 @@ class PalfRoleChangeCb class PalfRebuildCb { public: - // lsn 表示触发rebuild时源端的基线lsn位点 + // lsn indicates the baseline lsn point at the source end when rebuild is triggered virtual int on_rebuild(const int64_t id, const LSN &lsn) = 0; virtual bool is_rebuilding(const int64_t id) const = 0; }; diff --git a/src/logservice/palf/palf_callback_wrapper.cpp b/src/logservice/palf/palf_callback_wrapper.cpp index c0fb3d6d1..09088c87f 100644 --- a/src/logservice/palf/palf_callback_wrapper.cpp +++ b/src/logservice/palf/palf_callback_wrapper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "palf_callback_wrapper.h" diff --git a/src/logservice/palf/palf_callback_wrapper.h b/src/logservice/palf/palf_callback_wrapper.h index 372d764a4..c4bd774a1 100644 --- a/src/logservice/palf/palf_callback_wrapper.h +++ b/src/logservice/palf/palf_callback_wrapper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_PALF_CALLBACK_WRAPPER_ diff --git a/src/logservice/palf/palf_env.cpp b/src/logservice/palf/palf_env.cpp index 42e41dd18..9c41524fd 100644 --- a/src/logservice/palf/palf_env.cpp +++ b/src/logservice/palf/palf_env.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF diff --git a/src/logservice/palf/palf_env.h b/src/logservice/palf/palf_env.h index ad62d9b66..378037102 100644 --- a/src/logservice/palf/palf_env.h +++ b/src/logservice/palf/palf_env.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_PALF_ENV_ @@ -78,24 +82,20 @@ class PalfEnv public: PalfEnv(); ~PalfEnv(); - - // 迁移场景目的端副本创建接口 - // @param [in] id,待创建日志流的标识符 + // Migration scenario destination end replica creation interface + // @param [in] id, the identifier of the log stream to be created // @param [in] access_mode,palf access mode - // @param [in] palf_base_info,palf的日志起点信息 - // @param [out] handle,创建成功后生成的palf_handle对象 + // @param [in] palf_base_info, the log start information of palf + // @param [out] handle, the generated palf_handle object after successful creation int create(const int64_t id, const AccessMode &access_mode, const PalfBaseInfo &palf_base_info, PalfHandle &handle); - - // 打开一个id对应的Paxos Replica,返回文件句柄 + // Open a Paxos Replica corresponding to an id, and return the file handle int open(int64_t id, PalfHandle &handle); - - // 关闭一个句柄 + // Close a handle void close(PalfHandle &handle); - - // 删除id对应的Paxos Replica,会同时删除物理文件; + // Delete the Paxos Replica corresponding to the id, which will also delete the physical file; int remove(int64_t id); // @brief get palf disk usage diff --git a/src/logservice/palf/palf_env_impl.cpp b/src/logservice/palf/palf_env_impl.cpp index 1af72cdc5..cf0808770 100644 --- a/src/logservice/palf/palf_env_impl.cpp +++ b/src/logservice/palf/palf_env_impl.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF @@ -176,7 +180,7 @@ PalfEnvImpl::PalfEnvImpl() : palf_meta_lock_(common::ObLatchIds::PALF_ENV_LOCK), disk_not_enough_print_interval_in_gc_thread_(OB_INVALID_TIMESTAMP), disk_not_enough_print_interval_in_loop_thread_(OB_INVALID_TIMESTAMP), self_(), - palf_handle_impl_map_(64), // 指定min_size=64 + palf_handle_impl_map_(64), // specify min_size=64 last_palf_epoch_(0), rebuild_replica_log_lag_threshold_(0), enable_log_cache_(false), diff --git a/src/logservice/palf/palf_env_impl.h b/src/logservice/palf/palf_env_impl.h index 4cc974656..3a3aa76dd 100644 --- a/src/logservice/palf/palf_env_impl.h +++ b/src/logservice/palf/palf_env_impl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_MGR_ @@ -216,8 +220,7 @@ class IPalfEnvImpl VIRTUAL_TO_STRING_KV("IPalfEnvImpl", "Dummy"); }; - -// 日志服务的容器类,同时管理logservice对象的生命周期 +// Container class for the log service, also manages the lifecycle of the logservice object class PalfEnvImpl : public IPalfEnvImpl { public: @@ -237,11 +240,10 @@ class PalfEnvImpl : public IPalfEnvImpl share::ObLocalDevice *log_local_device, share::ObResourceManager *resource_manager, common::ObIOManager *io_manager); - - // start函数包含两层含义: + // start function contains two meanings: // - // 1. 启动PalfEnvImpl所包含的各类工作线程 - // 2. 根据base_dir中包含的log_storage和meta_storage文件,加载所有日志流所需的元信息及日志,执行故障恢复 + // 1. Start all the worker threads contained in PalfEnvImpl + // 2. According to the log_storage and meta_storage files included in base_dir, load all the required metadata and logs for the log streams, and perform fault recovery // // @return :TODO int start(); @@ -249,18 +251,18 @@ class PalfEnvImpl : public IPalfEnvImpl void wait(); void destroy(); public: - // 创建日志流接口 - // @param [in] palf_id,待创建日志流的标识符 - // @param [in] palf_base_info,palf的日志起点信息 - // @param [out] palf_handle_impl,创建成功后生成的palf_handle_impl对象 - // 在不再使用palf_handle_impl对象时,需要调用者执行revert_palf_handle_impl + // Create log stream interface + // @param [in] palf_id, identifier of the log stream to be created + // @param [in] palf_base_info, palf's log start information + // @param [out] palf_handle_impl, the generated palf_handle_impl object after successful creation + // When the palf_handle_impl object is no longer in use, the caller needs to execute revert_palf_handle_impl int create_palf_handle_impl(const int64_t palf_id, const AccessMode &access_mode, const PalfBaseInfo &palf_base_info, IPalfHandleImpl *&palf_handle_impl) override final; - // 删除日志流, 由Garbage Collector调用 + // Delete log stream, called by Garbage Collector // - // @param [in] palf_id,删除的日志流标识符 + // @param [in] palf_id, the identifier of the log stream to be deleted // // @return :TODO int remove_palf_handle_impl(const int64_t palf_id) override final; diff --git a/src/logservice/palf/palf_handle.cpp b/src/logservice/palf/palf_handle.cpp index eb6305d66..f6737f984 100755 --- a/src/logservice/palf/palf_handle.cpp +++ b/src/logservice/palf/palf_handle.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "palf_handle.h" diff --git a/src/logservice/palf/palf_handle.h b/src/logservice/palf/palf_handle.h index 30134d9cb..cce55d910 100755 --- a/src/logservice/palf/palf_handle.h +++ b/src/logservice/palf/palf_handle.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_PALF_HANDLE_ @@ -49,11 +53,10 @@ class PalfHandle // @brief move-assignment operator PalfHandle& operator=(PalfHandle &&rhs); bool operator==(const PalfHandle &rhs) const; - - // 在创建日志流成功后,设置初始成员列表信息,只允许执行一次 + // After successfully creating the log stream, set the initial member list information, only allowed to execute once // - // @param [in] member_list, 日志流的成员列表 - // @param [in] paxos_replica_num, 日志流paxos成员组中的副本数 + // @param [in] member_list, member list of the log stream + // @param [in] paxos_replica_num, the number of replicas in the log stream paxos member group // // @return :TODO // @brief set the initial member list of paxos group after creating @@ -81,7 +84,7 @@ class PalfHandle const int64_t paxos_replica_num, const common::GlobalLearnerList &learner_list); #endif - //================ 文件访问相关接口 ======================= + //================ File access related interfaces ======================= int append(const PalfAppendOptions &opts, const void *buffer, const int64_t nbytes, @@ -121,17 +124,16 @@ class PalfHandle const int64_t nbytes, int64_t &read_size, LogIOContext &io_ctx); - - // iter->next返回的是append调用写入的值,不会在返回的buf中携带Palf增加的header信息 - // 返回的值不包含未确认日志 + // iter->next returns the value written by the append call, and will not carry the header information added by Palf in the returned buf + // The returned value does not include unconfirmed logs // - // 在指定start_lsn构造Iterator时,iter会自动根据PalfHandle::accepted_end_lsn - // 确定迭代的结束位置,此结束位置会自动更新(即返回OB_ITER_END后再次 - // 调用iter->next()有返回有效值的可能) + // When constructing Iterator at specified start_lsn, iter will automatically determine based on PalfHandle::accepted_end_lsn + // Determine the end position of the iteration, this end position will be automatically updated (i.e., after returning OB_ITER_END again + // There is a possibility that iter->next() returns a valid value) // - // PalfBufferIterator的生命周期由调用者管理 - // 调用者需要确保在iter关联的PalfHandle close后不再访问 - // 这个Iterator会在内部缓存一个大的Buffer + // The lifecycle of PalfBufferIterator is managed by the caller + // The caller needs to ensure that the iter associated PalfHandle is not accessed after it is closed + // This Iterator will internally cache a large Buffer int seek(const LSN &lsn, PalfBufferIterator &iter); int seek(const LSN &lsn, PalfGroupBufferIterator &iter); @@ -178,19 +180,17 @@ class PalfHandle // - OB_ERR_OUT_OF_LOWER_BOUND: lsn is too small, log files may have been recycled // - others: bug int locate_by_lsn_coarsely(const LSN &lsn, share::SCN &result_scn); - - // 开启日志同步 + // Enable log synchronization int enable_sync(); - // 关闭日志同步 + // Close log synchronization int disable_sync(); bool is_sync_enabled() const; - // 推进文件的可回收点 + // Advance the file's recyclable point int advance_base_lsn(const LSN &lsn); - // 迁移/rebuild场景推进base_lsn + // Migration/rebuild scenario advances base_lsn int advance_base_info(const palf::PalfBaseInfo &palf_base_info, const bool is_rebuild); int flashback(const int64_t mode_version, const share::SCN &flashback_scn, const int64_t timeout_us); - - // 返回文件中可读的最早日志的位置信息 + // Return the position information of the earliest readable log in the file int get_begin_lsn(LSN &lsn) const; int get_begin_scn(share::SCN &scn) const; @@ -202,9 +202,8 @@ class PalfHandle // @param[out] PalfBaseInfo&, palf_base_info int get_base_info(const LSN &lsn, PalfBaseInfo &palf_base_info); - - // 返回最后一条已确认日志的下一位置 - // 在没有新的写入的场景下,返回的end_lsn不可读 + // Return the position after the last confirmed log + // In the scenario without new writes, the returned end_lsn is not readable int get_end_lsn(LSN &lsn) const; int get_end_scn(share::SCN &scn) const; int get_max_lsn(LSN &lsn) const; @@ -215,14 +214,12 @@ class PalfHandle // -- OB_NOT_INIT not_init // -- OB_SUCCESS int get_readable_end_lsn(LSN &lsn) const; - - //================= 分布式相关接口 ========================= - - // 返回当前副本的角色,只存在Leader和Follower两种角色 - // - // @param [out] role, 当前副本的角色 - // @param [out] leader_epoch,表示一轮leader任期, 保证在切主和重启场景下的单调递增性 - // @param [out] is_pending_state,表示当前副本是否处于pending状态 + //================= Distributed related interfaces ========================= + // Return the current replica's role, only Leader and Follower roles exist + // + // @param [out] role, current replica's role + // @param [out] leader_epoch, indicates a term of the leader, ensuring monotonic increase in scenarios of leader-follower switch and restart + // @param [out] is_pending_state, indicates whether the current replica is in a pending state // // @return :TODO int get_role(common::ObRole &role, int64_t &proposal_id, bool &is_pending_state) const; @@ -520,8 +517,7 @@ class PalfHandle // By default, paxos replica can reply ack. // @return: int enable_vote(); - - //================= 回调函数注册 =========================== + //================= Callback function registration =========================== // @brief: register a callback to PalfHandleImpl, and do something in // this callback when file size has changed. // NB: not thread safe @@ -548,8 +544,7 @@ class PalfHandle // @brief: unregister a callback from PalfHandleImpl // NB: not thread safe int unregister_rebuild_cb(); - - //================= 依赖功能注册 =========================== + //================= Dependency function registration =========================== int set_location_cache_cb(PalfLocationCacheCb *lc_cb); int reset_location_cache_cb(); int set_election_priority(election::ElectionPriority *priority); diff --git a/src/logservice/palf/palf_handle_impl.cpp b/src/logservice/palf/palf_handle_impl.cpp index 407f77e19..1e0cac21b 100755 --- a/src/logservice/palf/palf_handle_impl.cpp +++ b/src/logservice/palf/palf_handle_impl.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PALF @@ -473,11 +477,11 @@ int PalfHandleImpl::get_role(common::ObRole &role, int64_t curr_leader_epoch = -1; do { is_pending_state = mode_mgr_.is_in_pending_state(); - // 获取当前的proposal_id + // get the current proposal_id proposal_id = state_mgr_.get_proposal_id(); - // 获取当前的leader_epoch + // Get the current leader_epoch curr_leader_epoch = state_mgr_.get_leader_epoch(); - // 获取当前的role, state + // Get the current role, state state_mgr_.get_role_and_state(curr_role, curr_state); if (LEADER != curr_role || ACTIVE != curr_state) { // not @@ -486,14 +490,14 @@ int PalfHandleImpl::get_role(common::ObRole &role, is_pending_state = true; } } else if (false == state_mgr_.check_epoch_is_same_with_election(curr_leader_epoch)) { - // PALF当前是, 但epoch在election层发生了变化, - // 说明election已经切主, PALF最终一定会切为, 这种情况也当做pending state, - // 否则调用者看到PALF是, 但proposal_id却还是LEADER时的值, - // 可能会导致非预期行为, 比如role change service可能会提前执行卸任操作. + // PALF is currently , but the epoch changed at the election layer, + // Explanation that election has switched to leader, PALF will eventually switch to , this situation is also considered as pending state, + // Otherwise the caller sees PALF as , but proposal_id is still the value from LEADER, + // May lead to unexpected behavior, such as the role change service may prematurely execute the relinquishment operation. role = common::FOLLOWER; is_pending_state = true; } else { - // 返回LEADER + // Return LEADER role = common::LEADER; } // double check proposal_id @@ -1913,8 +1917,8 @@ int PalfHandleImpl::advance_base_info(const PalfBaseInfo &palf_base_info, const } else if (OB_FAIL(check_need_advance_base_info_(new_base_lsn, prev_log_info, is_rebuild))) { PALF_LOG(WARN, "check_need_advance_base_info failed", K(ret), KPC(this), K(palf_base_info), K(is_rebuild)); } else if (OB_FAIL(sw_.truncate_for_rebuild(palf_base_info))) { - // 与receive_log的truncate相比的不同点是,该场景truncate位点预期大于sw左边界 - // 且小于truncate位点的日志都需要回调并丢弃 + // The difference from the truncate in receive_log is that the expected truncate point in this scenario is greater than the left boundary of sw + // and logs that are less than the truncate point need to be callbacked and discarded PALF_LOG(WARN, "sw_ truncate_for_rebuild failed", K(ret), KPC(this), K(palf_base_info)); } else if (OB_FAIL(log_snapshot_meta.generate(new_base_lsn, prev_log_info, new_base_lsn))) { PALF_LOG(WARN, "LogSnapshotMeta generate failed", K(ret), KPC(this), K(palf_base_info)); @@ -3661,9 +3665,9 @@ int PalfHandleImpl::fetch_log_from_storage_(const common::ObAddr &server, if (FETCH_LOG_LEADER_RECONFIRM == fetch_type || state_mgr_.is_leader_active() || state_mgr_.is_leader_reconfirm()) { - // leader reconfirm状态也要允许发送unconfirmed log,否则start_working日志可能无法达成多数派 - // 因为多数派副本日志落后时,receive config_log前向校验会失败 - // reconfirm状态下unconfirmed log可以安全地发出,因为这部分日志预期不会被truncate + // leader reconfirm state also needs to allow sending unconfirmed log, otherwise start_working log may not achieve a majority + // Because the majority replica log is behind, the forward validation before receive config_log will fail + // In the reconfirm state, unconfirmed logs can be safely sent because this part of the logs is expected not to be truncated is_limitted_by_end_lsn = false; } int64_t unused_mode_version; @@ -4376,10 +4380,9 @@ int PalfHandleImpl::after_flush_config_change_meta_(const int64_t proposal_id, c } return ret; } - -// 1. 更新snapshot_meta串行化, 实现inc update的语义. -// 2. 应用层先提交truncate任务, 再提交更新meta的任务, 最后开始拉日志.(不再依赖, 上层保证base_lsn不会回退) -// NB: TODO by runlin, 在支持多writer后, truncate和和更新meta需要做成'类似'双向barrier的语义 +// 1. Update snapshot_meta serialization, implement inc update semantics. +// 2. The application layer first submits the truncate task, then submits the update meta task, and finally starts pulling logs. (No longer dependent, the upper layer guarantees that base_lsn will not roll back) +// NB: TODO by runlin, after supporting multiple writers, truncate and updating meta need to be made with 'similar' two-way barrier semantics int PalfHandleImpl::after_flush_snapshot_meta_(const LSN &lsn) { return log_engine_.update_base_lsn_used_for_gc(lsn); diff --git a/src/logservice/palf/palf_handle_impl.h b/src/logservice/palf/palf_handle_impl.h index 435873f0f..2734bb509 100755 --- a/src/logservice/palf/palf_handle_impl.h +++ b/src/logservice/palf/palf_handle_impl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_PALF_LOG_SERVICE_ @@ -214,8 +218,7 @@ struct RebuildMetaInfo LSN last_submit_lsn_; int64_t last_submit_log_pid_; }; - -// 日志服务的接口类,logservice以外的模块使用日志服务,只允许调用IPalfHandleImpl的接口 +// The interface class of the log service, modules other than logservice are only allowed to call the interfaces of IPalfHandleImpl when using the log service class IPalfHandleImpl : public common::LinkHashValue { public: @@ -250,26 +253,26 @@ class IPalfHandleImpl : public common::LinkHashValue virtual int get_arb_member_info(ArbMemberInfo &arb_member_info) const = 0; virtual int get_arbitration_member(common::ObMember &arb_member) const = 0; #endif - // 提交需要持久化的内容,提交内容以日志形式在本地持久化并同步给Paxos成员列表中的其他副本 - // 同时,若存在只读副本或物理备库,日志会在满足条件时同步给对应节点 - // 在Paxos成员列表中的多数派副本持久化成功后,会调用log_ctx->on_success()通知调用者 + // Submit content that needs to be persisted, the submitted content is logged locally and synchronized to other replicas in the Paxos member list + // At the same time, if there are read-only replicas or physical standby databases, logs will be synchronized to the corresponding nodes when conditions are met + // After the majority of replicas in the Paxos member list successfully persist, it will call log_ctx->on_success() to notify the caller // - // 若执行过程中,发生了主备切换(Leader->Follower),且该日志最终形成了多数派, - // 则仍会调用log_ctx->on_success()而非replay log + // If a leader-follower switch (Leader->Follower) occurs during execution, and this log eventually forms a majority, + // then it will still call log_ctx->on_success() rather than replay log // - // 函数返回成功的场景下,在任一副本上log_ctx->on_success()/log_ctx->on_failure()/replay log - // 其中之一保证最终调用且只调用一次 + // In the scenario where the function returns successfully, on any replica, log_ctx->on_success()/log_ctx->on_failure()/replay log + // One of them ensures the final call and only one call // - // @param [in] opts, 提交日志的一些可选项参数,具体参见PalfAppendOptions的定义 - // @param [in] buf, 待持久化内容的起点指针,::submit_log函数返回后buf即可被释放 - // @param [in] buf_len, 待持久化内容的长度,size的有效范围是[0, 2M] - // @param [in] ref_scn, 日志对应的时间,满足弱读需求 + // @param [in] opts, some optional parameters for submitting logs, see the definition of PalfAppendOptions for details + // @param [in] buf, the starting pointer of the content to be persisted, buf can be released after ::submit_log function returns + // @param [in] buf_len, the length of the content to be persisted, the valid range of size is [0, 2M] + // @param [in] ref_scn, log corresponding time, meeting weak read requirements // - // 下述两个值通过submit_log出参,而不是on_success()和上层交互,好处是类似于lock_for_read逻辑可以更早 - // 的拿到准确的版本号信息 - // @param [out] lsn, 日志的唯一标识符 - // 主要使用场景是prepare日志中记录redo日志的lsn,用于数据链路回拉历史日志时定位使用 - // @param [out] scn, 日志对应的submit_scn,主要用于事务版本号,比如lock_for_read场景使用 + // The following two values are passed out via the submit_log return parameters, rather than through on_success() and upper-layer interaction, which allows logic similar to lock_for_read to occur earlier + // get the accurate version number information + // @param [out] lsn, the unique identifier of the log + // The main usage scenario is to record the redo log's lsn in the prepare log, used for locating historical logs when pulling back in the data link + // @param [out] scn, submit_scn corresponding to the log, mainly used for transaction version number, for example, in the lock_for_read scenario // // @return :TODO virtual int submit_log(const PalfAppendOptions &opts, @@ -278,37 +281,37 @@ class IPalfHandleImpl : public common::LinkHashValue const share::SCN &ref_scn, LSN &lsn, share::SCN &scn) = 0; - // 提交group_log到palf - // 使用场景:备库leader处理从主库收到的日志 - // @param [in] opts, 提交日志的一些可选项参数,具体参见PalfAppendOptions的定义 - // @param [in] lsn, 日志对应的lsn - // @param [in] buf, 待持久化内容的起点指针,::submit_group_log函数返回后buf即可被释放 - // @param [in] buf_len, 待持久化内容的长度 + // submit group_log to palf + // Usage scenario: Follower leader processes logs received from the primary + // @param [in] opts, some optional parameters for submitting logs, see the definition of PalfAppendOptions for details + // @param [in] lsn, log sequence number corresponding to the log + // @param [in] buf, the starting pointer of the content to be persisted, buf can be released after ::submit_group_log function returns + // @param [in] buf_len, the length of the content to be persisted virtual int submit_group_log(const PalfAppendOptions &opts, const LSN &lsn, const char *buf, const int64_t buf_len) = 0; - // 返回当前副本的角色,只存在Leader/StandbyLeader/Follower三种角色 + // Return the current replica's role, which only exists in Leader/StandbyLeader/Follower three roles // - // @param [out] role, 当前副本的角色 - // @param [out] proposal_id, leader的唯一标识符,跨机单调递增. + // @param [out] role, current replica's role + // @param [out] proposal_id, unique identifier for the leader, monotonically increasing across machines. // // @return :TODO virtual int get_role(common::ObRole &role, int64_t &proposal_id, bool &is_pending_state) const = 0; - // 获取 palf_id + // get palf_id virtual int get_palf_id(int64_t &palf_id) const = 0; - // 切主接口,用于内部调试用,任何正式功能不应依赖此接口 - // 正式功能中的切主动作应当由优先级策略来描述,统一到一套规则中 - // 该接口是异步接口,在该接口调用返回成功后,Leader可能会经历若干秒才完成切换,理论上也存在极小概率切换失败 - // 在系统正常的情况下,预期在若干ms内,leader就会完成切换 + // Primary switch interface, used for internal debugging only, no formal functionality should depend on this interface + // The cut-in action in the formal function should be described by a priority strategy, unified into a set of rules + // This interface is an asynchronous interface, after the interface call returns successfully, the Leader may take several seconds to complete the switch, theoretically there is also a very small probability of the switch failing + // In a normal system, it is expected that the leader will complete the switch within several ms // - // @param [in] dest_addr, 切主的目的副本,必须在当前的成员列表中 + // @param [in] dest_addr, the destination replica for leader switch, must be in the current member list // // @return : - // OB_ENTRY_NOT_EXIST : 切主的目标副本不在palf当前的成员列表中 - // OB_NOT_MASTER : 本副本当前不是leader,无法接受切主请求 + // OB_ENTRY_NOT_EXIST : The target replica for the leader switch is not in palf's current member list + // OB_NOT_MASTER : This replica is not currently the leader and cannot accept a leader switch request virtual int change_leader_to(const common::ObAddr &dest_addr) = 0; virtual int get_global_learner_list(common::GlobalLearnerList &learner_list) const = 0; @@ -523,25 +526,22 @@ class IPalfHandleImpl : public common::LinkHashValue virtual int set_election_silent_flag(const bool election_silent_flag) = 0; virtual bool is_election_silent() const = 0; #endif - - // 设置日志文件的可回收位点,小于等于lsn的日志文件均可以安全回收 + // Set the recyclable point of the log file, log files with LSN less than or equal to lsn can be safely recycled // - // @param [in] lsn,可回收的日志文件位点 + // @param [in] lsn, the log file position that can be recycled // // @return :TODO virtual int set_base_lsn(const LSN &lsn) = 0; - - // 允许palf收拉日志 + // Allow palf to pull logs virtual int enable_sync() = 0; - // 禁止palf收拉日志,在rebuild/migrate场景下,防止日志盘爆 + // Prohibit palf from pulling logs, to prevent log disk overflow in rebuild/migrate scenarios virtual int disable_sync() = 0; - // 标记palf实例已经删除 + // Mark the palf instance as deleted virtual void set_deleted() = 0; virtual bool is_sync_enabled() const = 0; - - // 迁移/rebuild场景目的端推进base_lsn + // Migration/rebuild scenario purpose end advancing base_lsn // - // @param [in] palf_base_info,可回收的日志文件位点 + // @param [in] palf_base_info, recyclable log file position virtual int advance_base_info(const PalfBaseInfo &palf_base_info, const bool is_rebuild) = 0; // @desc: query coarse lsn by scn, that means there is a LogGroupEntry in disk, @@ -831,11 +831,11 @@ class PalfHandleImpl : public IPalfHandleImpl const int64_t palf_epoch, LogIOAdapter *io_adapter); bool check_can_be_used() const override final; - // 重启接口 - // 1. 生成迭代器,定位meta_storage和log_storage的终点; - // 2. 从meta storage中读最新数据,初始化dio_aligned_buf; - // 3. 初始化log_storage中的dio_aligned_buf; - // 4. 初始化palf_handle_impl的其他字段. + // Restart interface + // 1. Generate iterator, locate the end of meta_storage and log_storage; + // 2. Read the latest data from meta storage, initialize dio_aligned_buf; + // 3. Initialize dio_aligned_buf in log_storage; + // 4. Initialize other fields of palf_handle_impl. int load(const int64_t palf_id, FetchLogEngine *fetch_log_engine, const char *log_dir, @@ -1027,8 +1027,8 @@ class PalfHandleImpl : public IPalfHandleImpl const share::SCN get_end_scn() const override final { - // 基于实现复杂度考虑,直接用last_slide_scn作为end_scn - // 否则需要在match_lsn_map中额外维护scn + // Based on implementation complexity, directly use last_slide_scn as end_scn + // Otherwise, it is necessary to maintain scn additionally in match_lsn_map return sw_.get_last_slide_scn(); } int get_last_rebuild_lsn(LSN &last_rebuild_lsn) const override final; diff --git a/src/logservice/palf/palf_handle_impl_guard.cpp b/src/logservice/palf/palf_handle_impl_guard.cpp index 9ef574a47..64260d264 100644 --- a/src/logservice/palf/palf_handle_impl_guard.cpp +++ b/src/logservice/palf/palf_handle_impl_guard.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "palf_handle_impl_guard.h" diff --git a/src/logservice/palf/palf_handle_impl_guard.h b/src/logservice/palf/palf_handle_impl_guard.h index f7614ced6..114c13e57 100644 --- a/src/logservice/palf/palf_handle_impl_guard.h +++ b/src/logservice/palf/palf_handle_impl_guard.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_LOG_SERVICE_GUARD_ diff --git a/src/logservice/palf/palf_iterator.h b/src/logservice/palf/palf_iterator.h index fe13c8c4b..90b3440c3 100644 --- a/src/logservice/palf/palf_iterator.h +++ b/src/logservice/palf/palf_iterator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_PALF_ITERATOR_ diff --git a/src/logservice/palf/palf_options.cpp b/src/logservice/palf/palf_options.cpp index 01dce32cb..223491088 100644 --- a/src/logservice/palf/palf_options.cpp +++ b/src/logservice/palf/palf_options.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "palf_options.h" @@ -90,8 +94,7 @@ bool PalfTransportCompressOptions::is_valid() const { return !enable_transport_compress_ || (ObCompressorType::INVALID_COMPRESSOR != transport_compress_func_); } - -//为了使用时可以无锁,需要考虑修改顺序 +//To use without locking, the order of modification needs to be considered PalfTransportCompressOptions &PalfTransportCompressOptions::operator=(const PalfTransportCompressOptions &other) { if (!other.enable_transport_compress_) { diff --git a/src/logservice/palf/palf_options.h b/src/logservice/palf/palf_options.h index 5e77d11f2..344b4f7f2 100644 --- a/src/logservice/palf/palf_options.h +++ b/src/logservice/palf/palf_options.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_PALF_OPTIONS_ @@ -58,41 +62,40 @@ struct PalfDiskOptions struct PalfAppendOptions { - // Palf的使用者在提交日志时,有两种不同的使用方式: + // The user of Palf has two different usage methods when submitting logs: // - // 1. 阻塞提交(类比于io系统调用的BLOCK语义)。这种使用方式在提交日志量超过Palf的处理能力时, - // 会占住线程,极端场景下可能会使调用线程"永远阻塞"; + // 1. Blocking commit (analogous to the BLOCK semantics of IO system calls). This usage is applicable when the volume of submitted logs exceeds Palf's processing capacity, + // Will occupy the thread, in extreme scenarios it may cause the calling thread to "block forever"; // - // 优点:使用简单,不需要处理超出处理能力时的报错; + // Advantages: easy to use, no need to handle errors when exceeding processing capacity; // - // 缺点:会占住调用线程; + // Disadvantage: It will occupy the calling thread; // - // 典型使用场景:提交事务的redo日志; + // Typical use case: redo log for transaction submission; // - // 2. 非阻塞提交(类比于io系统调用的NONBLOCK语义)。这种使用方式在提交日志量超过Palf的处理能力时, - // append调用返回OB_EAGAIN错误码,不会占住调用线程; + // 2. Non-blocking submission (analogous to the NONBLOCK semantics of IO system calls). This usage mode is used when the volume of submitted logs exceeds Palf's processing capacity, + // append call returns OB_EAGAIN error code, will not block the calling thread; // - // 优点:不会占住调用线程; + // Advantages: It does not occupy the calling thread; // - // 缺点:调用者需要处理OB_EAGAIN错误; + // Disadvantage: The caller needs to handle the OB_EAGAIN error; // - // 典型使用场景:提交事务的prepare/commit日志,返回OB_EAGAIN后由两阶段状态机推进状态; + // Typical use case: prepare/commit logs for transaction submission, state is advanced by the two-phase state machine after returning OB_EAGAIN; // - // 默认值为NONBLOCK + // Default value is NONBLOCK bool need_nonblock = true; bool need_check_proposal_id = true; int64_t proposal_id = 0; TO_STRING_KV(K(need_nonblock), K(need_check_proposal_id), K(proposal_id)); }; - -// Palf支持在三种模式中来回切换 +// Palf supports switching between three modes // -// APPEND: 该模式下,PALF为待提交日志分配LSN和TS +// APPEND: In this mode, PALF assigns LSN and TS to the logs to be committed // -// RAW_WRITE: 该模式下, PALF不具备为待提交日志分配LSN和TS的能力 +// RAW_WRITE: In this mode, PALF does not have the capability to allocate LSN and TS for pending logs // -// FLASHBACK: 该模式下, PALF不具备日志写入能力,且各副本间不响应拉日志请求 -// PREPARE_FLASHBACK: 该模式下,PALF不具备日志写入能力,各副本间可以互相同步日志 +// FLASHBACK: In this mode, PALF does not have log writing capability, and replicas do not respond to log pull requests +// PREPARE_FLASHBACK: In this mode, PALF does not have log writing capability, and logs can be synchronized among replicas enum class AccessMode { INVALID_ACCESS_MODE = 0, APPEND = 1, diff --git a/src/logservice/palf_handle_guard.h b/src/logservice/palf_handle_guard.h index cdad7c4f3..31b30e923 100644 --- a/src/logservice/palf_handle_guard.h +++ b/src/logservice/palf_handle_guard.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_PALF_HANDLE_GUARD_ diff --git a/src/logservice/rcservice/ob_role_change_handler.cpp b/src/logservice/rcservice/ob_role_change_handler.cpp index 280696975..8119c7a3a 100644 --- a/src/logservice/rcservice/ob_role_change_handler.cpp +++ b/src/logservice/rcservice/ob_role_change_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_role_change_handler.h" diff --git a/src/logservice/rcservice/ob_role_change_handler.h b/src/logservice/rcservice/ob_role_change_handler.h index 6a5d994bc..d58d423a6 100644 --- a/src/logservice/rcservice/ob_role_change_handler.h +++ b/src/logservice/rcservice/ob_role_change_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_ROLE_CHANGE_HANDLER_ @@ -60,7 +64,7 @@ struct RCDiagnoseInfo { void reset(); int64_t id_; TakeOverState state_; - ObLogBaseType log_type_; //仅当处于WAIT_RC_HANDLER_DONE时才有意义 + ObLogBaseType log_type_; //Only meaningful when in WAIT_RC_HANDLER_DONE state TO_STRING_KV(K(state_), K(log_type_)); }; diff --git a/src/logservice/rcservice/ob_role_change_service.cpp b/src/logservice/rcservice/ob_role_change_service.cpp index 8dece0513..bde422cd8 100644 --- a/src/logservice/rcservice/ob_role_change_service.cpp +++ b/src/logservice/rcservice/ob_role_change_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_role_change_service.h" @@ -790,11 +794,11 @@ int ObRoleChangeService::diagnose(RCDiagnoseInfo &diagnose_info) { int ret = OB_SUCCESS; if (diagnose_info.id_ == ATOMIC_LOAD(&cur_task_info_.id_)) { - // 当前日志流的切主任务正在被处理 + // The leader switch task for the current log stream is being processed diagnose_info.state_ = ATOMIC_LOAD(&cur_task_info_.state_); diagnose_info.log_type_ = ATOMIC_LOAD(&cur_task_info_.log_type_); } else { - // 当前日志流切主任务尚未被处理, 可能是因为其他日志流的切主任务卡住 + // The current log stream leader switch task has not been processed, possibly because the leader switch task of another log stream is stuck diagnose_info.state_ = logservice::TakeOverState::UNKNOWN_TAKE_OVER_STATE; diagnose_info.log_type_ = logservice::ObLogBaseType::INVALID_LOG_BASE_TYPE; } diff --git a/src/logservice/rcservice/ob_role_change_service.h b/src/logservice/rcservice/ob_role_change_service.h index 1a70dc160..4f85f8442 100644 --- a/src/logservice/rcservice/ob_role_change_service.h +++ b/src/logservice/rcservice/ob_role_change_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_ROLE_CHANGE_SERVICE_ diff --git a/src/logservice/replayservice/ob_log_replay_service.cpp b/src/logservice/replayservice/ob_log_replay_service.cpp index 6baa031b9..86f1945e7 100644 --- a/src/logservice/replayservice/ob_log_replay_service.cpp +++ b/src/logservice/replayservice/ob_log_replay_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_log_replay_service.h" @@ -255,7 +259,7 @@ int ObLogReplayService::start() is_running_ = true; int tmp_ret = OB_SUCCESS; if (OB_SUCCESS != (tmp_ret = replay_stat_.start())) { - //不影响回放线程工作 + //Does not affect the playback thread work CLOG_LOG(WARN, "replay_stat start failed", K(tmp_ret)); } CLOG_LOG(INFO, "start ObLogReplayService success", K(ret), K(tg_id_)); @@ -319,7 +323,7 @@ void ObLogReplayService::handle(common::LinkTask *task) ObReplayServiceTask *task_to_handle = static_cast(task); ObReplayStatus *replay_status = NULL; bool need_push_back = false; - // 不需要重新推入线程池的任务必须归还replay status的引用计数 + // Tasks that do not need to be re-pushed into the thread pool must return the reference count of the replay status if (OB_ISNULL(task_to_handle)) { ret = OB_INVALID_ARGUMENT; CLOG_LOG(ERROR, "task is null", K(ret)); @@ -343,8 +347,8 @@ void ObLogReplayService::handle(common::LinkTask *task) } else { bool is_timeslice_run_out = false; ObReplayServiceTaskType task_type = task_to_handle->get_type(); - // 此处检查is_enable不上锁, 依赖实际内部处理逻辑持锁判断 - // 支持reuse语义, 此任务不能直接丢弃, 需要走正常的push back流程推进lease + // Here check is_enable without locking, relying on the actual internal logic to hold lock for judgment + // Support reuse semantics, this task cannot be directly discarded, it needs to go through the normal push back process to advance the lease if (!replay_status->is_enabled()) { CLOG_LOG(INFO, "replay status is disabled, just ignore the task", KPC(replay_status)); } else if (OB_FAIL(pre_check_(*replay_status, *task_to_handle))) { @@ -377,8 +381,8 @@ void ObLogReplayService::handle(common::LinkTask *task) int tmp_ret = OB_SUCCESS; if (OB_SUCCESS != (tmp_ret = submit_task(task_to_handle))) { CLOG_LOG(ERROR, "push task back after handle failed", K(tmp_ret), KPC(task_to_handle), KPC(replay_status), K(ret)); - // simplethreadpool stop无锁, 并发下可能出现push失败 - // 失败时归还replay_status引用计数即可, 任务可以直接丢弃 + // simplethreadpool stop lock-free, concurrent push may fail + // On failure, just return the replay_status reference count, the task can be directly discarded revert_replay_status_(replay_status); } else { //do nothing @@ -406,7 +410,7 @@ int ObLogReplayService::add_ls(const share::ObLSID &id) } else { replay_status->inc_ref(); if (OB_FAIL(replay_status_map_.insert(id, replay_status))) { - // enable后已经开始回放,不能直接free + // enable after playback has started, cannot be freed directly CLOG_LOG(ERROR, "failed to insert log stream", K(ret), K(id), KPC(replay_status)); revert_replay_status_(replay_status); } else { @@ -416,8 +420,7 @@ int ObLogReplayService::add_ls(const share::ObLSID &id) } return ret; } - -// 先从map中摘掉再尝试释放内存 +// First remove from the map and then attempt to free memory int ObLogReplayService::remove_ls(const share::ObLSID &id) { int ret = OB_SUCCESS; @@ -435,9 +438,8 @@ int ObLogReplayService::remove_ls(const share::ObLSID &id) } return ret; } - -// base_lsn可以不和base_scn完全对应,以base_scn为基准过滤回放, -// 调用者需要注意log scn为base_scn的日志需要回放 +// base_lsn can be not completely corresponding to base_scn, filter and replay based on base_scn, +// The caller should note that logs with log scn as base_scn need to be replayed int ObLogReplayService::enable(const share::ObLSID &id, const LSN &base_lsn, const SCN &base_scn) @@ -617,8 +619,7 @@ int ObLogReplayService::is_submit_task_clear(const share::ObLSID &id, bool &is_c } return ret; } - -//通用接口, 受控回放时最终返回值为受控回放点前的最后一条日志的log_ts +//Generic interface, the final return value during controlled replay is the log_ts of the last log before the controlled replay point int ObLogReplayService::get_max_replayed_scn(const share::ObLSID &id, SCN &scn) { int ret = OB_SUCCESS; @@ -684,7 +685,7 @@ int ObLogReplayService::submit_task(ObReplayServiceTask *task) } else { task->set_enqueue_ts(ObTimeUtility::fast_current_time()); while (OB_FAIL(TG_PUSH_TASK(tg_id_, task)) && OB_EAGAIN == ret) { - //预期不应该失败 + //Expected not to fail ob_throttle_usleep(1000, ret); CLOG_LOG(ERROR, "failed to push", K(ret)); } @@ -939,7 +940,7 @@ int ObLogReplayService::pre_check_(ObReplayStatus &replay_status, ret = OB_EAGAIN; ob_throttle_usleep(1000, ret); //1ms } else if (!task.need_replay_immediately()) { - //避免重试过于频繁导致cpu跑满 + //Avoid retrying too frequently to prevent CPU from being maxed out ob_throttle_usleep(10, ret); //10us } // Check the waiting time of the task in the global queue @@ -997,7 +998,7 @@ int ObLogReplayService::do_replay_task_(ObLogReplayTask *replay_task, CLOG_LOG(WARN, "ls do pre barrier replay failed", K(ret), K(replay_task), KPC(replay_task), KPC(replay_status)); } else { - //释放log_buf内存 + //release log_buf memory CLOG_LOG(INFO, "pre barrier log replay succ", KPC(replay_task), KPC(replay_status), K(replay_queue_idx), K(ret)); replay_task->read_log_buf_ = replay_log_buff; @@ -1160,7 +1161,7 @@ int ObLogReplayService::fetch_and_submit_single_log_(ObReplayStatus &replay_stat CLOG_LOG(WARN, "failed to prepare_decompression_buf", KPC(submit_task), K(header)); #endif } else if (header.need_pre_replay_barrier()) { - // 前向barrier日志的replay task和log buf需要分别分配内存 + // Forward barrier log replay task and log buf need to be allocated memory separately if (OB_FAIL(fetch_pre_barrier_log_(replay_status, submit_task, replay_task, @@ -1173,7 +1174,7 @@ int ObLogReplayService::fetch_and_submit_single_log_(ObReplayStatus &replay_stat //print log inside } } else { - // 非前向barrier日志的replay task分配整块内存 + // Non-forward barrier log replay task allocates a block of memory const int64_t task_size = sizeof(ObLogReplayTask) + log_size; char *task_buf = NULL; if (OB_UNLIKELY(NULL == (task_buf = static_cast(alloc_replay_task(task_size))))) { @@ -1384,7 +1385,7 @@ int ObLogReplayService::handle_replay_task_(ObReplayServiceReplayTask *task_queu } else { task_queue->clear_err_info(); if (!replay_task->is_pre_barrier_) { - //前向barrier日志执行回放的线程会提前释放内存 + //The forward barrier log replay thread will release memory in advance replay_status->dec_pending_task(replay_task->get_replay_payload_size()); } free_replay_task(replay_task_to_destroy); diff --git a/src/logservice/replayservice/ob_log_replay_service.h b/src/logservice/replayservice/ob_log_replay_service.h index 0b53da957..a56dcee0d 100644 --- a/src/logservice/replayservice/ob_log_replay_service.h +++ b/src/logservice/replayservice/ob_log_replay_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_LOG_REPLAY_SERVICE_ @@ -46,7 +50,7 @@ class ReplayProcessStat : public common::ObTimerTask virtual void runTimerTask(); private: static const int64_t SCAN_TIMER_INTERVAL = 10 * 1000 * 1000; //10s - //上一次轮询时总回放日志量 + //Total replay log volume at the last poll int64_t last_replayed_log_size_; int64_t last_submitted_log_size_; ObLogReplayService *rp_sv_; @@ -63,7 +67,7 @@ class ObILogReplayService virtual int switch_to_leader(const share::ObLSID &id) = 0; }; /* -TODO(yaoying.yyy): replayservice的内存管理需要整理一个文档 +TODO(yaoying.yyy): memory management of replayservice needs to be documented */ class ObLogReplayService: public lib::TGLinkTaskHandler, public ObILogReplayService @@ -219,7 +223,7 @@ class ObLogReplayService: public lib::TGLinkTaskHandler, public ObILogReplayServ const int64_t first_handle_time); void on_replay_error_(ObLogReplayTask &replay_task, int ret); void on_replay_error_(); - // 析构前调用,归还所有日志流的replay status计数 + // Called before destruction, return the replay status count of all log streams int remove_all_ls_(); #ifdef OB_BUILD_LOG_STORAGE_COMPRESS int prepare_decompression_buf_(const ObLSID id, @@ -242,7 +246,7 @@ class ObLogReplayService: public lib::TGLinkTaskHandler, public ObILogReplayServ const int64_t MAX_SUBMIT_TIME_PER_ROUND = 100 * 1000; //100ms const int64_t TASK_QUEUE_WAIT_IN_GLOBAL_QUEUE_TIME_THRESHOLD = 5 * 1000 * 1000; //5s const int64_t PENDING_TASK_MEMORY_LIMIT = 128 * (1LL << 20); //128MB - //每个日志流累计拉日志到阈值时batch提交所有task queue + // Each log stream accumulates log pulls to the threshold and batch submits all task queues static const int64_t BATCH_PUSH_REPLAY_TASK_COUNT_THRESOLD = 1024; static const int64_t BATCH_PUSH_REPLAY_TASK_SIZE_THRESOLD = 16 * (1LL << 20); //16MB // params of adaptive thread pool @@ -259,7 +263,7 @@ class ObLogReplayService: public lib::TGLinkTaskHandler, public ObILogReplayServ palf::PalfEnv *palf_env_; ObILogAllocator *allocator_; share::SCN replayable_point_; - // 考虑到迁出迁入场景, 不能只通过map管理replay status的生命周期 + // Considering the migration scenario, the lifecycle of replay status cannot be managed by map alone common::ObLinearHashMap replay_status_map_; int64_t pending_replay_log_size_; ObMiniStat::ObStatItem wait_cost_stat_; diff --git a/src/logservice/replayservice/ob_replay_handler.cpp b/src/logservice/replayservice/ob_replay_handler.cpp index 3f916446b..4e0a4d9d3 100644 --- a/src/logservice/replayservice/ob_replay_handler.cpp +++ b/src/logservice/replayservice/ob_replay_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_replay_handler.h" diff --git a/src/logservice/replayservice/ob_replay_handler.h b/src/logservice/replayservice/ob_replay_handler.h index 14cc62701..1480931d5 100644 --- a/src/logservice/replayservice/ob_replay_handler.h +++ b/src/logservice/replayservice/ob_replay_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_REPLAY_HANDLER_ diff --git a/src/logservice/replayservice/ob_replay_status.cpp b/src/logservice/replayservice/ob_replay_status.cpp index 451e30d11..3fe455471 100644 --- a/src/logservice/replayservice/ob_replay_status.cpp +++ b/src/logservice/replayservice/ob_replay_status.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_replay_status.h" @@ -38,7 +42,7 @@ ObReplayServiceTask::~ObReplayServiceTask() void ObReplayServiceTask::reset() { - //考虑到reuse需求, lease不能重置, 否则可能出现同一个任务被push多次 + //Considering the reuse requirement, lease cannot be reset, otherwise the same task may be pushed multiple times enqueue_ts_ = 0; err_info_.reset(); } @@ -108,7 +112,7 @@ int ObReplayServiceSubmitTask::init(const palf::LSN &base_lsn, base_scn_ = base_scn; type_ = ObReplayServiceTaskType::SUBMIT_LOG_TASK; if (OB_SUCCESS != (tmp_ret = iterator_.next())) { - // 在没有写入的情况下有可能已经到达边界 + // It is possible to reach the boundary without writing CLOG_LOG(WARN, "iterator next failed", K(iterator_), K(tmp_ret)); } CLOG_LOG(INFO, "submit log task init success", K(type_), K(next_to_submit_lsn_), @@ -130,7 +134,7 @@ void ObReplayServiceSubmitTask::reset() void ObReplayServiceSubmitTask::destroy() { reset(); - //iterator不支持reset语义,不能在后续可能重用的接口中调用destroy接口 + //iterator does not support reset semantics, cannot call destroy interface in interfaces that may be reused later iterator_.destroy(); ObReplayServiceTask::destroy(); } @@ -178,16 +182,15 @@ int ObReplayServiceSubmitTask::get_base_scn_(SCN &scn) const bool ObReplayServiceSubmitTask::has_remained_submit_log(const SCN &replayable_point, bool &iterate_end_by_replayable_point) { - // next接口只在submit任务中单线程调用,和reset接口通过replay status的大锁互斥 - // 故此处不需要submit task锁保护 + // next interface is only called in the submit task in a single thread, and the reset interface is mutually exclusive with it through the big lock of replay status + // Therefore, there is no need for submit task lock protection here if (false == iterator_.is_valid()) { // maybe new logs is written after last check next_log(replayable_point, iterate_end_by_replayable_point); } return iterator_.is_valid(); } - -//只有padding日志的场景才能调用此接口 +//Only the scenario with padding logs can call this interface int ObReplayServiceSubmitTask::update_submit_log_meta_info(const LSN &lsn, const SCN &scn) @@ -339,7 +342,7 @@ void ObReplayServiceReplayTask::reset() while (NULL != (top_item = pop_())) { ObLogReplayTask *replay_task = static_cast(top_item); - //此处一定只能让引用计数归零的任务释放log_buff + //This task that reduces the reference count to zero must release log_buff if (replay_task->is_pre_barrier_) { ObLogReplayBuffer *replay_buf = static_cast(replay_task->read_log_buf_); if (NULL == replay_buf) { @@ -623,13 +626,13 @@ int ObReplayStatus::init(const share::ObLSID &id, void ObReplayStatus::destroy() { int ret = OB_SUCCESS; - //注意: 虽然replay status的引用计数已归0, 但此时fs_cb_依然可能访问replay status,需要先调用unregister_file_size_cb + // Note: Although the reference count of replay status has been set to 0, fs_cb_ may still access replay status at this time, so unregister_file_size_cb must be called first if (OB_FAIL(palf_handle_.unregister_file_size_cb())) { CLOG_LOG(ERROR, "failed to unregister cb", K(ret)); } WLockGuard wlock_guard(rwlock_); CLOG_LOG(INFO, "destuct replay status", KPC(this)); - // 析构前必须是disable状态 + // Must be in disable state before destruction if (is_enabled_) { CLOG_LOG(ERROR, "is_enable when destucting", K(this)); } else { @@ -656,8 +659,7 @@ void ObReplayStatus::destroy() rp_sv_ = NULL; } } - -//不可重入,如果失败需要外部手动disable +//Non-reentrant, if failed needs to be manually disabled externally int ObReplayStatus::enable(const LSN &base_lsn, const SCN &base_scn) { int ret = OB_SUCCESS; @@ -674,16 +676,15 @@ int ObReplayStatus::enable(const LSN &base_lsn, const SCN &base_scn) } return ret; } - -// 提交当前的submit_log_task并注册回调 +// submit the current submit_log_task and register callback int ObReplayStatus::enable_(const LSN &base_lsn, const SCN &base_scn) { int ret = OB_SUCCESS; - // 处理submit_task需要先设置enable状态 + // Processing submit_task requires setting the enable state first is_enabled_ = true; is_submit_blocked_ = false; if (0 != pending_task_count_) { - //针对reuse场景的防御检查 + //Defense check for reuse scenario ret = OB_ERR_UNEXPECTED; CLOG_LOG(WARN, "remain pending task when enable replay status", K(ret), KPC(this)); } else if (OB_FAIL(submit_log_task_.init(base_lsn, base_scn, ls_id_, this))) { @@ -708,8 +709,7 @@ int ObReplayStatus::enable_(const LSN &base_lsn, const SCN &base_scn) } return ret; } - -//可以重入 +//Reentrant int ObReplayStatus::disable() { int ret = OB_SUCCESS; @@ -869,7 +869,7 @@ int ObReplayStatus::is_replay_done(const LSN &end_lsn, CLOG_LOG(ERROR, "min_unreplayed_lsn invalid", K(this), K(ret), K(end_lsn)); } else { is_done = min_unreplayed_lsn >= end_lsn; - //TODO: @keqing.llt 限流改为类内 + //TODO: @keqing.llt Change rate limiting to within the class if (REACH_TIME_INTERVAL(10 * 1000 * 1000)) { if (is_done) { CLOG_LOG(INFO, "log stream finished replay", K(ls_id_), K(min_unreplayed_lsn), K(end_lsn)); @@ -987,7 +987,7 @@ int ObReplayStatus::get_min_unreplayed_log_info(LSN &lsn, } else if (OB_FAIL(submit_log_task_.get_base_scn(base_scn))) { CLOG_LOG(ERROR, "get_base_scn failed", K(ret)); } else if (scn <= base_scn) { - //拉到的日志尚未超过过滤点 + //The fetched logs have not exceeded the filter point scn = base_scn; if (palf_reach_time_interval(5 * 1000 * 1000, get_log_info_debug_time_)) { CLOG_LOG(INFO, "get_min_unreplayed_log_info in skip state", K(lsn), K(scn), KPC(this)); @@ -1077,10 +1077,10 @@ int ObReplayStatus::push_log_replay_task(ObLogReplayTask &task) ret = OB_NOT_INIT; CLOG_LOG(ERROR, "replay service is NULL", K(task), K(ret)); } else if (task.is_pre_barrier_) { - //广播到所有队列, 分配多份内存时如果失败需要全部释放 + //Broadcast to all queues, if memory allocation fails when allocating multiple memory blocks, all need to be released const int64_t task_size = sizeof(ObLogReplayTask); common::ObSEArray broadcast_task_array; - //入参任务本身占用一个槽位 + //The input parameter task itself occupies one slot broadcast_task_array.push_back(&task); for (int64_t i = 1; OB_SUCC(ret) && i < REPLAY_TASK_QUEUE_SIZE; ++i) { void *task_buf = NULL; @@ -1110,7 +1110,7 @@ int ObReplayStatus::push_log_replay_task(ObLogReplayTask &task) for (index = 0; OB_SUCC(ret) && index < REPLAY_TASK_QUEUE_SIZE; ++index) { ObLogReplayTask *replay_task = broadcast_task_array[index]; task_queues_[index].push(replay_task); - //失败后整体重试会导致此任务引用计数错乱, 必须原地重试 + //Failure to retry as a whole will cause the reference count of this task to become inconsistent, must retry in place int retry_count = 0; while (OB_FAIL(submit_task_to_replay_service_(task_queues_[index]))) { //print interval 100ms @@ -1137,8 +1137,7 @@ int ObReplayStatus::push_log_replay_task(ObLogReplayTask &task) } return ret; } - -//此接口不会失败 +//This interface will not fail int ObReplayStatus::batch_push_all_task_queue() { int ret = OB_SUCCESS; @@ -1218,7 +1217,7 @@ int ObReplayStatus::check_submit_barrier() CLOG_LOG(ERROR, "replay status not inited", K(ret)); } else { offset_t post_barrier_lsn_val = ATOMIC_LOAD(&post_barrier_lsn_.val_); - // 如果当前已经有后向barrier在队列中, 则需要此后向barrier日志回放完才能提交新任务 + // If there is already a backward barrier in the queue, then the new task can only be submitted after the backward barrier log replay is complete if (LOG_INVALID_LSN_VAL == post_barrier_lsn_val) { ret = OB_SUCCESS; } else { @@ -1227,8 +1226,7 @@ int ObReplayStatus::check_submit_barrier() } return ret; } - -//前向barrier日志只有引用计数减为0的线程需要回放 +// Forward barrier log is only replayed by the thread that reduces the reference count to 0 int ObReplayStatus::check_replay_barrier(ObLogReplayTask *replay_task, ObLogReplayBuffer *&replay_log_buf, bool &need_replay, @@ -1254,10 +1252,10 @@ int ObReplayStatus::check_replay_barrier(ObLogReplayTask *replay_task, } else if (replay_queue_idx == calc_replay_queue_idx(replay_hint) && 1 != replay_log_buf->get_replay_ref()) { ret = OB_EAGAIN; - //某个事务内的前向barrier日志只能在此队列回放 + //The forward barrier log within a certain transaction can only be replayed in this queue CLOG_LOG(TRACE, "skip dec pre barrier log ref", K(ret), K(replay_task), KPC(replay_task), K(nv), KPC(this)); - //TODO(yaoying.yyy):重构下这里 + //TODO(yaoying.yyy):Refactor this part } else if ((0 == (nv = replay_log_buf->dec_replay_ref()))) { if (replay_queue_idx != calc_replay_queue_idx(replay_hint)) { ret = OB_ERR_UNEXPECTED; @@ -1373,7 +1371,7 @@ int ObReplayStatus::diagnose(ReplayDiagnoseInfo &diagnose_info) } else if (OB_FAIL(log_base_type_to_string(log_type, log_type_str, common::MAX_SERVICE_TYPE_BUF_LENGTH))) { CLOG_LOG(WARN, "log_base_type_to_string failed", K(ret), K(log_type)); } else if (OB_SUCCESS != err_info_.err_ret_) { - // 发生过不可重试的错误, 此场景不需要诊断最小未回放位日志 + // An unretriable error has occurred, this scenario does not require diagnosing the minimum un-replayed log position min_unreplayed_lsn = err_info_.lsn_; min_unreplayed_scn = err_info_.scn_; replay_hint = err_info_.replay_hint_; diff --git a/src/logservice/replayservice/ob_replay_status.h b/src/logservice/replayservice/ob_replay_status.h index 45dd79641..4a0bcfad8 100644 --- a/src/logservice/replayservice/ob_replay_status.h +++ b/src/logservice/replayservice/ob_replay_status.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_REPLAY_STATUS_ @@ -40,15 +44,15 @@ class PalfEnv; namespace logservice { class ObLogReplayService; -// replay status中含有几种任务类型,它们的含义分别为: -// 1.ObReplayServiceTask: 基类任务, 用于提交到replay service的全局队列中 -// 2.ObLogReplayTask: 每一条日志生成的具体回放任务, 聚合日志中的每一条子日志都对应一个独立的ObLogReplayTask -// 3.ObReplayServiceSubmitTask: submit类型任务, 继承ObReplayServiceTask, -// 在replay status中对应submit_log_task_, -// 记录该日志流需要回放的日志的起点和终点, -// 4.ObReplayServiceReplayTask: replay类型任务, 继承ObReplayServiceTask, -// 在replay status中对应task_queues_[i], -// 用于存放ObLogReplayTask +// replay status contains several task types, their meanings are as follows: +// 1.ObReplayServiceTask: base class task, used to submit to the global queue of replay service +// 2.ObLogReplayTask: The specific replay task generated for each log entry, each sub-log in the aggregated log corresponds to an independent ObLogReplayTask +// 3.ObReplayServiceSubmitTask: submit type task, inherit from ObReplayServiceTask, +// In replay status corresponds to submit_log_task_, +// Record the start and end of the logs that need to be replayed in this log stream, +// 4.ObReplayServiceReplayTask: replay type task, inherit ObReplayServiceTask, +// corresponds to task_queues_[i] in replay status, +// Used to store ObLogReplayTask class ObReplayStatus; enum class ObReplayServiceTaskType { @@ -56,8 +60,7 @@ enum class ObReplayServiceTaskType SUBMIT_LOG_TASK = 1, REPLAY_LOG_TASK = 2, }; - -//虚拟表统计 +//Virtual table statistics struct LSReplayStat { int64_t ls_id_; @@ -91,9 +94,8 @@ struct ReplayDiagnoseInfo max_replayed_scn_.reset(); } }; - -//此类型为前向barrier日志专用, 与ObLogReplayTask分开分配 -//因此此结构的内存需要单独释放 +//This type is dedicated to forward barrier logs, and is allocated separately from ObLogReplayTask +//Therefore the memory of this structure needs to be released separately struct ObLogReplayBuffer { public: @@ -168,8 +170,8 @@ struct ObLogReplayTask : common::ObLink int64_t init_task_ts_; int64_t first_handle_ts_; int64_t print_error_ts_; - int64_t replay_cost_; //此任务回放成功时的当次处理时间 - int64_t retry_cost_; //此任务重试的总耗时时间 + int64_t replay_cost_; //The processing time for this task during a successful replay + int64_t retry_cost_; //Total time cost for retrying this task void *read_log_buf_; void *decompression_buf_;//buf used to decompress log; if not NULL, means log should be decompessed bool has_decompressed_; @@ -178,8 +180,7 @@ struct ObLogReplayTask : common::ObLink int64_t to_string(char* buf, const int64_t buf_len) const; }; - -// replay service task基类 +// replay service task base class class ObReplayServiceTask : public common::LinkTask { public: @@ -259,10 +260,10 @@ class ObReplayServiceTask : public common::LinkTask ObReplayServiceTaskType type_; //for debug: task wait in queue too much time int64_t enqueue_ts_; - // 如果只通过linkhashmap管理replay status的生命周期,ObReplayServiceTask里面只存ls_id, - // 那么在ABA场景下残留的任务会get到新的replay status并且回放, - // 因此需要任务自己记录replay status,而这样会使得replay status不仅在linkhashmap处被用到. - // 所以需要replay status自己管理引用计数, linkhashmap的引用计数是冗余的. + // If only linkhashmap manages the lifecycle of replay status, ObReplayServiceTask only stores ls_id, + // Then in the ABA scenario, the remaining tasks will get a new replay status and replay, + // Therefore the task itself needs to record the replay status, and this will make the replay status not only used at the linkhashmap. + // So it is necessary for replay status to manage its own reference count, the reference count of linkhashmap is redundant. ObReplayStatus *replay_status_; TaskErrInfo err_info_; //control state transition of queue @@ -294,10 +295,10 @@ class ObReplayServiceSubmitTask : public ObReplayServiceTask void destroy() override; public: - // 迭代器是否迭代到终点 + // Is the iterator at the end? bool has_remained_submit_log(const share::SCN &replayable_point, bool &iterate_end_by_replayable_point); - // 不允许回退 + // No rollback allowed int update_submit_log_meta_info(const palf::LSN &lsn, const share::SCN &scn); int get_next_to_submit_log_info(palf::LSN &lsn, share::SCN &scn) const; int get_committed_end_lsn(palf::LSN &lsn) const; @@ -307,7 +308,7 @@ class ObReplayServiceSubmitTask : public ObReplayServiceTask int get_log(const char *&buffer, int64_t &nbytes, share::SCN &scn, palf::LSN &offset); int next_log(const share::SCN &replayable_point, bool &iterate_end_by_replayable_point); - // 以当前的终点作为新起点重置迭代器 + // Reset the iterator with the current endpoint as the new starting point int reset_iterator(const share::ObLSID &id, const palf::LSN &begin_lsn); @@ -384,8 +385,8 @@ class ObReplayServiceReplayTask : public ObReplayServiceTask } private: common::ObSpScLinkQueue queue_; //place ObLogReplayTask - int64_t idx_; //热点行优化 - bool need_batch_push_; //batch push判断标志, 只有拉日志线程可以修改此值 + int64_t idx_; //hotspot row optimization + bool need_batch_push_; // batch push judgment flag, only the log pull thread can modify this value }; class ObReplayFsCb : public palf::PalfFSCb @@ -404,7 +405,7 @@ class ObReplayFsCb : public palf::PalfFSCb { replay_status_ = NULL; } - // 回调接口,调用replay status的update_end_offset接口 + // Callback interface, call the update_end_offset interface of replay status int update_end_lsn(int64_t id, const palf::LSN &end_offset, const share::SCN &end_scn, const int64_t proposal_id); private: ObReplayStatus *replay_status_; @@ -498,7 +499,7 @@ class ObReplayStatus //@return : OB_SUCCESS : success //OB_NOT_INIT: ObReplayStatus has not been inited int is_submit_task_clear(bool &is_clear) const; - // 存在待回放的已提交日志任务 + // There are submitted log tasks pending replay // update right margin of logs that need to replay int update_end_offset(const palf::LSN &lsn); @@ -506,11 +507,11 @@ class ObReplayStatus int batch_push_all_task_queue(); void inc_pending_task(const int64_t log_size); void dec_pending_task(const int64_t log_size); - //通用的replay task释放内存接口, 前向barrier的任务不会单独释放log buf内存 - //前向barrier完整释放申请的内存需要同时调用 - //free_replay_task_log_buf()和free_replay_task() + //Generic replay task memory release interface, forward barrier tasks will not release log buf memory separately + //Forward barrier complete release of allocated memory requires simultaneous invocation + //free_replay_task_log_buf() and free_replay_task() void free_replay_task(ObLogReplayTask *task); - //单独释放ObLogReplayTask中特殊的log_buf, 仅前向barrier日志生效 + //Release the special log_buf in ObLogReplayTask, only forward barrier logs are effective void free_replay_task_log_buf(ObLogReplayTask *task); int get_ls_id(share::ObLSID &id); @@ -527,9 +528,9 @@ class ObReplayStatus int64_t &unsubmitted_log_size, int64_t &replayed_log_size, int64_t &unreplayed_log_size); - //提交日志检查barrier状态 + //Submit log check barrier status int check_submit_barrier(); - //回放日志检查barrier状态 + //Replay log check barrier status int check_replay_barrier(ObLogReplayTask *replay_task, ObLogReplayBuffer *&replay_log_buf, bool &need_replay, @@ -553,7 +554,7 @@ class ObReplayStatus { return replay_hint & (REPLAY_TASK_QUEUE_SIZE - 1); } - // 用于记录日志流级别的错误, 此类错误不可恢复 + // Used to record log stream level errors, this type of error is unrecoverable void set_err_info(const palf::LSN &lsn, const share::SCN &scn, const ObLogBaseType &log_type, @@ -587,11 +588,10 @@ class ObReplayStatus private: void set_next_to_submit_log_info_(const palf::LSN &lsn, const share::SCN &scn); int submit_task_to_replay_service_(ObReplayServiceTask &task); - // 注册回调并提交当前初始化的submit_log_task + // Register callback and submit the currently initialized submit_log_task int enable_(const palf::LSN &base_lsn, const share::SCN &base_scn); - - // 注销回调并清空任务 + // Unregister callback and clear task int disable_(); bool is_replay_enabled_() const; @@ -600,9 +600,9 @@ class ObReplayStatus static const int64_t EAGAIN_COUNT_THRESHOLD = 50000; static const int64_t EAGAIN_INTERVAL_THRESHOLD = 10 * 60 * 1000 * 1000LL; static const int64_t REPLAY_TASK_MAGNIFICATION_THRESHOLD = 10; - //单日志流每次提交16MB日志时需要检查当前租户memstore剩余值是否超限 + //Single log stream needs to check if the remaining value of the current tenant's memstore is exceeded when submitting 16MB of logs each time static const int64_t LS_CHECK_MEMSTORE_INTERVAL_THRESHOLD = 16 * (1LL << 20); - //预期一条日志的回放不会超过1s + //Expect that the replay of a log will not exceed 1s static const int64_t WRLOCK_TRY_THRESHOLD = 1000 * 1000; static const int64_t WRLOCK_RETRY_INTERVAL = 20 * 1000; //20ms @@ -621,8 +621,8 @@ class ObReplayStatus int64_t pending_task_count_; palf::LSN last_check_memstore_lsn_; // protect is_enabled_ and submit_log_task_ - // 回放一条日志时会一直持有读锁直到回放完成 - // 保证拿写锁disable后一定不会有任何日志回放 + // Hold the read lock until the log replay is complete when replaying a log entry + // Ensure that no log replay will occur after write lock is disabled mutable RWLock rwlock_; // protect is_submit_blocked_ and role_ mutable RWLock rolelock_; diff --git a/src/logservice/replayservice/ob_tablet_replay_executor.cpp b/src/logservice/replayservice/ob_tablet_replay_executor.cpp index e52798f7a..bebc7d453 100644 --- a/src/logservice/replayservice/ob_tablet_replay_executor.cpp +++ b/src/logservice/replayservice/ob_tablet_replay_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "logservice/replayservice/ob_tablet_replay_executor.h" diff --git a/src/logservice/replayservice/ob_tablet_replay_executor.h b/src/logservice/replayservice/ob_tablet_replay_executor.h index f6c72618f..d01e351a5 100644 --- a/src/logservice/replayservice/ob_tablet_replay_executor.h +++ b/src/logservice/replayservice/ob_tablet_replay_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_LOGSERVICE_OB_TABLET_REPLAY_EXECUTOR_ #define OCEANBASE_LOGSERVICE_OB_TABLET_REPLAY_EXECUTOR_ diff --git a/src/objit/README.md b/src/objit/README.md index 1f96eb877..9db48e4c2 100644 --- a/src/objit/README.md +++ b/src/objit/README.md @@ -1 +1 @@ -包含LLVM模式的Code Generator逻辑 +Contains LLVM-based Code Generator logic diff --git a/src/objit/include/objit/common/ob_item_type.h b/src/objit/include/objit/common/ob_item_type.h index 6c62b0deb..261452c5a 100644 --- a/src/objit/include/objit/common/ob_item_type.h +++ b/src/objit/include/objit/common/ob_item_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SQL_OB_ITEM_TYPE_H_ @@ -66,6 +70,7 @@ typedef enum ObItemType T_BIT = 31, T_ENUM = 32, T_SET = 33, + T_JSON = 36, T_GEOMETRY = 37, T_UDT_SQL = 38, @@ -190,9 +195,9 @@ typedef enum ObItemType T_OBJ_ACCESS_REF = 167, T_OP_CONNECT_BY_ROOT = 168, - /*regexp_substr这个函数注册已经由T_FUN_SYS_REGEXP_SUBSTR代替,因为将其注册在这会造成oracle无法识别这个函数, - 因此同时不确定删除会不会影响其它,因此选择了保留*/ - T_OP_REGEXP_SUBSTR = 169, + /*regexp_substr this function registration has been replaced by T_FUN_SYS_REGEXP_SUBSTR, because registering it here would cause Oracle to fail to recognize this function, + therefore it is also uncertain whether deletion would affect others, so the decision was made to retain it + T_OP_REGEXP_SUBSTR = 169,*/ T_OP_GET_PACKAGE_VAR = 170, T_OP_SHADOW_UK_PROJECT = 171, @@ -216,6 +221,7 @@ typedef enum ObItemType T_OP_OUTPUT_PACK = 186, T_FUN_GET_TEMP_TABLE_SESSID = 187, T_OP_PUSHDOWN_TOPN_FILTER = 188, + T_OP_LOCAL_DYNAMIC_FILTER = 189, ///< @note add new operator before this line // system functions @@ -345,6 +351,7 @@ typedef enum ObItemType T_FUN_SYS_LEFT = 622, T_FUN_SYS_MAKE_SET = 623, T_FUN_SYS_RAND = 624, + T_FUN_SYS_ROWNUM = 625, T_FUN_SYS_ESTIMATE_NDV = 626, T_FUN_ENUM_TO_STR = 627, T_FUN_ENUM_TO_INNER_TYPE = 628, @@ -497,6 +504,10 @@ typedef enum ObItemType T_FUN_SYS_CURRENT_USER_PRIV = 766, T_FUN_SYS_CURRENT_ROLE = 767, T_FUN_SYS_EXTRACT_CERT_EXPIRED_TIME = 768, + T_FUN_SYS_AUDIT_LOG_SET_FILTER = 769, + T_FUN_SYS_AUDIT_LOG_REMOVE_FILTER = 770, + T_FUN_SYS_AUDIT_LOG_SET_USER = 771, + T_FUN_SYS_AUDIT_LOG_REMOVE_USER = 772, T_FUN_SYS_PASSWORD = 773, T_FUN_SYS_IS_ENABLED_ROLE = 774, T_FUN_SYS_CAN_ACCESS_TRIGGER = 775, @@ -908,6 +919,12 @@ typedef enum ObItemType T_FUN_SYS_MAP_KEYS = 1784, T_FUN_SYS_MAP_VALUES = 1785, T_FUN_SYS_L2_SQUARED = 1786, + T_FUN_SYS_SEMANTIC_DISTANCE = 1787, + T_FUN_SYS_SEMANTIC_VECTOR_DISTANCE = 1788, + T_FUN_SYS_VECTOR_SIMILARITY = 1789, + T_FUN_SYS_VECTOR_L2_SIMILARITY = 1790, + T_FUN_SYS_VECTOR_IP_SIMILARITY = 1791, + T_FUN_SYS_VECTOR_COS_SIMILARITY = 1792, ///< @note add new oracle only function type before this line T_FUN_SYS_TABLET_AUTOINC_NEXTVAL = 1801, // add only for heap table @@ -951,6 +968,18 @@ typedef enum ObItemType T_FUN_SYS_CHECK_CATALOG_ACCESS = 1916, T_FUN_SYS_SPIV_DIM = 1917, // sparse vector index T_FUN_SYS_SPIV_VALUE = 1918, + T_FUN_SYS_CHECK_LOCATION_ACCESS = 1919, + T_FUN_STARTUP_MODE = 1920, + T_FUN_SYS_HIDDEN_CLUSTERING_KEY = 1921, + T_FUN_SYS_TMP_FILE_OPEN = 1922, + T_FUN_SYS_TMP_FILE_CLOSE = 1923, + T_FUN_SYS_TMP_FILE_WRITE = 1924, + T_FUN_SYS_TMP_FILE_READ = 1925, + T_FUN_SYS_HYBRID_VEC_CHUNK = 1926, // hybrid vector index + T_FUN_SYS_FORMAT_PROFILE = 1927, // format query profile + T_FUN_SYS_EMBEDDED_VEC = 1928, + T_FUN_SYS_AI_PROMPT = 1929, + T_FUN_SYS_VEC_VISIBLE = 1930, // vector index table 5 ///< @note add new sys function type before this line T_FUN_SYS_END = 2000, @@ -1018,8 +1047,19 @@ typedef enum ObItemType T_FUN_SYS_RB_TO_ARRAY = 2071, T_FUN_SYS_RB_CONTAINS = 2072, T_FUN_INNER_PREFIX_MIN = 2073, - T_FUN_INNER_PREFIX_MAX = 2074, + T_FUN_INNER_PREFIX_MAX = 2074, T_FUN_SYS_INNER_INFO_COLS_COLUMN_KEY_PRINTER = 2075, + T_FUN_ARG_MIN = 2076, + T_FUN_ARG_MAX = 2077, + T_FUN_TMP_FILE_OPEN = 2078, + T_FUN_TMP_FILE_CLOSE = 2079, + T_FUN_TMP_FILE_WRITE = 2080, + T_FUN_TMP_FILE_READ = 2081, + T_FUN_SYS_AI_COMPLETE = 2082, + T_FUN_SYS_AI_EMBED = 2083, + T_FUN_SYS_AI_RERANK = 2084, + T_FUN_MD5_CNN_WS = 2085, + T_FUN_SYS_BUCKET = 2086, T_MAX_OP = 3000, //pseudo column, to mark the group iterator id @@ -1248,7 +1288,7 @@ typedef enum ObItemType T_MINVALUE = 3437, T_NOMINVALUE = 3438, T_CYCLE = 3439, - /*T_NOCYCLE, defined */ + //T_NOCYCLE, defined T_ORDER = 3440, T_NOORDER = 3441, T_CACHE = 3442, @@ -1467,7 +1507,7 @@ typedef enum ObItemType T_NO_DISTINCT_PUSHDOWN = 3644, T_USE_HASH_SET = 3645, T_NO_USE_HASH_SET = 3646, - T_NEG_SIGN = 3647, /* 用于支持hint里的负数 */ + T_NEG_SIGN = 3647, /* Used to support negative numbers in hint */ T_USE_LATE_MATERIALIZATION = 3648, T_NO_USE_LATE_MATERIALIZATION = 3649, T_NO_REWRITE = 3650, @@ -2658,6 +2698,9 @@ typedef enum ObItemType T_TABLE = 4725, T_EXTERNAL_TABLE_PARTITION = 4726, + //Rebuild Tablet + T_REBUILD_TABLET = 4727, + T_MICRO_INDEX_CLUSTERED = 4728, // Parquet related @@ -2760,6 +2803,7 @@ typedef enum ObItemType // parser config: ik_mode T_IK_MODE = 4800, T_DML_PARALLEL = 4801, + //pl dbms scheduler calendar T_SCHED_CALENDAR = 4802, T_SCHED_CALENDAR_LIST = 4803, @@ -2821,11 +2865,36 @@ typedef enum ObItemType // logservice access point T_BOOTSTRAP_INFO = 4846, T_LOGSERVICE_ACCESS_POINT = 4847, + T_UNIT_LIST = 4848, T_SP_SYS_DISPATCH_CALL = 4849, - T_MV_NESTED_REFRESH_CLAUSE = 4868, //placeholder in master - T_ALTER_SUBPARTITION_EXCHANGE = 4869, + // location object + T_CREATE_LOCATION = 4850, + T_ALTER_LOCATION = 4851, + T_DROP_LOCATION = 4852, + T_LOCATION_OBJECT = 4853, + T_CREDENTIAL_OPTION_LIST = 4854, + T_CREDENTIAL_OPTION = 4855, + T_SHOW_LOCATIONS = 4856, + T_SHOW_CREATE_LOCATION = 4857, + T_LOCATION_UTILS_LIST = 4858, + T_LOCATION_UTILS = 4859, + + T_LOG_ERROR=4860, + T_READ_ERROR_LOG=4861, + + T_PLUGIN_PROPERTIES = 4862, + T_GENERAL_PROPERTY = 4863, + T_PLUGIN_NAME = 4864, + + + T_UDF_PROPERTY = 4865, + T_UDF_PROPERTY_LIST = 4866, + + T_MICRO_BLOCK_FORMAT_VERSION = 4867, + T_MV_NESTED_REFRESH_CLAUSE = 4868, // placeholder for mview + T_ALTER_SUBPARTITION_EXCHANGE = 4869, T_CREATE_SENSITIVE_RULE = 4870, T_DROP_SENSITIVE_RULE = 4871, T_ALTER_SENSITIVE_RULE = 4872, @@ -2839,13 +2908,48 @@ typedef enum ObItemType T_SHOW_SENSITIVE_RULES_OPTION = 4880, // catalog - T_METASTORE_URI = 4881, + T_URI = 4881, // FARM COMPAT WHITELIST T_ACCESS_INFO = 4882, T_WAREHOUSE = 4883, T_SEQUENCE_NAME = 4884, T_STORAGE_CACHE_POLICY_IN_PART_LIST = 4885, T_COLUMN_INDEX_TYPE = 4886, + T_FREQ_THRESHOLD = 4887, + T_SEMISTRUCT_PROPERTIES = 4888, + T_CLUSTERING_KEY = 4889, + T_CLUSTERING_KEY_DROP = 4890, + // optimizer hint + T_INDEX_MERGE_HINT = 4891, + T_NO_INDEX_MERGE_HINT = 4892, + + T_TABLE_FLASHBACK_PROCTIME = 4893, + // hint for disable rich format of operators + T_DISABLE_OP_RICH_FORMAT = 4894, + + T_PRINCIPAL = 4895, + T_KEYTAB = 4896, + T_KRB5CONF = 4897, + T_MAX_CLIENT_POOL_SIZE = 4898, + T_SOCKET_TIMEOUT = 4899, + // erase ss local_cache + T_FLUSH_SS_LOCAL_CACHE = 4900, + // alter type + T_TYPE_ALTER = 4901, + T_TYPE_ALTER_CLAUSE = 4902, + T_TYPE_ALTER_COMPILE = 4903, + T_TYPE_ALTER_ATTR = 4904, + T_TYPE_ALTER_ATTR_LIST = 4905, + T_COMMON_IDENTIFIER_LIST = 4906, + T_ALTER_ATTRIBUTE_DEFINITION_LIST = 4907, + T_REPLACE_TENANT = 4908, + T_FORMAT_OBJECT_NAME_DISPLAY = 4909, + T_CACHE_REFRESH_INTERVAL_SEC = 4910, + T_BACKUP_VALIDATE = 4911, + T_TRANSITION = 4912, + T_FUN_ES_SCORE = 4913, // fulltext index for ES SQL + T_FUN_ES_MATCH = 4914, // fulltext index for ES SQL + T_HYBRID_SEARCH_EXPRESSION = 4915, T_MAX //Attention: add a new type before T_MAX } ObItemType; @@ -2868,6 +2972,8 @@ typedef enum ObCacheType CACHE_TYPE_PL_OBJ, CACHE_TYPE_PS_OBJ, CACHE_TYPE_LIB_CACHE, + CACHE_TYPE_RESULT, + CACHE_TYPE_SEQUENCE, CACHE_TYPE_MAX //Attention: add a new type before CACHE_TYPE_MAX } ObCacheType; @@ -2949,6 +3055,7 @@ typedef enum ObOutlineType #define IS_CONST_TYPE(op) ((op) > T_INVALID && (op) < T_MAX_CONST) #define IS_FUN_SYS_TYPE(op) (((op) >= T_FUN_SYS && (op) < T_FUN_SYS_END) \ || ((op) > T_MIN_OP && (op) <= T_OP_CONST_VAL) \ + || T_OP_CONNECT_BY_ROOT == (op) \ || (lib::is_oracle_mode() && (op) == T_OP_BIT_AND)) #define IS_FUN_STYLE(op) (((op) >= T_FUN_SYS && (op) < T_FUN_SYS_END) \ @@ -2958,7 +3065,8 @@ typedef enum ObOutlineType || T_OP_POW == (op) \ || T_OP_CONV == (op) \ || T_OP_CNN == (op) \ - || T_OP_SIGN == (op) + || T_OP_SIGN == (op) \ + || T_OP_CONNECT_BY_ROOT == (op)) #define ITEM_TO_OBJ_TYPE(op) (static_cast(op)) @@ -2973,18 +3081,21 @@ typedef enum ObOutlineType // special statements #define IS_TRANSACTION_STMT(op) ((op) == T_BEGIN || (op) == T_COMMIT || (op) == T_ROLLBACK) #define IS_PREPARABLE_STMT(op) \ - ((op) == T_SELECT || (op) == T_DELETE || (op) == T_INSERT || (op) == T_UPDATE \ + ((op) == T_SELECT || (op) == T_DELETE || (op) == T_INSERT || (op) == T_MERGE || (op) == T_UPDATE \ || (op) == T_BEGIN || (op) == T_COMMIT || (op) == T_ROLLBACK) #define IS_DML_STMT(op) \ - ((op) == T_SELECT || (op) == T_DELETE || (op) == T_INSERT || (op) == T_UPDATE) + ((op) == T_SELECT || (op) == T_DELETE || (op) == T_INSERT || (op) == T_MERGE || (op) == T_UPDATE || (op) == T_MULTI_INSERT) #define IS_SHOW_STMT(op) (((op) >= T_SHOW_TABLES && (op) <= T_SHOW_GRANTS) || (op) == T_SHOW_TRIGGERS \ || (op) == T_SHOW_CREATE_USER || (op) == T_SHOW_CATALOGS \ || (op) == T_SHOW_CREATE_CATALOG || (op) == T_SHOW_PROFILE \ || (op) == T_SHOW_PROCEDURE_CODE || (op) == T_SHOW_FUNCTION_CODE \ || (op) == T_SHOW_ENGINE || (op) == T_SHOW_OPEN_TABLES \ || (op) == T_SHOW_PLUGINS || (op) == T_SHOW_CHECK_TABLE \ - || (op) == T_SHOW_OLAP_ASYNC_JOB_STATUS) + || (op) == T_SHOW_OLAP_ASYNC_JOB_STATUS \ + || (op) == T_SHOW_CREATE_LOCATION \ + || (op) == T_SHOW_LOCATIONS \ + || (op) == T_LOCATION_UTILS_LIST) #define EXPR_OP_NUM (T_MAX_OP-T_MIN_OP-1) extern const char *get_type_name(int type); @@ -3009,8 +3120,11 @@ extern const char *get_type_name(int type); (op) == T_FUNC_SYS_ARRAY_AGG ||\ ((op) >= T_FUN_SYS_BIT_AND && (op) <= T_FUN_SYS_BIT_XOR) || \ (op) == T_FUN_INNER_PREFIX_MAX || \ - (op) == T_FUN_INNER_PREFIX_MIN) + (op) == T_FUN_INNER_PREFIX_MIN || \ + ((op) >= T_FUN_ARG_MIN && (op) <= T_FUN_ARG_MAX)) #define MAYBE_ROW_OP(op) ((op) >= T_OP_EQ && (op) <= T_OP_NE) +#define IS_PSEUDO_COLUMN_TYPE(op) \ + ((op) == T_LEVEL || (op) == T_CONNECT_BY_ISLEAF || (op) == T_CONNECT_BY_ISCYCLE || (op) == T_ORA_ROWSCN) #define IS_LABEL_SE_POLICY_FUNC(op) \ (T_FUN_LABEL_SE_POLICY_CREATE <= (op) && (op) <= T_FUN_LABEL_SE_LABEL_DROP) @@ -3026,7 +3140,7 @@ extern const char *get_type_name(int type); (op) == T_FUNC_SYS_ARRAY_FILTER || \ (op) == T_FUNC_SYS_ARRAY_SORTBY) /** - * @notice: 目前只支持IS_BASIC_CMP_OP这个宏里定义的op type,如果有在这之外的需求,请扩展这个接口的实现 + * @notice: Currently only supports op types defined in the IS_BASIC_CMP_OP macro, if there are requirements outside of this, please extend the implementation of this interface * */ inline ObItemType get_opposite_compare_type(ObItemType src_type) { diff --git a/src/objit/include/objit/ob_llvm_helper.h b/src/objit/include/objit/ob_llvm_helper.h index e53e36574..9c787e056 100644 --- a/src/objit/include/objit/ob_llvm_helper.h +++ b/src/objit/include/objit/ob_llvm_helper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_DEPS_OBJIT_INCLUDE_OBJIT_OB_LLVM_HELPER_H_ @@ -382,7 +386,7 @@ class ObLLVMHelper int add_compiled_object(size_t length, const char *ptr); public: - //指令 + //instruction int create_br(const ObLLVMBasicBlock &dest); int create_cond_br(ObLLVMValue &value, ObLLVMBasicBlock &true_dest, ObLLVMBasicBlock &false_dest); int create_call(const common::ObString &name, ObLLVMFunction &callee, common::ObIArray &args, ObLLVMValue &result); diff --git a/src/objit/include/objit/ob_llvm_symbolizer.h b/src/objit/include/objit/ob_llvm_symbolizer.h index 4936826b5..ac6d925dd 100644 --- a/src/objit/include/objit/ob_llvm_symbolizer.h +++ b/src/objit/include/objit/ob_llvm_symbolizer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_COMMON_LLVM_SYMBOLIZE_H_ diff --git a/src/objit/src/core/jit_context.cpp b/src/objit/src/core/jit_context.cpp index d66c070fc..1c84fc7cf 100644 --- a/src/objit/src/core/jit_context.cpp +++ b/src/objit/src/core/jit_context.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX JIT diff --git a/src/objit/src/core/jit_context.h b/src/objit/src/core/jit_context.h index 3a8be94b0..4a2dfd64c 100644 --- a/src/objit/src/core/jit_context.h +++ b/src/objit/src/core/jit_context.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef JIT_CONTEXT_H diff --git a/src/objit/src/core/jit_di_context.h b/src/objit/src/core/jit_di_context.h index 505f29421..5461020e7 100644 --- a/src/objit/src/core/jit_di_context.h +++ b/src/objit/src/core/jit_di_context.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef JIT_CONTEXT_DI_H_ diff --git a/src/objit/src/core/ob_jit_allocator.cpp b/src/objit/src/core/ob_jit_allocator.cpp index 0861a0414..276f3c53a 100644 --- a/src/objit/src/core/ob_jit_allocator.cpp +++ b/src/objit/src/core/ob_jit_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_CG @@ -58,7 +62,7 @@ class ObJitMemoryBlock ObJitMemoryBlock *next_; char *addr_; int64_t size_; - char *alloc_end_; //第一个没有分配的位置 + char *alloc_end_; // the first position not allocated }; DEF_TO_STRING(ObJitMemoryGroup) @@ -95,12 +99,12 @@ ObJitMemoryBlock ObJitMemory::allocate_mapped_memory(int64_t num_bytes, uintptr_t start = 0; int64_t mm_flags = MAP_PRIVATE | MAP_ANONYMOUS; void *addr = nullptr; - //循环mmap内存, 直到分配出内存, 避免分配不出内存后, llvm内部直接core + // Loop mmap memory, until memory is allocated, avoid core dump by llvm internal if memory allocation fails do { addr = ::mmap(reinterpret_cast(start), page_size*num_pages, p_flags, mm_flags, fd, 0); if (MAP_FAILED == addr) { - if (REACH_TIME_INTERVAL(10000000)) { //间隔10s打印日志 + if (REACH_TIME_INTERVAL(10000000)) { // interval 10s print log LOG_ERROR_RET(common::OB_ALLOCATE_MEMORY_FAILED, "allocate jit memory failed", K(addr), K(num_bytes), K(page_size), K(num_pages)); } ::usleep(100000); //100ms @@ -230,9 +234,9 @@ ObJitMemoryBlock *ObJitMemoryGroup::alloc_new_block(int64_t sz, int64_t p_flags) if (OB_ISNULL(block.addr_) || 0 == block.size_) { ret = NULL; } else if (NULL != (ret = new ObJitMemoryBlock(block.addr_, - block.size_))) { //TODO 该模块new方法会替换为OB的allocator + block.size_))) { //TODO This module's new method will be replaced with OB's allocator //do nothing - } else { //new失败,释放mmap出来的内存 + } else { // new failed, release the memory mmaped out ObJitMemory::release_mapped_memory(block); } diff --git a/src/objit/src/core/ob_jit_allocator.h b/src/objit/src/core/ob_jit_allocator.h index 2318ab6a8..2f6ba8451 100644 --- a/src/objit/src/core/ob_jit_allocator.h +++ b/src/objit/src/core/ob_jit_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_JIT_ALLOCATOR_H @@ -42,8 +46,7 @@ class ObJitMemoryGroup { } ~ObJitMemoryGroup() { free(); } - - //分配时遍历block_list, 如果有可用大小的block, 则直接从block中获取内存 + // Traverse block_list when allocating, if there is a block with available size, then directly get memory from the block void *alloc_align(int64_t sz, int64_t align, int64_t p_flags = PROT_READ | PROT_WRITE); int finalize(int64_t p_flags); //free all diff --git a/src/objit/src/core/ob_jit_memory_manager.cpp b/src/objit/src/core/ob_jit_memory_manager.cpp index 7de25255d..e019743e4 100644 --- a/src/objit/src/core/ob_jit_memory_manager.cpp +++ b/src/objit/src/core/ob_jit_memory_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_jit_memory_manager.h" diff --git a/src/objit/src/core/ob_jit_memory_manager.h b/src/objit/src/core/ob_jit_memory_manager.h index 83dbc569b..b4636f0de 100644 --- a/src/objit/src/core/ob_jit_memory_manager.h +++ b/src/objit/src/core/ob_jit_memory_manager.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_JIT_MEMORY_MANAGER_H diff --git a/src/objit/src/core/ob_orc_jit.cpp b/src/objit/src/core/ob_orc_jit.cpp index d410276b2..63ef766e1 100644 --- a/src/objit/src/core/ob_orc_jit.cpp +++ b/src/objit/src/core/ob_orc_jit.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL diff --git a/src/objit/src/core/ob_orc_jit.h b/src/objit/src/core/ob_orc_jit.h index 8943dbd06..dc785fd65 100644 --- a/src/objit/src/core/ob_orc_jit.h +++ b/src/objit/src/core/ob_orc_jit.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OBJIT_CORE_ORCJIT_H diff --git a/src/objit/src/core/ob_orc_object_cache.h b/src/objit/src/core/ob_orc_object_cache.h index e9aefe300..007bdec0d 100644 --- a/src/objit/src/core/ob_orc_object_cache.h +++ b/src/objit/src/core/ob_orc_object_cache.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OBORCOBJECTCACHE_H diff --git a/src/objit/src/core/ob_pl_ir_compiler.cpp b/src/objit/src/core/ob_pl_ir_compiler.cpp index f4f266199..a6ad3f88a 100644 --- a/src/objit/src/core/ob_pl_ir_compiler.cpp +++ b/src/objit/src/core/ob_pl_ir_compiler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL diff --git a/src/objit/src/core/ob_pl_ir_compiler.h b/src/objit/src/core/ob_pl_ir_compiler.h index 77e286f7d..e7da2920e 100644 --- a/src/objit/src/core/ob_pl_ir_compiler.h +++ b/src/objit/src/core/ob_pl_ir_compiler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OBJIT_CORE_PL_IR_COMPILER_H diff --git a/src/objit/src/dummy.cpp b/src/objit/src/dummy.cpp index 52a2e0172..c12234483 100644 --- a/src/objit/src/dummy.cpp +++ b/src/objit/src/dummy.cpp @@ -1,12 +1,16 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/src/objit/src/expr/ob_llvm_type.cpp b/src/objit/src/expr/ob_llvm_type.cpp index 292e8e1b3..a7f0746fa 100644 --- a/src/objit/src/expr/ob_llvm_type.cpp +++ b/src/objit/src/expr/ob_llvm_type.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX JIT diff --git a/src/objit/src/expr/ob_llvm_type.h b/src/objit/src/expr/ob_llvm_type.h index 896feb97d..abf6a8f7a 100644 --- a/src/objit/src/expr/ob_llvm_type.h +++ b/src/objit/src/expr/ob_llvm_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_LLVM_TYPE_H @@ -116,10 +120,9 @@ typedef ::llvm::DILocation ObDILocation; //return ret; /*}*/ - -//在code gen过程中,如果使用ir struct传递Obj, 需要增加GEP操作, -//ir代码会不好看,另一方面也会增加一定开销 -//该思路参考论文3.2节 +// During the code gen process, if using ir struct to pass Obj, need to add GEP operation, +// ir code will not look good, on the other hand it will also increase certain overhead +// This idea references the paper Section 3.2 class ObIRObj { public: const static int OBJ_IDX_TYPE = 0; @@ -136,9 +139,9 @@ class ObIRObj { {} void reset(); - //在执行期, 接口type表示该column在schema中类型, - //row 中Obj类型可能与type不一样, 比如Obj可能为T_NULL, - //而column的type可能为其他类型, 因此在接口中显示给定type + // At execution time, the interface type indicates the type of this column in the schema, + // row Obj type may be different from type, for example, Obj may be T_NULL, + // while the type of column may be other types, therefore display the given type in the interface void set_type(ObLLVMContext &ctx, const ::oceanbase::common::ObObjType type) { @@ -168,7 +171,7 @@ class ObIRObj { value, is_sign)); } - //从ObObj的ir对象中获取其成员 + // Get its member from the ir object of ObObj static ObIRValuePtr get_ir_value_element(core::JitContext &jc, const ObIRValuePtr obj, int64_t idx); diff --git a/src/objit/src/expr/string_cmp.cpp b/src/objit/src/expr/string_cmp.cpp index c14875783..590d5b265 100644 --- a/src/objit/src/expr/string_cmp.cpp +++ b/src/objit/src/expr/string_cmp.cpp @@ -1763,7 +1763,7 @@ int64_t jit_strcmpsp(const char *str1, //so no need to do it again. why bother yourself ? Just use it ! // //ob_ctype_utf8.c - //实际调用ob_strnncollsp_utf8mb4 + // Actual call to ob_strnncollsp_utf8mb4 result = (int64_t)ob_strnncollsp_utf8mb4(reinterpret_cast(str1), str1_len, reinterpret_cast(str2), diff --git a/src/objit/src/expr/string_cmp.h b/src/objit/src/expr/string_cmp.h index 29b1e6fa4..7d059dde7 100644 --- a/src/objit/src/expr/string_cmp.h +++ b/src/objit/src/expr/string_cmp.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef EXPRJ_STRING_CMP_H diff --git a/src/objit/src/ob_llvm_helper.cpp b/src/objit/src/ob_llvm_helper.cpp index 86e9b0f74..5ce5c93a4 100644 --- a/src/objit/src/ob_llvm_helper.cpp +++ b/src/objit/src/ob_llvm_helper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL diff --git a/src/objit/src/ob_llvm_symbolizer.cpp b/src/objit/src/ob_llvm_symbolizer.cpp index b5d29f288..7c6b6c75e 100644 --- a/src/objit/src/ob_llvm_symbolizer.cpp +++ b/src/objit/src/ob_llvm_symbolizer.cpp @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef ENABLE_SANITY diff --git a/src/observer/CMakeLists.txt b/src/observer/CMakeLists.txt index c50f9a54b..83d1fa415 100644 --- a/src/observer/CMakeLists.txt +++ b/src/observer/CMakeLists.txt @@ -122,7 +122,6 @@ ob_set_subtarget(ob_server omt omt/ob_multi_tenant.cpp omt/ob_retry_queue.cpp omt/ob_tenant.cpp - omt/ob_tenant_config.cpp omt/ob_tenant_config_mgr.cpp omt/ob_tenant_meta.cpp omt/ob_tenant_node_balancer.cpp @@ -132,6 +131,7 @@ ob_set_subtarget(ob_server omt omt/ob_worker_processor.cpp omt/ob_multi_tenant_operator.cpp omt/ob_tenant_srs.cpp + omt/ob_tenant_ai_service.cpp ) ob_set_subtarget(ob_server table @@ -486,7 +486,6 @@ ob_set_subtarget(ob_server virtual_table virtual_table/ob_all_virtual_tenant_ctx_memory_info.cpp virtual_table/ob_all_virtual_tenant_memory_info.cpp virtual_table/ob_all_virtual_tenant_memstore_allocator_info.cpp - virtual_table/ob_all_virtual_tenant_parameter_info.cpp virtual_table/ob_all_virtual_tenant_parameter_stat.cpp virtual_table/ob_all_virtual_tx_stat.cpp virtual_table/ob_all_virtual_tx_lock_stat.cpp @@ -661,7 +660,7 @@ if (NOT OB_USE_ASAN) set(link_malloc_hook malloc_hook) endif() -add_library(ob_main OBJECT main.cpp) +add_library(ob_main OBJECT main.cpp ob_command_line_parser.cpp) config_ccls_flag(ob_main) target_link_libraries(ob_main PUBLIC ob_base) add_executable(observer_without_bolt) @@ -718,10 +717,4 @@ endif() configure_file(../share/ob_version.cpp.in ob_version.cpp) -message(STATUS "dump config item") -add_custom_command(TARGET observer POST_BUILD -COMMAND ${CMAKE_BINARY_DIR}/src/observer/observer -C -WORKING_DIRECTORY ${CMAKE_BINARY_DIR} -) - add_subdirectory(embed) diff --git a/src/observer/dbms_job/ob_dbms_job_executor.cpp b/src/observer/dbms_job/ob_dbms_job_executor.cpp index b628159ca..40d3c167d 100644 --- a/src/observer/dbms_job/ob_dbms_job_executor.cpp +++ b/src/observer/dbms_job/ob_dbms_job_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/dbms_job/ob_dbms_job_executor.h b/src/observer/dbms_job/ob_dbms_job_executor.h index 5232d6a94..a7a8c7c64 100644 --- a/src/observer/dbms_job/ob_dbms_job_executor.h +++ b/src/observer/dbms_job/ob_dbms_job_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_DBMS_JOB_EXECUTOR_H_ diff --git a/src/observer/dbms_job/ob_dbms_job_master.cpp b/src/observer/dbms_job/ob_dbms_job_master.cpp index 0a04ab866..64759300d 100644 --- a/src/observer/dbms_job/ob_dbms_job_master.cpp +++ b/src/observer/dbms_job/ob_dbms_job_master.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RS diff --git a/src/observer/dbms_job/ob_dbms_job_master.h b/src/observer/dbms_job/ob_dbms_job_master.h index 3f54d3e02..6b370716e 100644 --- a/src/observer/dbms_job/ob_dbms_job_master.h +++ b/src/observer/dbms_job/ob_dbms_job_master.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_OB_DBMS_JOB_MASTER_H_ diff --git a/src/observer/dbms_job/ob_dbms_job_rpc_processor.cpp b/src/observer/dbms_job/ob_dbms_job_rpc_processor.cpp index 4ff3817a4..7bf19b3db 100644 --- a/src/observer/dbms_job/ob_dbms_job_rpc_processor.cpp +++ b/src/observer/dbms_job/ob_dbms_job_rpc_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/dbms_job/ob_dbms_job_rpc_processor.h b/src/observer/dbms_job/ob_dbms_job_rpc_processor.h index e4fca6c48..8e7e06384 100644 --- a/src/observer/dbms_job/ob_dbms_job_rpc_processor.h +++ b/src/observer/dbms_job/ob_dbms_job_rpc_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_DBMS_JOB_RPC_PROCESSOR_H_ diff --git a/src/observer/dbms_job/ob_dbms_job_rpc_proxy.cpp b/src/observer/dbms_job/ob_dbms_job_rpc_proxy.cpp index 1530017fa..fe3837360 100644 --- a/src/observer/dbms_job/ob_dbms_job_rpc_proxy.cpp +++ b/src/observer/dbms_job/ob_dbms_job_rpc_proxy.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/dbms_job/ob_dbms_job_rpc_proxy.h b/src/observer/dbms_job/ob_dbms_job_rpc_proxy.h index 833c31868..d8083904f 100644 --- a/src/observer/dbms_job/ob_dbms_job_rpc_proxy.h +++ b/src/observer/dbms_job/ob_dbms_job_rpc_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_DBMS_JOB_RPC_PROXY_H_ diff --git a/src/observer/dbms_job/ob_dbms_job_utils.cpp b/src/observer/dbms_job/ob_dbms_job_utils.cpp index 4d0aedc5c..7b3cc679f 100644 --- a/src/observer/dbms_job/ob_dbms_job_utils.cpp +++ b/src/observer/dbms_job/ob_dbms_job_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RS diff --git a/src/observer/dbms_job/ob_dbms_job_utils.h b/src/observer/dbms_job/ob_dbms_job_utils.h index 4ab893c86..07b88acdc 100644 --- a/src/observer/dbms_job/ob_dbms_job_utils.h +++ b/src/observer/dbms_job/ob_dbms_job_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_DBMS_JOB_UTILS_H_ diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_func_type.h b/src/observer/dbms_scheduler/ob_dbms_sched_func_type.h index 2108c8f42..5b1a3942d 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_func_type.h +++ b/src/observer/dbms_scheduler/ob_dbms_sched_func_type.h @@ -1,23 +1,27 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ -FUNCTION_TYPE(MVIEW_JOB) //物化视图 -FUNCTION_TYPE(STAT_MAINTENANCE_JOB, SHADOW) //统计信息 -FUNCTION_TYPE(OLAP_ASYNC_JOB) //olap异步任务 +FUNCTION_TYPE(MVIEW_JOB) //materialized view +FUNCTION_TYPE(STAT_MAINTENANCE_JOB, SHADOW) //Statistics information +FUNCTION_TYPE(OLAP_ASYNC_JOB) //olap asynchronous job FUNCTION_TYPE(MYSQL_EVENT_JOB) //mysql_event -FUNCTION_TYPE(NODE_BALANCE_JOB, SHADOW) //负载均衡 -FUNCTION_TYPE(EXT_FILE_REFRESH_JOB, SHADOW) //外表刷新 -FUNCTION_TYPE(VECTOR_INDEX_REFRESH_JOB, SHADOW) //向量索引刷新 -FUNCTION_TYPE(DATA_DICT_DUMP_JOB, SHADOW) //数据字典dump -FUNCTION_TYPE(FLUSH_NCOMP_DLL_JOB, SHADOW) //刷新ncomp_dll -FUNCTION_TYPE(POLLING_ASK_JOB_FOR_PL_RECOMPILE, SHADOW) //轮询检查是否需要开启pl重编译任务 -FUNCTION_TYPE(DYNAMIC_PARTITION_MANAGE_JOB, SHADOW) //定时动态分区管理 \ No newline at end of file +FUNCTION_TYPE(NODE_BALANCE_JOB, SHADOW) //load balancing +FUNCTION_TYPE(EXT_FILE_REFRESH_JOB, SHADOW) //external table refresh +FUNCTION_TYPE(VECTOR_INDEX_REFRESH_JOB, SHADOW) //vector index refresh +FUNCTION_TYPE(DATA_DICT_DUMP_JOB, SHADOW) //data dictionary dump +FUNCTION_TYPE(FLUSH_NCOMP_DLL_JOB, SHADOW) // flush ncomp dll +FUNCTION_TYPE(POLLING_ASK_JOB_FOR_PL_RECOMPILE, SHADOW) // Polling check if PL recompile task needs to be started +FUNCTION_TYPE(DYNAMIC_PARTITION_MANAGE_JOB, SHADOW) // Scheduled dynamic partition management diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_job_executor.cpp b/src/observer/dbms_scheduler/ob_dbms_sched_job_executor.cpp index 6ce677937..3243992cd 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_job_executor.cpp +++ b/src/observer/dbms_scheduler/ob_dbms_sched_job_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_job_executor.h b/src/observer/dbms_scheduler/ob_dbms_sched_job_executor.h index 436468356..12bb79673 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_job_executor.h +++ b/src/observer/dbms_scheduler/ob_dbms_sched_job_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_DBMS_SCHED_JOB_EXECUTOR_H_ diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_job_master.cpp b/src/observer/dbms_scheduler/ob_dbms_sched_job_master.cpp index 3dd0574a2..2130f8dec 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_job_master.cpp +++ b/src/observer/dbms_scheduler/ob_dbms_sched_job_master.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_job_master.h b/src/observer/dbms_scheduler/ob_dbms_sched_job_master.h index deb3894ef..c19e539f3 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_job_master.h +++ b/src/observer/dbms_scheduler/ob_dbms_sched_job_master.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_OB_DBMS_SCHED_JOB_MASTER_H_ diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_job_rpc_processor.cpp b/src/observer/dbms_scheduler/ob_dbms_sched_job_rpc_processor.cpp index a96549585..962ad328c 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_job_rpc_processor.cpp +++ b/src/observer/dbms_scheduler/ob_dbms_sched_job_rpc_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_job_rpc_processor.h b/src/observer/dbms_scheduler/ob_dbms_sched_job_rpc_processor.h index fc724de81..a615b635a 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_job_rpc_processor.h +++ b/src/observer/dbms_scheduler/ob_dbms_sched_job_rpc_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_DBMS_SCHED_JOB_RPC_PROCESSOR_H_ diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_job_rpc_proxy.cpp b/src/observer/dbms_scheduler/ob_dbms_sched_job_rpc_proxy.cpp index df25dfa67..e6ccf5938 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_job_rpc_proxy.cpp +++ b/src/observer/dbms_scheduler/ob_dbms_sched_job_rpc_proxy.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_job_rpc_proxy.h b/src/observer/dbms_scheduler/ob_dbms_sched_job_rpc_proxy.h index bc23e7448..20ea937a3 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_job_rpc_proxy.h +++ b/src/observer/dbms_scheduler/ob_dbms_sched_job_rpc_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_DBMS_SCHED_JOB_RPC_PROXY_H_ diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_job_utils.cpp b/src/observer/dbms_scheduler/ob_dbms_sched_job_utils.cpp index 423de9659..cd2dd44ba 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_job_utils.cpp +++ b/src/observer/dbms_scheduler/ob_dbms_sched_job_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -290,7 +294,7 @@ int ObDBMSSchedJobInfo::deep_copy(ObIAllocator &allocator, const ObDBMSSchedJobI OZ (ob_write_string(allocator, other.job_type_, job_type_)); OZ (ob_write_string(allocator, other.this_exec_addr_, this_exec_addr_)); OZ (ob_write_string(allocator, other.this_exec_trace_id_, this_exec_trace_id_)); - //处理存在兼容性问题的列 + //Handle columns with compatibility issues //job style OZ (ob_write_string(allocator, "REGULAR", job_style_)); @@ -778,18 +782,18 @@ int ObDBMSSchedJobUtils::check_dbms_sched_job_priv(const ObUserInfo *user_info, LOG_WARN("user info is NULL", KR(ret)); } else if (is_ora_sys_user(user_info->get_user_id()) || is_root_user(user_info->get_user_id())) { // do nothing - } else if (job_info.user_id_ != OB_INVALID_ID) { //如果 job 有 user_id 优先使用 + } else if (job_info.user_id_ != OB_INVALID_ID) { // If the job has a user_id, prioritize its use if (job_info.user_id_ != user_info->get_user_id()) { ret = OB_ERR_NO_PRIVILEGE; LOG_WARN("job user id check failed", KR(ret), K(user_info), K(job_info.user_id_)); } } else if (is_oracle_tenant) { - if (0 != job_info.powner_.case_compare(user_info->get_user_name())) { // job 的 owner 和 输入的 user 不一致 + if (0 != job_info.powner_.case_compare(user_info->get_user_name())) { // the owner of the job and the input user are inconsistent ret = OB_ERR_NO_PRIVILEGE; LOG_WARN("oracle check job owner failed", KR(ret), K(user_info), K(job_info.user_id_)); } } else { - if (0 != job_info.powner_.case_compare(user_info->get_user_name())) { // job 保存的 owner 可能是 root@% or root (旧) + if (0 != job_info.powner_.case_compare(user_info->get_user_name())) { // job saved owner might be root@% or root (old) const char *c = job_info.powner_.reverse_find('@'); if (OB_ISNULL(c)) { ret = OB_ERR_NO_PRIVILEGE; @@ -817,12 +821,12 @@ int ObDBMSSchedJobUtils::calc_dbms_sched_repeat_expr(const ObDBMSSchedJobInfo &j int64_t repeat_num = 0; int64_t freq_num = 0; const int64_t now = ObTimeUtility::current_time(); - //处理旧job + //Handle old job if (job_info.interval_ts_ > 0) { int64_t N = (now - job_info.start_date_) / job_info.interval_ts_; next_run_time = job_info.start_date_ + (N + 1) * job_info.interval_ts_; } else if (job_info.repeat_interval_.empty() || 0 == job_info.repeat_interval_.case_compare("null")) { - if (now < job_info.start_date_) { //job 未开始 + if (now < job_info.start_date_) { // job has not started next_run_time = job_info.start_date_; } else { next_run_time = ObDBMSSchedJobInfo::DEFAULT_MAX_END_DATE; @@ -836,12 +840,12 @@ int ObDBMSSchedJobUtils::calc_dbms_sched_repeat_expr(const ObDBMSSchedJobInfo &j const int MAX_REPTAT_NUM_LEN = 16; if (!repeat_num_str.is_numeric() || MAX_REPTAT_NUM_LEN <= repeat_num_str.length()) { - next_run_time = ObDBMSSchedJobInfo::DEFAULT_MAX_END_DATE; //非数字/数字太大 + next_run_time = ObDBMSSchedJobInfo::DEFAULT_MAX_END_DATE; //non-numeric/number too large } else { char repeat_num_buf[MAX_REPTAT_NUM_LEN]; int64_t pos = repeat_num_str.to_string(repeat_num_buf, MAX_REPTAT_NUM_LEN); repeat_num = atoll(repeat_num_buf); - if (0 >= repeat_num) { //未加参数检查前的 job 可能会有这种错误 + if (0 >= repeat_num) { //The job might have this error before parameter checking was added next_run_time = ObDBMSSchedJobInfo::DEFAULT_MAX_END_DATE; } else { if (0 != freq_str.case_compare("FREQ")) { @@ -867,19 +871,19 @@ int ObDBMSSchedJobUtils::calc_dbms_sched_repeat_expr(const ObDBMSSchedJobInfo &j } if (OB_SUCC(ret)) { - if (INT64_MAX / repeat_num < freq_num * 1000000LL) { //乘法溢出处理 + if (INT64_MAX / repeat_num < freq_num * 1000000LL) { // multiplication overflow handling next_run_time = ObDBMSSchedJobInfo::DEFAULT_MAX_END_DATE; } else { int64_t repeat_interval_ts = repeat_num * freq_num * 1000000LL; int64_t N = (now - job_info.start_date_) / repeat_interval_ts; int64_t increment = (N + 1) * repeat_interval_ts; next_run_time = increment + job_info.start_date_; - if (next_run_time < increment || next_run_time < job_info.start_date_) { //加法溢出处理 + if (next_run_time < increment || next_run_time < job_info.start_date_) { // overflow handling for addition next_run_time = ObDBMSSchedJobInfo::DEFAULT_MAX_END_DATE; } else if (ObDBMSSchedJobInfo::DEFAULT_MAX_END_DATE <= next_run_time) { next_run_time = ObDBMSSchedJobInfo::DEFAULT_MAX_END_DATE; } else { - //未开始执行时,重新计算下次执行时间应该还是 start_date + //When not yet executed, recalculating the next execution time should still be start_date next_run_time = max(next_run_time, job_info.start_date_); } } diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_job_utils.h b/src/observer/dbms_scheduler/ob_dbms_sched_job_utils.h index 748fa117a..3e0f4064c 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_job_utils.h +++ b/src/observer/dbms_scheduler/ob_dbms_sched_job_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_DBMS_SCHED_JOB_UTILS_H_ @@ -344,124 +348,122 @@ class ObDBMSSchedJobUtils { public: /** - * @brief 检查是否有效的 sql name + * @brief Check if the sql name is valid * @param [in] name - sql name * @retval OB_SUCCESS execute success - * @retval OB_ERR_ILLEGAL_NAME 不合法的命名 + * @retval OB_ERR_ILLEGAL_NAME illegal name */ static int check_is_valid_name(const ObString &name); /** - * @brief 检查是否有效的 job style + * @brief Check if the job style is valid * @param [in] str - job style * @retval OB_SUCCESS execute success - * @retval OB_NOT_SUPPORTED 不支持 + * @retval OB_NOT_SUPPORTED not supported */ static int check_is_valid_job_style(const ObString &str); /** - * @brief 检查是否有效的 job type + * @brief Check if the job type is valid * @param [in] str - job type * @retval OB_SUCCESS execute success - * @retval OB_NOT_SUPPORTED 不支持 + * @retval OB_NOT_SUPPORTED not supported */ static int check_is_valid_job_type(const ObString &str); /** - * @brief 检查是否有效的 job argument num + * @brief Check if the job argument num is valid * @param [in] num * @retval OB_SUCCESS execute success - * @retval OB_NOT_SUPPORTED 不支持 + * @retval OB_NOT_SUPPORTED not supported */ static int check_is_valid_argument_num(const int64_t num); /** - * @brief 检查是否有效的 sched_type + * @brief Check if the sched_type is valid * @param [in] str - sched_type * @retval OB_SUCCESS execute success - * @retval OB_NOT_SUPPORTED 不支持 + * @retval OB_NOT_SUPPORTED not supported */ /** - * @brief 检查是否有效的 state + * @brief Check if the state is valid * @param [in] str - state * @retval OB_SUCCESS execute success - * @retval OB_NOT_SUPPORTED 不支持 + * @retval OB_NOT_SUPPORTED not supported */ static int check_is_valid_state(const ObString &str); /** - * @brief 检查是否有效的 end_date + * @brief Check if the end_date is valid * @param [in] start_date * @param [in] end_date * @retval OB_SUCCESS execute success - * @retval OB_NOT_SUPPORTED 不支持的时间 + * @retval OB_NOT_SUPPORTED unsupported time */ static int check_is_valid_end_date(const int64_t start_date, const int64_t end_date); /** - * @brief 检查是否有效的 repeat interval + * @brief Check if the repeat interval is valid * @param [in] str repeat_interval * @retval OB_SUCCESS execute success - * @retval OB_NOT_SUPPORTED 不支持 + * @retval OB_NOT_SUPPORTED not supported */ static int check_is_valid_repeat_interval(const ObString &str, bool is_limit_interval_num = false); /** - * @brief 检查是否有效的 max_run_duration + * @brief Check if max_run_duration is valid * @param [in] max_run_duration * @retval OB_SUCCESS execute success - * @retval OB_INVALID_ARGUMENT_NUM interval_num 超出范围 - * @retval OB_NOT_SUPPORTED 语法不支持 + * @retval OB_INVALID_ARGUMENT_NUM interval_num out of range + * @retval OB_NOT_SUPPORTED syntax not supported */ static int check_is_valid_max_run_duration(const int64_t max_run_duration); - - - //TO DO DELETE 连雨 + //TO DO DELETE continuous rain static int generate_job_id(int64_t tenant_id, int64_t &max_job_id); /** - * @brief 创建一个 job + * @brief Create a job * @param [in] sql_client - * @param [in] tenant_id - 租户id - * @param [in] job_id - job_id + * @param [in] tenant_id - tenant id + * @param [in] job_id - job id * @retval OB_SUCCESS execute success - * @retval OB_ERR_UNEXPECTED 未知错误 - * @retval OB_INVALID_ARGUMENT 当前 JOB 不存在 - * @retval OB_ERR_NO_PRIVILEGE 当前 JOB 传入的用户没有权限修改 + * @retval OB_ERR_UNEXPECTED unknown error + * @retval OB_INVALID_ARGUMENT current JOB does not exist + * @retval OB_ERR_NO_PRIVILEGE the user passed in for the current JOB does not have permission to modify */ static int create_dbms_sched_job(common::ObISQLClient &sql_client, const uint64_t tenant_id, const int64_t job_id, const ObDBMSSchedJobInfo &job_info); /** - * @brief 直接删除一个 job + * @brief Directly delete a job * @param [in] sql_client - * @param [in] tenant_id - 租户id - * @param [in] job_name - job名 - * @param [in] if_exists - 为 true (删除一个不存在 JOB 会报错) + * @param [in] tenant_id - tenant id + * @param [in] job_name - job name + * @param [in] if_exists - if true (deleting a non-existent JOB will result in an error) * @retval OB_SUCCESS execute success - * @retval OB_ERR_UNEXPECTED 未知错误 - * @retval OB_INVALID_ARGUMENT 当前 JOB 不存在 + * @retval OB_ERR_UNEXPECTED unknown error + * @retval OB_INVALID_ARGUMENT current JOB does not exist */ static int remove_dbms_sched_job(common::ObISQLClient &sql_client, const uint64_t tenant_id, const common::ObString &job_name, const bool if_exists = false); /** - * @brief 停止一个 未开始/正在运行的 job + * @brief Stop a job that has not started/running * @param [in] sql_client - * @param [in] is_delete_after_stop - 停止后是否删除 - * @param [in] job_info - 要停止的 job 信息 + * @param [in] is_delete_after_stop - Whether to delete after stopping + * @param [in] job_info - Information of the job to stop * @retval OB_SUCCESS execute success - * @retval OB_NOT_SUPPORTED 当前版本不支持 - * @retval OB_ERR_UNEXPECTED 未知错误 - * @retval OB_ENTRY_NOT_EXIST 当前 JOB 不在运行 - * @retval OB_ERR_NO_PRIVILEGE 当前 JOB 传入的用户没有权限修改 + * @retval OB_NOT_SUPPORTED Not supported in the current version + * @retval OB_ERR_UNEXPECTED Unknown error + * @retval OB_ENTRY_NOT_EXIST The current JOB is not running + * @retval OB_ERR_NO_PRIVILEGE The user provided for the current JOB does not have permission to modify */ static int stop_dbms_sched_job(common::ObISQLClient &sql_client, const ObDBMSSchedJobInfo &job_info, const bool is_delete_after_stop); /** - * @brief 更新 JOB 信息 + * @brief Update JOB information * @param [in] job_info - * @param [in] job_attribute_name - 要更新的 job 列 - * @param [in] job_attribute_value - 要更新的列 value + * @param [in] job_attribute_name - The job column to be updated + * @param [in] job_attribute_value - The value of the column to be updated * @retval OB_SUCCESS execute success - * @retval OB_ERR_UNEXPECTED 未知错误 - * @retval OB_INVALID_ARGUMENT 无效参数 - * @retval OB_ENTRY_NOT_EXIST JOB 不存在/没做更改 + * @retval OB_ERR_UNEXPECTED unknown error + * @retval OB_INVALID_ARGUMENT invalid argument + * @retval OB_ENTRY_NOT_EXIST JOB does not exist/no changes made */ static int update_dbms_sched_job_info(common::ObISQLClient &sql_client, const ObDBMSSchedJobInfo &job_info, @@ -469,15 +471,15 @@ class ObDBMSSchedJobUtils const ObObj &job_attribute_value, const bool from_pl_set_attr = false); /** - * @brief 获取 JOB 信息 - * @param [in] tenant_id - 租户id - * @param [in] is_oracle_tenant - 是否 oracle 租户, 内部表没有的值, 由调用者确定 - * @param [in] job_name - job名 - * @param [in] allocator - 合理的 allocator, 防止 job_info 失效 - * @param [in] job_info - job 信息 + * @brief Get JOB information + * @param [in] tenant_id - tenant id + * @param [in] is_oracle_tenant - whether it is an oracle tenant, internal table does not have this value, determined by the caller + * @param [in] job_name - job name + * @param [in] allocator - reasonable allocator, to prevent job_info from becoming invalid + * @param [in] job_info - job information * @retval OB_SUCCESS execute success - * @retval OB_ERR_UNEXPECTED 未知错误 - * @retval OB_ENTRY_NOT_EXIST JOB 不存在 + * @retval OB_ERR_UNEXPECTED unknown error + * @retval OB_ENTRY_NOT_EXIST JOB does not exist */ static int get_dbms_sched_job_info(common::ObISQLClient &sql_client, const uint64_t tenant_id, @@ -486,29 +488,29 @@ class ObDBMSSchedJobUtils common::ObIAllocator &allocator, ObDBMSSchedJobInfo &job_info); /** - * @brief 检查用户是否有修改 JOB 的权限(策略, root 用户能修改所有 job, 普通用户只能修改自己的 job) - * @param [in] user_info - 用户信息 - * @param [in] job_info - job 信息 + * @brief Check if the user has permission to modify the JOB (policy: root user can modify all jobs, ordinary users can only modify their own jobs) + * @param [in] user_info - User information + * @param [in] job_info - Job information * @retval OB_SUCCESS execute success - * @retval OB_ERR_UNEXPECTED 未知错误 - * @retval OB_INVALID_ARGUMENT 无效参数/ user_info 为 NULL - * @retval OB_ERR_NO_PRIVILEGE 传入用户没有权限 + * @retval OB_ERR_UNEXPECTED unknown error + * @retval OB_INVALID_ARGUMENT invalid argument/ user_info is NULL + * @retval OB_ERR_NO_PRIVILEGE the input user does not have permission */ static int check_dbms_sched_job_priv(const share::schema::ObUserInfo *user_info, const ObDBMSSchedJobInfo &job_info); /** - * @brief 计算 job 保存的时间表达式得到下一次执行的时间 - * @param [in] job_info - job 信息 + * @brief Calculate the next execution time based on the job's time expression + * @param [in] job_info - job information * @param [out] next_run_time * @retval OB_SUCCESS execute success - * @retval OB_ERR_UNEXPECTED 未知错误 - * @retval OB_INVALID_ARGUMENT 无效参数 + * @retval OB_ERR_UNEXPECTED unknown error + * @retval OB_INVALID_ARGUMENT invalid argument */ static int calc_dbms_sched_repeat_expr(const ObDBMSSchedJobInfo &job_info, int64_t &next_run_time); static int zone_check_impl(int64_t tenant_id, const ObString &zone); static int job_class_check_impl(int64_t tenant_id, const ObString &job_class_name); static int get_max_failures_value(int64_t tenant_id, const ObString &src_str, int64_t &value); - static int reserve_user_with_minimun_id(ObIArray &user_infos); //TO DO 连雨 delete + static int reserve_user_with_minimun_id(ObIArray &user_infos); // TO DO Lianyu delete }; } } diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_service.cpp b/src/observer/dbms_scheduler/ob_dbms_sched_service.cpp index ff196e943..8c2e4f423 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_service.cpp +++ b/src/observer/dbms_scheduler/ob_dbms_sched_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/dbms_scheduler/ob_dbms_sched_service.h" diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_service.h b/src/observer/dbms_scheduler/ob_dbms_sched_service.h index 5ddcad7b1..8af230cee 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_service.h +++ b/src/observer/dbms_scheduler/ob_dbms_sched_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ROOTSERVER_OB_DBMS_SCHEDULER_SERVICE_H diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_table_operator.cpp b/src/observer/dbms_scheduler/ob_dbms_sched_table_operator.cpp index 429c1b8f3..3b4e97f62 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_table_operator.cpp +++ b/src/observer/dbms_scheduler/ob_dbms_sched_table_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/dbms_scheduler/ob_dbms_sched_table_operator.h b/src/observer/dbms_scheduler/ob_dbms_sched_table_operator.h index 588f27e27..37373970c 100644 --- a/src/observer/dbms_scheduler/ob_dbms_sched_table_operator.h +++ b/src/observer/dbms_scheduler/ob_dbms_sched_table_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_DBMS_SCHED_TABLE_OPERATOR_H_ diff --git a/src/observer/embed/CMakeLists.txt b/src/observer/embed/CMakeLists.txt index 2d2f56733..38cb731af 100644 --- a/src/observer/embed/CMakeLists.txt +++ b/src/observer/embed/CMakeLists.txt @@ -1,6 +1,116 @@ if(BUILD_EMBED_MODE) - find_package(Python3 COMPONENTS Interpreter Development REQUIRED) + # Set target Python version, can be overridden by CMake parameter + if(NOT DEFINED PYTHON_VERSION) + set(PYTHON_VERSION "3.8") + endif() + set(Python3_FOUND FALSE) + + message(STATUS "Target Python version: ${PYTHON_VERSION}") + + # First try to find the specified Python version from system + message(STATUS "Searching for Python ${PYTHON_VERSION} in system first...") + find_package(Python3 ${PYTHON_VERSION} EXACT COMPONENTS Interpreter Development QUIET) + if(Python3_FOUND) + message(STATUS "Found system Python ${PYTHON_VERSION}, using it for embed module") + endif() + + # If system doesn't have the specified Python version, try to find from pyenv + if(NOT Python3_FOUND) + message(STATUS "No system Python ${PYTHON_VERSION} found, trying pyenv...") + + # Method 1: Check if pyenv version can be specified via environment variable + if(DEFINED ENV{PYENV_VERSION}) + execute_process( + COMMAND pyenv which python + OUTPUT_VARIABLE PYENV_PYTHON_PATH + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE pyenv_result + ) + if(pyenv_result EQUAL 0) + # Verify if this Python version matches the target version + execute_process( + COMMAND ${PYENV_PYTHON_PATH} --version + OUTPUT_VARIABLE PYENV_PYTHON_VERSION_OUTPUT + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(PYENV_PYTHON_VERSION_OUTPUT MATCHES "Python ${PYTHON_VERSION}") + set(Python3_EXECUTABLE ${PYENV_PYTHON_PATH}) + message(STATUS "Using pyenv Python from PYENV_VERSION: ${Python3_EXECUTABLE} (${PYENV_PYTHON_VERSION_OUTPUT})") + set(Python3_FOUND TRUE) + else() + message(STATUS "pyenv Python version mismatch: expected ${PYTHON_VERSION}, got ${PYENV_PYTHON_VERSION_OUTPUT}") + endif() + endif() + endif() + + # Method 2: Directly try to find the specified version in pyenv + if(NOT Python3_FOUND) + execute_process( + COMMAND pyenv versions --bare + OUTPUT_VARIABLE PYENV_VERSIONS + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE pyenv_versions_result + ) + if(pyenv_versions_result EQUAL 0) + # Check if there's a matching version + string(FIND "${PYENV_VERSIONS}" "${PYTHON_VERSION}" VERSION_FOUND) + if(NOT VERSION_FOUND EQUAL -1) + # Try to use the specified version by setting PYENV_VERSION environment variable + execute_process( + COMMAND bash -c "export PYENV_VERSION=${PYTHON_VERSION} && pyenv which python" + OUTPUT_VARIABLE PYENV_SPECIFIC_PYTHON_PATH + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE pyenv_specific_result + ) + if(pyenv_specific_result EQUAL 0) + # Verify the version matches + execute_process( + COMMAND ${PYENV_SPECIFIC_PYTHON_PATH} --version + OUTPUT_VARIABLE PYENV_SPECIFIC_VERSION_OUTPUT + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(PYENV_SPECIFIC_VERSION_OUTPUT MATCHES "Python ${PYTHON_VERSION}") + set(Python3_EXECUTABLE ${PYENV_SPECIFIC_PYTHON_PATH}) + message(STATUS "Using pyenv Python ${PYTHON_VERSION}: ${Python3_EXECUTABLE}") + set(Python3_FOUND TRUE) + else() + message(STATUS "Version mismatch: expected ${PYTHON_VERSION}, got ${PYENV_SPECIFIC_VERSION_OUTPUT}") + endif() + endif() + else() + message(STATUS "Python ${PYTHON_VERSION} not found in pyenv versions: ${PYENV_VERSIONS}") + endif() + endif() + endif() + + # Method 3: Directly find the specified version through PYENV_ROOT + if(NOT Python3_FOUND AND DEFINED ENV{PYENV_ROOT}) + set(PYENV_SPECIFIC_PYTHON "$ENV{PYENV_ROOT}/versions/${PYTHON_VERSION}/bin/python") + if(EXISTS ${PYENV_SPECIFIC_PYTHON}) + set(Python3_EXECUTABLE ${PYENV_SPECIFIC_PYTHON}) + message(STATUS "Using pyenv Python from PYENV_ROOT: ${Python3_EXECUTABLE}") + set(Python3_FOUND TRUE) + endif() + endif() + endif() + + # If still no suitable Python version found, error and exit + if(NOT Python3_FOUND) + message(FATAL_ERROR "No suitable Python ${PYTHON_VERSION} found. Please install Python ${PYTHON_VERSION} or configure pyenv with Python ${PYTHON_VERSION}.") + endif() + + # Verify the final Python choice + if(Python3_EXECUTABLE) + execute_process( + COMMAND ${Python3_EXECUTABLE} --version + OUTPUT_VARIABLE PYTHON_VERSION_OUTPUT + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + message(STATUS "Final Python choice: ${Python3_EXECUTABLE} (${PYTHON_VERSION_OUTPUT})") + endif() + + message(STATUS "Building embed module with Python ${Python3_EXECUTABLE}") execute_process( COMMAND "${Python3_EXECUTABLE}" -c "import pybind11; print(pybind11.get_cmake_dir())" @@ -40,11 +150,13 @@ if(BUILD_EMBED_MODE) message(STATUS "pybind11 version: ${pybind11_VERSION}") pybind11_add_module(oblite NO_EXTRAS python/ob_embed_impl.cpp) + set_target_properties(oblite PROPERTIES PREFIX "" SUFFIX ".so" OUTPUT_NAME "oblite" ) + target_link_libraries(oblite PUBLIC oceanbase_static -static-libgcc diff --git a/src/observer/embed/python/ob_embed_impl.cpp b/src/observer/embed/python/ob_embed_impl.cpp index 52773c28d..b0cc26439 100644 --- a/src/observer/embed/python/ob_embed_impl.cpp +++ b/src/observer/embed/python/ob_embed_impl.cpp @@ -1,14 +1,18 @@ -/** -* Copyright (c) 2021 OceanBase -* OceanBase CE is licensed under Mulan PubL v2. -* You can use this software according to the terms and conditions of the Mulan PubL v2. -* You may obtain a copy of Mulan PubL v2 at: -* http://license.coscl.org.cn/MulanPubL-2.0 -* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -* See the Mulan PubL v2 for more details. -*/ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define USING_LOG_PREFIX SERVER #include #include @@ -16,16 +20,21 @@ #include "observer/ob_server.h" #include "rpc/obrpc/ob_net_client.h" #include "observer/ob_inner_sql_result.h" - +#include "observer/ob_server_options.h" +#include "lib/string/ob_string.h" +#include "common/ob_version_def.h" +#include "lib/oblog/ob_warning_buffer.h" PYBIND11_MODULE(oblite, m) { m.doc() = "oblite embed pybind"; + char embed_version_str[oceanbase::common::OB_SERVER_VERSION_LENGTH]; + oceanbase::common::VersionUtil::print_version_str(embed_version_str, sizeof(embed_version_str), DATA_CURRENT_VERSION); + m.attr("__version__") = embed_version_str; m.def("open", &oceanbase::embed::ObLiteEmbed::open, pybind11::arg("db_dir") = "./oblite.db", "open db"); m.def("connect", &oceanbase::embed::ObLiteEmbed::connect, pybind11::arg("db_name") = "test", - pybind11::arg("autocommit") = false, "connect db"); pybind11::class_(m, "ObLiteiEmbedCursor") .def("execute", &oceanbase::embed::ObLiteEmbedCursor::execute, pybind11::call_guard()) .def("fetchone", &oceanbase::embed::ObLiteEmbedCursor::fetchone) - .def("fetchall", &oceanbase::embed::ObLiteEmbedCursor::fetchall); + .def("fetchall", &oceanbase::embed::ObLiteEmbedCursor::fetchall) + .def("close", &oceanbase::embed::ObLiteEmbedCursor::close); pybind11::object atexit = pybind11::module::import("atexit"); atexit.attr("register")(pybind11::cpp_function(oceanbase::embed::ObLiteEmbed::close)); @@ -51,6 +61,9 @@ namespace oceanbase namespace embed { +using namespace oceanbase::common; +using namespace oceanbase::observer; + static pybind11::object decimal_module = pybind11::module::import("decimal"); static pybind11::object decimal_class = decimal_module.attr("Decimal"); static pybind11::object datetime_module = pybind11::module::import("datetime"); @@ -58,14 +71,29 @@ static pybind11::object datetime_class = datetime_module.attr("datetime"); static pybind11::object fromtimestamp = datetime_class.attr("fromtimestamp"); static pybind11::object date_class = datetime_module.attr("date"); static pybind11::object timedelta_class = datetime_module.attr("timedelta"); - -std::string ObLiteEmbed::rs_list_; -std::string ObLiteEmbed::opts_; -std::string ObLiteEmbed::data_abs_dir_; -std::thread ObLiteEmbed::th_; +static pybind11::module builtins = pybind11::module::import("builtins"); #define MPRINT(format, ...) fprintf(stderr, format "\n", ##__VA_ARGS__) +ObSqlString pid_file_name; +bool pid_locked = false; + +static int to_absolute_path(const char *cwd, ObSqlString &dir) +{ + int ret = OB_SUCCESS; + if (!dir.empty() && dir.ptr()[0] != '\0' && dir.ptr()[0] != '/') { + char abs_path[OB_MAX_FILE_NAME_LENGTH] = {0}; + // realpath will fail if the directory does not exist, so construct absolute path manually + if (snprintf(abs_path, sizeof(abs_path), "%s/%s", cwd, dir.ptr()) >= static_cast(sizeof(abs_path))) { + MPRINT("Absolute path is too long."); + ret = OB_SIZE_OVERFLOW; + } else if (OB_FAIL(dir.assign(abs_path))) { + MPRINT("[Maybe Memory Error] Failed to assign absolute path. Please try again."); + } + } + return ret; +} + void ObLiteEmbed::open(const char* db_dir) { int ret = OB_SUCCESS; @@ -86,65 +114,69 @@ void ObLiteEmbed::open(const char* db_dir) } } if (OB_FAIL(ret)) { - throw std::runtime_error("open oblite failed error code: " + std::to_string(ret)); + throw std::runtime_error("open oblite failed " + std::to_string(ob_errpkt_errno(ret, false)) + " " + std::string(ob_errpkt_strerror(ret, false))); } + // TODO promise service ready + omt::ObTenantNodeBalancer::get_instance().handle(); } int ObLiteEmbed::do_open_(const char* db_dir) { int ret = OB_SUCCESS; - GCONF._enable_async_load_sys_package = true; - GCONF.syslog_io_bandwidth_limit.set_value("10240MB"); - GCONF._enable_new_sql_nio = false; - GCONF.internal_sql_execute_timeout.set_value("48h"); - // TODO defaut opts ObServerOptions opts; - opts.cluster_id_ = 1; - opts.rpc_port_ = 11001; - opts.mysql_port_ = 11002; - opts.zone_ = "zone1"; - opts.appname_ = "test_ob"; - rs_list_ = "127.0.0.1:" + std::to_string(opts.rpc_port_) + ":" + std::to_string(opts.mysql_port_); - opts.rs_list_ = rs_list_.c_str(); - const char* log_disk_size = "3G"; - const char* memory_limit = "5G"; - const char* datafile_size = "10G"; - opts_ = "log_disk_size=" + std::string(log_disk_size) + ",memory_limit=" + std::string(memory_limit) + ",cache_wash_threshold=1G,net_thread_count=4,cpu_count=16,schema_history_expire_time=1d,workers_per_cpu_quota=10,datafile_disk_percentage=2,__min_full_resource_pool_memory=1073741824,system_memory=5G,trace_log_slow_query_watermark=100ms,datafile_size=" + std::string(datafile_size) +",stack_size=512K"; - opts.optstr_ = opts_.c_str(); + opts.port_ = 11002; opts.use_ipv6_ = false; opts.embed_mode_ = true; - bool clog_exist = false; - bool clog_empty = true; - bool need_bootstrap = false; + bool redo_exist = false; + bool redo_empty = true; char buffer[PATH_MAX]; - std::string work_abs_dir; - std::string db_abs_dir; + ObSqlString work_abs_dir; + ObSqlString slog_dir; + ObSqlString sstable_dir; + int64_t start_time = ObTimeUtility::current_time(); + ObWarningBuffer::set_warn_log_on(true); if (getcwd(buffer, sizeof(buffer)) == nullptr) { - MPRINT("getcwd failed %d %d", errno, strerror(errno)); - } else if (FALSE_IT(work_abs_dir = std::string(buffer))) { - } else if (OB_FAIL(FileDirectoryUtils::is_exists((std::string(db_dir) + "/store/clog").c_str(), clog_exist))) { + MPRINT("getcwd failed %d %s", errno, strerror(errno)); + } else if (FALSE_IT(work_abs_dir.assign(buffer))) { + } else if (OB_FAIL(opts.base_dir_.assign(db_dir))) { + MPRINT("assign base dir failed %d", ret); + } else if (OB_FAIL(opts.data_dir_.assign_fmt("%s/store", opts.base_dir_.ptr()))) { + MPRINT("assign data dir failed %d", ret); + } else if (OB_FAIL(opts.redo_dir_.assign_fmt("%s/store/redo", opts.data_dir_.ptr()))) { + MPRINT("assign redo dir failed %d", ret); + } else if (OB_FAIL(to_absolute_path(work_abs_dir.ptr(), opts.base_dir_))) { + MPRINT("get base dir absolute path failed %d", ret); + } else if (OB_FAIL(to_absolute_path(work_abs_dir.ptr(), opts.data_dir_))) { + MPRINT("get data dir absolute path failed %d", ret); + } else if (OB_FAIL(to_absolute_path(work_abs_dir.ptr(), opts.redo_dir_))) { + MPRINT("get redo dir absolute path failed %d", ret); + } else if (OB_FAIL(pid_file_name.assign_fmt("%s/run/oblite.pid", opts.base_dir_.ptr()))) { + MPRINT("get pidfile absolute path failed %d", ret); + } + + if (OB_FAIL(ret)) { + } else if (OB_FAIL(FileDirectoryUtils::create_full_path(opts.base_dir_.ptr()))) { + MPRINT("create base dir failed %d, directory: %s", ret, opts.base_dir_.ptr()); + } else if (-1 == chdir(opts.base_dir_.ptr())) { + ret = OB_ERR_UNEXPECTED; + MPRINT("change dir failed %s, directory: %s", strerror(errno), opts.base_dir_.ptr()); + } else if (OB_FAIL(FileDirectoryUtils::is_exists(opts.redo_dir_.ptr(), redo_exist))) { MPRINT("check dir failed %d", ret); - } else if (clog_exist && OB_FAIL(FileDirectoryUtils::is_empty_directory((std::string(db_dir) + "/store/clog").c_str(), clog_empty))) { + } else if (redo_exist && OB_FAIL(FileDirectoryUtils::is_empty_directory(opts.redo_dir_.ptr(), redo_empty))) { MPRINT("check dir failed %d", ret); - } else if (FALSE_IT(need_bootstrap = !clog_exist || clog_empty)) { - } else if (OB_FAIL(FileDirectoryUtils::create_full_path(db_dir))) { - MPRINT("create dir failed %d", ret); - } else if (OB_FAIL(chdir(db_dir))) { - MPRINT("change dir failed %d", ret); - } else if (getcwd(buffer, sizeof(buffer)) == nullptr) { - MPRINT("getcwd failed %d %d", errno, strerror(errno)); - } else if (FALSE_IT(db_abs_dir = std::string(buffer))) { - } else if (FALSE_IT(data_abs_dir_ = db_abs_dir + "/store")) { - } else if (FALSE_IT(opts.data_dir_ = data_abs_dir_.c_str())) { - } else if (OB_FAIL(FileDirectoryUtils::create_full_path("./store"))) { + } else if (FALSE_IT(opts.initialize_ = !redo_exist || redo_empty)) { + } else if (OB_FAIL(FileDirectoryUtils::create_full_path(opts.data_dir_.ptr()))) { MPRINT("create dir failed %d", ret); - } else if (OB_FAIL(FileDirectoryUtils::create_full_path("./store/clog"))) { + } else if (OB_FAIL(FileDirectoryUtils::create_full_path(opts.redo_dir_.ptr()))) { MPRINT("create dir failed %d", ret); - } else if (OB_FAIL(FileDirectoryUtils::create_full_path("./store/slog"))) { + } else if (OB_FAIL(slog_dir.assign_fmt("%s/slog", opts.data_dir_.ptr())) || + OB_FAIL(sstable_dir.assign_fmt("%s/sstable", opts.data_dir_.ptr()))) { + MPRINT("calculate slog and sstable dir failed %d", ret); + } else if (OB_FAIL(FileDirectoryUtils::create_full_path(slog_dir.ptr()))) { MPRINT("create dir failed %d", ret); - } else if (OB_FAIL(FileDirectoryUtils::create_full_path("./store/sstable"))) { + } else if (OB_FAIL(FileDirectoryUtils::create_full_path(sstable_dir.ptr()))) { MPRINT("create dir failed %d", ret); } else if (OB_FAIL(FileDirectoryUtils::create_full_path("./run"))) { MPRINT("create dir failed %d", ret); @@ -152,25 +184,32 @@ int ObLiteEmbed::do_open_(const char* db_dir) MPRINT("create dir failed %d", ret); } else if (OB_FAIL(FileDirectoryUtils::create_full_path("./log"))) { MPRINT("create dir failed %d", ret); + } else if (OB_FAIL(start_daemon(pid_file_name.ptr(), true))) { + MPRINT("db %s opened by other process", db_dir); + } else if (FALSE_IT(pid_locked = true)) { } else { OB_LOGGER.set_log_level("INFO"); - std::string log_file = db_abs_dir + "/log/oblite.log"; - OB_LOGGER.set_file_name(log_file.c_str(), true, false, log_file.c_str(), log_file.c_str(), log_file.c_str(), log_file.c_str()); + ObSqlString log_file; + if (OB_FAIL(log_file.assign_fmt("%s/log/oblite.log", opts.base_dir_.ptr()))) { + MPRINT("calculate log file failed %d", ret); + } else { + OB_LOGGER.set_file_name(log_file.ptr(), true, false); + } - int saved_stdout = dup(STDOUT_FILENO); // 保存当前stdout - dup2(OB_LOGGER.get_elec_log().fd_, STDOUT_FILENO); + int saved_stdout = dup(STDOUT_FILENO); // Save current stdout + dup2(OB_LOGGER.get_svr_log().fd_, STDOUT_FILENO); ObPLogWriterCfg log_cfg; - if (OB_FAIL(OBSERVER.init(opts, log_cfg))) { + if (OB_FAIL(ret)) { + } else if (OB_FAIL(OBSERVER.init(opts, log_cfg))) { LOG_WARN("observer init failed", KR(ret)); - } else if (need_bootstrap && OB_FAIL(bootstrap_())) { - LOG_WARN("bootstrap failed",KR(ret)); - } else if (OB_FAIL(OBSERVER.start())) { + } else if (OB_FAIL(OBSERVER.start(opts.embed_mode_))) { LOG_WARN("observer start failed", KR(ret)); - } else if (OB_FAIL(chdir(work_abs_dir.c_str()))) { - MPRINT("change dir failed %d", ret); + } else if (-1 == chdir(work_abs_dir.ptr())) { + ret = OB_ERR_UNEXPECTED; + MPRINT("change dir failed %s, directory: %s", strerror(errno), work_abs_dir.ptr()); } else { - LOG_INFO("observer start finish"); + FLOG_INFO("observer start finish wait service ", "cost", ObTimeUtility::current_time() - start_time); while (true) { if (GCTX.root_service_->is_full_service()) { break; @@ -178,79 +217,83 @@ int ObLiteEmbed::do_open_(const char* db_dir) ob_usleep(100 * 1000); } } - LOG_INFO("oblite start success"); + FLOG_INFO("oblite start success ", "cost", ObTimeUtility::current_time()-start_time); } dup2(saved_stdout, STDOUT_FILENO); } return ret; } -// TODO remove bootstrap phase -int ObLiteEmbed::bootstrap_() -{ - int ret = OB_SUCCESS; - std::thread th(notify_bootstrap_); - th_ = std::move(th); - return ret; -} - -void ObLiteEmbed::notify_bootstrap_() -{ - int64_t start_time = ObTimeUtility::current_time(); - int64_t curr_time =start_time; - ::usleep(500 * 1000); - while (curr_time - start_time < 3 * 60 * 1000 * 1000) { - int ret = OB_SUCCESS; - obrpc::ObServerInfo server_info; - server_info.zone_ = "zone1"; - server_info.server_ = GCTX.self_addr(); - server_info.region_ = "sys_region"; - obrpc::ObBootstrapArg arg; - arg.cluster_role_ = common::PRIMARY_CLUSTER; - arg.server_list_.push_back(server_info); - if (OB_FAIL(GCTX.ob_service_->bootstrap(arg))) { - LOG_WARN("notify bootstrap failed", KR(ret)); - } else { - break; - } - ::usleep(500 * 1000); - curr_time = ObTimeUtility::current_time(); - } - LOG_INFO("notify bootstrap success"); -} - void ObLiteEmbed::close() { //OBSERVER.set_stop(); //th_.join(); + if (pid_locked) { + unlink(pid_file_name.ptr()); + } + FLOG_INFO("oblite close"); _Exit(0); } -std::shared_ptr ObLiteEmbed::connect(const char* db_name, const bool autocommit) +std::shared_ptr ObLiteEmbed::connect(const char* db_name) { int ret = OB_SUCCESS; std::shared_ptr embed_conn = std::make_shared(); common::sqlclient::ObISQLConnection *inner_conn = nullptr; - ObSqlString sql; - int64_t affected_rows = 0; + uint32_t sid = sql::ObSQLSessionInfo::INVALID_SESSID; + sql::ObSQLSessionInfo *session = NULL; + const ObUserInfo* user_info = NULL; + ObSchemaGetterGuard schema_guard; + ObPrivSet db_priv_set = OB_PRIV_SET_EMPTY; + int64_t start_time = ObTimeUtility::current_time(); if (OB_ISNULL(GCTX.sql_proxy_)) { ret = OB_NOT_INIT; LOG_WARN("db not init", KR(ret)); - } else if (OB_FAIL(OBSERVER.get_inner_sql_conn_pool().acquire(OB_SYS_TENANT_ID, inner_conn, GCTX.sql_proxy_, 0))) { + } else if (OB_FAIL(GCTX.session_mgr_->create_sessid(sid))) { + LOG_WARN("Failed to create sess id", KR(ret)); + } else if (OB_FAIL(GCTX.session_mgr_->create_session(OB_SYS_TENANT_ID, sid, 0, ObTimeUtility::current_time(), session))) { + GCTX.session_mgr_->mark_sessid_unused(sid); + session = nullptr; + LOG_WARN("Failed to create session", KR(ret), K(sid)); + } else if (FALSE_IT(embed_conn->get_session() = session)) { + } else if (OB_FAIL(GCTX.schema_service_->get_tenant_schema_guard(OB_SYS_TENANT_ID, schema_guard))) { + LOG_WARN("failed to get schema guard", KR(ret)); + } else if (OB_FAIL(schema_guard.get_user_info(OB_SYS_TENANT_ID, OB_SYS_USER_ID, user_info))) { + LOG_WARN("failed to get user info", KR(ret)); + } else if (OB_ISNULL(user_info)) { + ret = OB_SCHEMA_ERROR; + LOG_WARN("schema user info is null", KR(ret)); + } + if (OB_SUCC(ret)) { + OZ (session->load_default_sys_variable(false, true)); + OZ (session->load_default_configs_in_pc()); + OZ (session->init_tenant(OB_SYS_TENANT_NAME, OB_SYS_TENANT_ID)); + OZ (session->load_all_sys_vars(schema_guard)); + OZ (session->set_default_database(db_name)); + OX (session->set_user_session()); + OZ (session->set_autocommit(false)); + OZ (session->set_user(user_info->get_user_name_str(), user_info->get_host_name_str(), user_info->get_user_id())); + OZ (session->set_real_client_ip_and_port("127.0.0.1", 0)); + OX (session->set_priv_user_id(user_info->get_user_id())); + OX (session->set_user_priv_set(user_info->get_priv_set())); + OX (session->init_use_rich_format()); + OZ (schema_guard.get_db_priv_set(OB_SYS_TENANT_ID, user_info->get_user_id(), db_name, db_priv_set)); + OX (session->set_db_priv_set(db_priv_set)); + OX (session->get_enable_role_array().reuse()); + for (int i = 0; OB_SUCC(ret) && i < user_info->get_role_id_array().count(); ++i) { + if (user_info->get_disable_option(user_info->get_role_id_option_array().at(i)) == 0) { + OZ (session->get_enable_role_array().push_back(user_info->get_role_id_array().at(i))); + } + } + } + if (FAILEDx(OBSERVER.get_inner_sql_conn_pool().acquire(session, inner_conn))) { LOG_WARN("acquire conn failed", KR(ret)); } else if (FALSE_IT(embed_conn->get_conn() = static_cast(inner_conn))) { - } else if (OB_FAIL(sql.assign_fmt("use %s", db_name))) { - LOG_WARN("assign sql string failed", KR(ret)); - } else if (OB_FAIL(inner_conn->execute_write(OB_SYS_TENANT_ID, sql.ptr(), affected_rows))) { - LOG_WARN("execute sql failed", KR(ret)); - } else if (OB_FAIL(sql.assign_fmt("set autocommit=%d", autocommit))) { - LOG_WARN("assign sql string failed", KR(ret)); - } else if (OB_FAIL(inner_conn->execute_write(OB_SYS_TENANT_ID, sql.ptr(), affected_rows))) { - LOG_WARN("execute sql failed", KR(ret)); } if (OB_FAIL(ret)) { - throw std::runtime_error("connect failed error code: " + std::to_string(ret)); + throw std::runtime_error("connect failed " + std::to_string(ob_errpkt_errno(ret, false)) + " " + std::string(ob_errpkt_strerror(ret, false))); } + FLOG_INFO("connect", K(db_name), K(sid), KP(session), KPC(session), KPC(user_info), "cost", ObTimeUtility::current_time()-start_time); return embed_conn; } @@ -272,15 +315,25 @@ void ObLiteEmbedConn::reset() OBSERVER.get_inner_sql_conn_pool().release(conn_, true); conn_ = nullptr; } + if (OB_NOT_NULL(session_)) { + GCTX.session_mgr_->revert_session(session_); + GCTX.session_mgr_->mark_sessid_unused(session_->get_sid()); + session_ = nullptr; + } } -int ObLiteEmbedConn::execute(const char *sql, int64_t &affected_rows, int64_t &result_seq) +int ObLiteEmbedConn::execute(const char *sql, uint64_t &affected_rows, int64_t &result_seq, std::string &errmsg) { int ret = OB_SUCCESS; ObString sql_string(sql); lib::ObMemAttr mem_attr(OB_SYS_TENANT_ID, "EmbedAlloc"); result_seq = ATOMIC_AAF(&result_seq_, 1); + ObCurTraceId::init(GCTX.self_addr()); + int64_t start_time = ObTimeUtility::current_time(); reset_result(); + if (OB_NOT_NULL(session_)) { + common::ob_setup_tsi_warning_buffer(&session_->get_warnings_buffer()); + } if (OB_ISNULL(conn_)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("conn is empty", KR(ret)); @@ -289,10 +342,31 @@ int ObLiteEmbedConn::execute(const char *sql, int64_t &affected_rows, int64_t &r LOG_WARN("alloc mem failed", KR(ret)); } else if (FALSE_IT(new (result_) common::ObCommonSqlProxy::ReadResult())) { } else if (OB_FAIL(conn_->execute_read(OB_SYS_TENANT_ID, sql_string, *result_, true))) { - LOG_WARN("execute sql failed", KR(ret)); + LOG_WARN("execute sql failed", KR(ret), K(sql)); } else { observer::ObInnerSQLResult& res = static_cast(*result_->get_result()); - affected_rows = res.result_set().get_affected_rows(); + if (res.result_set().get_stmt_type() == sql::stmt::T_SELECT) { + affected_rows = UINT64_MAX; + } else { + affected_rows = res.result_set().get_affected_rows(); + } + int64_t end_time = ObTimeUtility::current_time(); + FLOG_INFO("execute", K(sql), K(conn_->is_in_trans()), K(session_->is_in_transaction()), K(affected_rows), K(res.result_set().get_stmt_type()), + "cost", end_time-start_time); + } + if (OB_FAIL(ret)) { + const common::ObWarningBuffer *wb = common::ob_get_tsi_warning_buffer(); + if (nullptr != wb) { + if (wb->get_err_code() == ret || + (ret >= OB_MIN_RAISE_APPLICATION_ERROR && ret <= OB_MAX_RAISE_APPLICATION_ERROR)) { + if (wb->get_err_msg() != nullptr && wb->get_err_msg()[0] != '\0') { + errmsg = std::string(wb->get_err_msg()); + } + } + } + } + if (OB_NOT_NULL(session_)) { + session_->reset_warnings_buf(); } return ret; } @@ -305,28 +379,46 @@ ObLiteEmbedCursor ObLiteEmbedConn::cursor() return embed_cursor; } -int ObLiteEmbedCursor::execute(const char *sql) +uint64_t ObLiteEmbedCursor::execute(const char *sql) { int ret = OB_SUCCESS; - int64_t affected_rows = 0; + uint64_t affected_rows = 0; int64_t result_seq = 0; - if (OB_FAIL(embed_conn_->execute(sql, affected_rows, result_seq))) { + std::string errmsg; + if (!embed_conn_) { + ret = OB_CONNECT_ERROR; + } else if (OB_FAIL(embed_conn_->execute(sql, affected_rows, result_seq, errmsg))) { LOG_WARN("execute sql failed", KR(ret), K(sql)); } else { result_seq_ = result_seq; } if (OB_FAIL(ret)) { - throw std::runtime_error("execute sql error code: " + std::to_string(ret)); + if (errmsg.empty()) { + errmsg = std::string(ob_errpkt_strerror(ret, false)); + } + throw std::runtime_error("execute sql failed " + std::to_string(ob_errpkt_errno(ret, false)) + " " + errmsg); } return affected_rows; } -std::vector> ObLiteEmbedCursor::fetchall() +void ObLiteEmbedCursor::reset() +{ + if (embed_conn_ && result_seq_ > 0 && + embed_conn_->get_result_seq() == result_seq_) { + embed_conn_->reset_result(); + } + embed_conn_.reset(); + result_seq_ = 0; +} + +std::vector ObLiteEmbedCursor::fetchall() { int ret = OB_SUCCESS; - std::vector> res; + std::vector res; sqlclient::ObMySQLResult* mysql_result = nullptr; - if (OB_ISNULL(embed_conn_->get_conn())) { + if (!embed_conn_) { + ret = OB_CONNECT_ERROR; + } else if (OB_ISNULL(embed_conn_->get_conn())) { ret = OB_CONNECT_ERROR; } else if (OB_ISNULL(embed_conn_->get_res())) { ret = OB_ERR_NULL_VALUE; @@ -345,9 +437,9 @@ std::vector> ObLiteEmbedCursor::fetchall() break; } int64_t column_count = mysql_result->get_column_count(); - std::vector row; + pybind11::list row_data; if (column_count > 0) { - row.reserve(column_count); + row_data = pybind11::list(); } for (int64_t i = 0; OB_SUCC(ret) && i < column_count; i++) { ObObjMeta obj_meta; @@ -358,24 +450,26 @@ std::vector> ObLiteEmbedCursor::fetchall() LOG_WARN("convert obobj to value failed ",KR(ret), K(obj_meta), K(obj_meta.get_type())); } else { //LOG_INFO("fetchall", K(i), K(obj_meta), K(obj_meta.get_type())); - row.push_back(value); + row_data.append(value); } } - res.push_back(std::move(row)); + res.push_back(pybind11::tuple(row_data)); } } if (OB_FAIL(ret)) { - throw std::runtime_error("fetchall failed error code: " + std::to_string(ret)); + throw std::runtime_error("fetchall failed " + std::to_string(ob_errpkt_errno(ret, false)) + " " + std::string(ob_errpkt_strerror(ret, false))); } return res; } -std::vector ObLiteEmbedCursor::fetchone() +pybind11::tuple ObLiteEmbedCursor::fetchone() { int ret = OB_SUCCESS; - std::vector res; + pybind11::list row_data; sqlclient::ObMySQLResult* mysql_result = nullptr; - if (OB_ISNULL(embed_conn_->get_conn())) { + if (!embed_conn_) { + ret = OB_CONNECT_ERROR; + } else if (OB_ISNULL(embed_conn_->get_conn())) { ret = OB_CONNECT_ERROR; } else if (OB_ISNULL(embed_conn_->get_res())) { ret = OB_ERR_NULL_VALUE; @@ -390,6 +484,8 @@ std::vector ObLiteEmbedCursor::fetchone() ret = mysql_result->next(); if (OB_ITER_END == ret) { ret = OB_SUCCESS; + // 返回空tuple + return pybind11::tuple(); } else { int64_t column_count = mysql_result->get_column_count(); for (int64_t i = 0; OB_SUCC(ret) && i < column_count; i++) { @@ -400,27 +496,33 @@ std::vector ObLiteEmbedCursor::fetchone() } else if (OB_FAIL(ObLiteEmbedUtil::convert_result_to_pyobj(i, *mysql_result, obj_meta, value))) { LOG_WARN("convert obobj to value failed ",KR(ret), K(obj_meta), K(obj_meta.get_type())); } else { - res.push_back(value); + row_data.append(value); } } } } if (OB_FAIL(ret)) { - throw std::runtime_error("fetchone failed error code: " + std::to_string(ret)); + throw std::runtime_error("fetchone failed " + std::to_string(ob_errpkt_errno(ret, false)) + " " + std::string(ob_errpkt_strerror(ret, false))); } - return res; + return pybind11::tuple(row_data); } void ObLiteEmbedConn::begin() { int ret = OB_SUCCESS; if (OB_ISNULL(conn_)) { - ret = OB_ERR_UNEXPECTED; - } else if (!conn_->is_in_trans() && OB_FAIL(conn_->start_transaction(OB_SYS_TENANT_ID))) { + ret = OB_CONNECT_ERROR; + } else if (session_->is_in_transaction()) { + reset_result(); + conn_->set_is_in_trans(true); + conn_->rollback(); + LOG_WARN("last trans need rollback", KP(conn_)); + } + if (FAILEDx(conn_->start_transaction(OB_SYS_TENANT_ID))) { LOG_WARN("start trans failed", KR(ret)); } if (OB_FAIL(ret)) { - throw std::runtime_error("begin failed error code: " + std::to_string(ret)); + throw std::runtime_error("begin failed " + std::to_string(ob_errpkt_errno(ret, false)) + " " + std::string(ob_errpkt_strerror(ret, false))); } } @@ -429,12 +531,14 @@ void ObLiteEmbedConn::commit() int ret = OB_SUCCESS; reset_result(); if (OB_ISNULL(conn_)) { - ret = OB_ERR_UNEXPECTED; - } else if (conn_->is_in_trans() && OB_FAIL(conn_->commit())) { + ret = OB_CONNECT_ERROR; + } else if (!session_->is_in_transaction()) { + } else if (FALSE_IT(conn_->set_is_in_trans(true))) { + } else if (OB_FAIL(conn_->commit())) { LOG_WARN("commit trans failed", KR(ret)); } if (OB_FAIL(ret)) { - throw std::runtime_error("commit failed error code: " + std::to_string(ret)); + throw std::runtime_error("commit failed " + std::to_string(ob_errpkt_errno(ret, false)) + " " + std::string(ob_errpkt_strerror(ret, false))); } } @@ -443,12 +547,14 @@ void ObLiteEmbedConn::rollback() int ret = OB_SUCCESS; reset_result(); if (OB_ISNULL(conn_)) { - ret = OB_ERR_UNEXPECTED; - } else if (conn_->is_in_trans() && OB_FAIL(conn_->rollback())) { + ret = OB_CONNECT_ERROR; + } else if (!session_->is_in_transaction()) { + } else if (FALSE_IT(conn_->set_is_in_trans(true))) { + } else if (OB_FAIL(conn_->rollback())) { LOG_WARN("rollback trans failed", KR(ret)); } if (OB_FAIL(ret)) { - throw std::runtime_error("rollback failed error code: " + std::to_string(ret)); + throw std::runtime_error("rollback failed " + std::to_string(ob_errpkt_errno(ret, false)) + " " + std::string(ob_errpkt_strerror(ret, false))); } } @@ -490,7 +596,14 @@ int ObLiteEmbedUtil::convert_result_to_pyobj(const int64_t col_idx, common::sqlc case ObUFloatType: { float float_val = 0; if (OB_SUCC(result.get_float(col_idx, float_val))) { - val = pybind11::float_(float_val); + char buf[64]; + int len = snprintf(buf, sizeof(buf), "%.6g", float_val); + if (len > 0 && len < sizeof(buf)) { + std::string formatted_str(buf, len); + val = builtins.attr("float")(formatted_str); + } else { + ret = OB_NOT_SUPPORTED; + } } break; } @@ -502,6 +615,23 @@ int ObLiteEmbedUtil::convert_result_to_pyobj(const int64_t col_idx, common::sqlc } break; } + case ObNumberType: + case ObUNumberType: { + ObObj obj; + if (OB_FAIL(result.get_obj(col_idx, obj))) { + LOG_WARN("get obj failed", K(ret), K(col_idx)); + } else { + number::ObNumber number = obj.get_number(); + char buf[256]; + int64_t length = 0; + if (OB_FAIL(number.format(buf, sizeof(buf), length, obj.get_scale()))) { + LOG_WARN("format number failed", K(ret), K(number)); + } else { + val = decimal_class(pybind11::str(buf, length)); + } + } + break; + } case ObDecimalIntType: { ObObj obj; if (OB_FAIL(result.get_obj(col_idx, obj))) { diff --git a/src/observer/embed/python/ob_embed_impl.h b/src/observer/embed/python/ob_embed_impl.h index 74844c77d..fa5c52a54 100644 --- a/src/observer/embed/python/ob_embed_impl.h +++ b/src/observer/embed/python/ob_embed_impl.h @@ -1,14 +1,18 @@ -/** -* Copyright (c) 2021 OceanBase -* OceanBase CE is licensed under Mulan PubL v2. -* You can use this software according to the terms and conditions of the Mulan PubL v2. -* You may obtain a copy of Mulan PubL v2 at: -* http://license.coscl.org.cn/MulanPubL-2.0 -* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -* See the Mulan PubL v2 for more details. -*/ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #pragma once #include @@ -21,39 +25,41 @@ namespace oceanbase { namespace embed { +extern char embed_version_str[oceanbase::common::OB_SERVER_VERSION_LENGTH]; class ObLiteEmbedCursor; class ObLiteEmbedConn : public std::enable_shared_from_this { public: - ObLiteEmbedConn() : conn_(nullptr), result_seq_(0), result_(nullptr) {} + ObLiteEmbedConn() : conn_(nullptr), result_seq_(0), result_(nullptr), session_(nullptr) {} ~ObLiteEmbedConn() { reset(); } void begin(); void commit(); void rollback(); ObLiteEmbedCursor cursor(); - int execute(const char* sql, int64_t &affected_rows, int64_t &result_seq); + int execute(const char* sql, uint64_t &affected_rows, int64_t &result_seq, std::string &errmsg); void reset(); void reset_result(); int64_t get_result_seq() { return result_seq_; } observer::ObInnerSQLConnection *&get_conn() { return conn_; } + sql::ObSQLSessionInfo *&get_session() { return session_; } common::ObCommonSqlProxy::ReadResult *get_res() { return result_; } private: observer::ObInnerSQLConnection *conn_; int64_t result_seq_; common::ObCommonSqlProxy::ReadResult *result_; + sql::ObSQLSessionInfo* session_; }; class ObLiteEmbedCursor { public: ObLiteEmbedCursor() : embed_conn_(), result_seq_(0) {} - ~ObLiteEmbedCursor() { - embed_conn_.reset(); - result_seq_ = 0; - } - int execute(const char* sql); - std::vector fetchone(); - std::vector> fetchall(); + ~ObLiteEmbedCursor() { reset(); } + uint64_t execute(const char* sql); + pybind11::tuple fetchone(); + std::vector fetchall(); + void reset(); + void close() { reset(); } friend ObLiteEmbedCursor ObLiteEmbedConn::cursor(); private: std::shared_ptr embed_conn_; @@ -67,16 +73,9 @@ class ObLiteEmbed ~ObLiteEmbed() {} static void open(const char* db_dir); static void close(); - static std::shared_ptr connect(const char* db_name, const bool autocommit); + static std::shared_ptr connect(const char* db_name); private: static int do_open_(const char* db_dir); - static int bootstrap_(); - static void notify_bootstrap_(); -private: - static std::string rs_list_; - static std::string opts_; - static std::string data_abs_dir_; - static std::thread th_; }; class ObLiteEmbedUtil diff --git a/src/observer/main.cpp b/src/observer/main.cpp index 195a9b449..c587a0f3f 100644 --- a/src/observer/main.cpp +++ b/src/observer/main.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -24,10 +28,10 @@ #include "lib/signal/ob_signal_struct.h" #include "lib/utility/ob_defer.h" #include "objit/ob_llvm_symbolizer.h" +#include "observer/ob_command_line_parser.h" #include "observer/ob_server.h" #include "observer/ob_server_utils.h" #include "observer/ob_signal_handle.h" -#include "observer/omt/ob_tenant_config.h" #include "share/config/ob_server_config.h" #include "share/ob_tenant_mgr.h" #include "share/ob_version.h" @@ -54,61 +58,20 @@ using namespace oceanbase::omt; MPRINT(format, ##__VA_ARGS__); \ exit(1) -static void print_help() -{ - MPRINT("observer [OPTIONS]"); - MPRINT(" -h,--help print this help"); - MPRINT(" -z,--zone ZONE zone"); - MPRINT(" -p,--mysql_port PORT mysql port"); - MPRINT(" -P,--rpc_port PORT rpc port"); - MPRINT(" -N,--nodaemon don't run in daemon"); - MPRINT(" -n,--appname APPNAME application name"); - MPRINT(" -c,--cluster_id ID cluster id"); - MPRINT(" -d,--data_dir DIR OceanBase data directory"); - MPRINT(" -i,--devname DEV net dev interface"); - MPRINT(" -I,--local_ip ip of the current machine"); - MPRINT(" -o,--optstr OPTSTR extra options string"); - MPRINT(" -r,--rs_list RS_LIST root service list"); - MPRINT(" -l,--log_level LOG_LEVEL server log level"); - MPRINT(" -6,--ipv6 USE_IPV6 server use ipv6 address"); - MPRINT(" -m,--mode MODE server mode"); - MPRINT(" -f,--scn flashback_scn"); - MPRINT(" -L,--plugins_load plugins to load"); -} - -static void print_version() -{ -#ifndef ENABLE_SANITY - const char *extra_flags = ""; -#else - const char *extra_flags = "|Sanity"; -#endif - MPRINT("observer (%s)\n", PACKAGE_STRING); - MPRINT("REVISION: %s", build_version()); - MPRINT("BUILD_BRANCH: %s", build_branch()); - MPRINT("BUILD_TIME: %s %s", build_date(), build_time()); - MPRINT("BUILD_FLAGS: %s%s", build_flags(), extra_flags); - MPRINT("BUILD_INFO: %s\n", build_info()); - MPRINT("Copyright (c) 2011-present OceanBase Inc."); - MPRINT(); -} +const char LOG_DIR[] = "log"; +const char PID_DIR[] = "run"; +const char CONF_DIR[] = "etc"; static int dump_config_to_json() { int ret = OB_SUCCESS; ObArenaAllocator allocator(g_config_mem_attr); ObJsonArray j_arr(&allocator); - omt::ObTenantConfig *tenant_config = OB_NEW(ObTenantConfig, SET_USE_UNEXPECTED_500("TenantConfig"), OB_SYS_TENANT_ID); ObJsonBuffer j_buf(&allocator); FILE *out_file = nullptr; const char *out_path = "./ob_all_available_parameters.json"; - if (OB_ISNULL(tenant_config)) { - ret = OB_ALLOCATE_MEMORY_FAILED; - MPRINT("new tenant config failed! ret=%d\n", ret); - } else if (OB_FAIL(ObServerConfig::get_instance().to_json_array(allocator, j_arr))) { + if (OB_FAIL(ObServerConfig::get_instance().to_json_array(allocator, j_arr))) { MPRINT("dump cluster config to json failed, ret=%d\n", ret); - } else if (OB_FAIL(tenant_config->to_json_array(allocator, j_arr))) { - MPRINT("dump tenant config to json failed, ret=%d\n", ret); } else if (OB_FAIL(j_arr.print(j_buf, false))) { MPRINT("print json array to buffer failed, ret=%d\n", ret); } else if (nullptr == j_buf.ptr()) { @@ -121,9 +84,7 @@ static int dump_config_to_json() ret = OB_IO_ERROR; MPRINT("write json buffer to file failed, errno=%d, ret=%d\n", errno, ret); } - if (nullptr != tenant_config) { - OB_DELETE(ObTenantConfig, SET_USE_UNEXPECTED_500("TenantConfig"), tenant_config); - } + if (nullptr != out_file) { fclose(out_file); } @@ -138,219 +99,123 @@ static void print_args(int argc, char *argv[]) fprintf(stderr, "%s\n", argv[argc - 1]); } -static bool to_int64(const char *sval, int64_t &ival) +/** + * 创建并检查目录为空,并且有写权限 + * @param dir_path 目录路径 + * @return 返回值 + * @retval OB_SUCCESS 成功 + * @retval OB_INVALID_ARGUMENT 参数错误 + * @retval OB_ERR_UNEXPECTED 目录不存在或不可写 + */ +static int create_and_check_dir_writable(const char *dir_path, bool check_is_empty = true) { - char *endp = NULL; - ival = static_cast(strtol(sval, &endp, 10)); - return NULL != endp && *endp == '\0'; -} + int ret = OB_SUCCESS; + bool is_writable = false; + bool is_empty = false; + bool is_exists = false; + if (OB_ISNULL(dir_path) || strlen(dir_path) == 0) { + ret = OB_INVALID_ARGUMENT; + MPRINT("[Internal Error] Invalid argument. dir path is null."); + } -static int to_port_x(const char *sval) -{ - int64_t port = 0; - if (!to_int64(sval, port)) { - MPRINTx("need port number: %s", sval); - } else if (port <= 1024 || port >= 65536) { - MPRINTx( - "port number should greater than 1024 and less than 65536: %ld", port); + if (OB_FAIL(ret)) { + } else if (OB_FAIL(FileDirectoryUtils::is_exists(dir_path, is_exists))) { + MPRINT("Check directory exists failed. path='%s'. system error=%s", dir_path, strerror(errno)); + } else if (is_exists && check_is_empty) { + if (OB_FAIL(FileDirectoryUtils::is_empty_directory(dir_path, is_empty))) { + MPRINT("Check directory empty failed. path='%s', system error=%s", dir_path, strerror(errno)); + } else if (!is_empty) { + ret = OB_INVALID_ARGUMENT; + MPRINT("Directory is not empty. path=%s", dir_path); + } + } else if (OB_FAIL(FileDirectoryUtils::create_full_path(dir_path))) { + MPRINT("Create directory failed. path='%s', system error=%s", dir_path, strerror(errno)); } - return static_cast(port); -} -static int64_t to_cluster_id_x(const char *sval) -{ - int64_t cluster_id = 0; - if (!to_int64(sval, cluster_id)) { - MPRINTx("need cluster id: %s", sval); - } else if ( - cluster_id <= 0 || - cluster_id >= - 4294967296) { // cluster id given by command line must be in range [1,4294967295] - MPRINTx( - "cluster id in cmd option should be in range [1,4294967295], " - "but it is %ld", - cluster_id); + if (FAILEDx(FileDirectoryUtils::is_writable(dir_path, is_writable))) { + MPRINT("Check directory writable failed. path=%s, system error=%s", dir_path, strerror(errno)); + } else if (!is_writable) { + ret = OB_ERR_UNEXPECTED; + MPRINT("Directory is not writable. path='%s'", dir_path); + } else { + MPRINT("Directory is created and writable. path='%s'", dir_path); } - return cluster_id; + return ret; } -static void get_opts_setting( - struct option long_opts[], char short_opts[], const size_t size) +/** + * 初始化部署环境 + * @details 初始化observer进程需要的目录,比如 base_dir、data_dir和redo_dir。 + * @param opts 配置选项 + * @return 返回值 + * @retval OB_SUCCESS 成功 + * @retval OB_INVALID_ARGUMENT 参数错误 + * @retval OB_ERR_UNEXPECTED 目录不存在或不可写 + */ +static int init_deploy_env(const ObServerOptions &opts) { - static struct - { - const char *long_name_; - char short_name_; - bool has_arg_; - } ob_opts[] = { - {"help", 'h', 0}, - {"home", 'H', 1}, - {"mysql_port", 'p', 1}, - {"rpc_port", 'P', 1}, - {"nodaemon", 'N', 0}, - {"appname", 'n', 1}, - {"cluster_id", 'c', 1}, - {"data_dir", 'd', 1}, - {"log_level", 'l', 1}, - {"zone", 'z', 1}, - {"optstr", 'o', 1}, - {"devname", 'i', 1}, - {"rs_list", 'r', 1}, - {"mode", 'm', 1}, - {"scn", 'f', 1}, - {"version", 'V', 0}, - {"dump_config_to_json", 'C', 0}, - {"ipv6", '6', 0}, - {"local_ip", 'I', 1}, - {"plugins_load", 'L', 1}, - }; - - size_t opts_cnt = sizeof(ob_opts) / sizeof(ob_opts[0]); - - if (opts_cnt >= size) { - MPRINTx("parse option fail: opts array is too small"); - } + int ret = OB_SUCCESS; - int short_idx = 0; + const char *sstable_dir = "sstable"; + const char *slog_dir = "slog"; + + // 确保我们需要的几个目录是空的,其它目录可以保留。比如用户可以在base_dir下创建 plugin_dir、bin等目录。 + ObSqlString log_dir; + ObSqlString run_dir; + ObSqlString etc_dir; + if (OB_FAIL(log_dir.assign_fmt("%s/%s", opts.base_dir_.ptr(), LOG_DIR))) { + MPRINT("[Maybe Memory Error] Failed to assign log dir."); + } else if (OB_FAIL(run_dir.assign_fmt("%s/%s", opts.base_dir_.ptr(), PID_DIR))) { + MPRINT("[Maybe Memory Error] Failed to assign run dir."); + } else if (OB_FAIL(etc_dir.assign_fmt("%s/%s", opts.base_dir_.ptr(), CONF_DIR))) { + MPRINT("[Maybe Memory Error] Failed to assign etc dir."); + } else if (OB_FAIL(create_and_check_dir_writable(log_dir.ptr(), false/*check_is_empty*/))) { + MPRINT("Failed to create and check log dir."); + } else if (OB_FAIL(create_and_check_dir_writable(run_dir.ptr(), false/*check_is_empty*/))) { + MPRINT("Failed to create and check run dir."); + } else if (OB_FAIL(create_and_check_dir_writable(etc_dir.ptr(), false/*check_is_empty*/))) { + MPRINT("Failed to create and check etc dir."); + } - for (size_t i = 0; i < opts_cnt; ++i) { - long_opts[i].name = ob_opts[i].long_name_; - long_opts[i].has_arg = ob_opts[i].has_arg_; - long_opts[i].flag = NULL; - long_opts[i].val = ob_opts[i].short_name_; + if (OB_FAIL(ret)) { + } else if (OB_FAIL(create_and_check_dir_writable(opts.redo_dir_.ptr()))) { + MPRINT("Failed to create and check redo dir."); + } - short_opts[short_idx++] = ob_opts[i].short_name_; - if (ob_opts[i].has_arg_) { - short_opts[short_idx++] = ':'; - } + ObSqlString data_dir; + if (OB_FAIL(ret)) { + } else if (OB_FAIL(data_dir.assign_fmt("%s/%s", opts.data_dir_.ptr(), sstable_dir))) { + MPRINT("[Maybe Memory Error] Failed to assign base dir."); + } else if (OB_FAIL(create_and_check_dir_writable(data_dir.ptr()))) { + MPRINT("Failed to create and check sstable dir."); + } else if (OB_FAIL(data_dir.assign_fmt("%s/%s", opts.data_dir_.ptr(), slog_dir))) { + MPRINT("[Maybe Memory Error] Failed to create slog dir variable."); + } else if (OB_FAIL(create_and_check_dir_writable(data_dir.ptr()))) { + MPRINT("Failed to create and check slog dir."); } + + return ret; } -static void -parse_short_opt(const int c, const char *value, ObServerOptions &opts) +/** + * 解析命令行参数 + * @details 解析命令行参数,并初始化ObServerOptions。 + * @param argc 命令行参数个数 + * @param argv 命令行参数 + * @param opts 配置选项 + */ +static int parse_args(int argc, char *argv[], ObServerOptions &opts) { - switch (c) { - case 'H': - MPRINT("home: %s", value); - opts.home_ = value; - // set home - break; - - case 'p': - MPRINT("mysql port: %s", value); - opts.mysql_port_ = to_port_x(value); - // set port - break; - - case 'P': - MPRINT("rpc port: %s", value); - opts.rpc_port_ = to_port_x(value); - // set port - break; - - case 'z': - MPRINT("zone: %s", value); - opts.zone_ = value; - break; - - case 'o': - MPRINT("optstr: %s", value); - opts.optstr_ = value; - break; - - case 'i': - MPRINT("devname: %s", value); - opts.devname_ = value; - break; - - case 'r': - MPRINT("rs list: %s", value); - opts.rs_list_ = value; - break; - - case 'N': - MPRINT("nodaemon"); - opts.nodaemon_ = true; - // set nondaemon - break; - - case 'n': - MPRINT("appname: %s", value); - opts.appname_ = value; - break; - - case 'c': - MPRINT("cluster id: %s", value); - opts.cluster_id_ = to_cluster_id_x(value); - break; - - case 'd': - MPRINT("data_dir: %s", value); - opts.data_dir_ = value; - break; - - case 'l': - MPRINT("log level: %s", value); - if (OB_SUCCESS != OB_LOGGER.level_str2int(value, opts.log_level_)) { - MPRINT("malformed log level, candicates are: " - " ERROR,USER_ERR,WARN,INFO,TRACE,DEBUG"); - MPRINT("!! Back to INFO log level."); - opts.log_level_ = OB_LOG_LEVEL_WARN; - } - break; - - case 'm': - // set mode - MPRINT("server startup mode: %s", value); - opts.startup_mode_ = value; - break; - - case 'f': - MPRINT("flashback scn: %s", value); - to_int64(value, opts.flashback_scn_); - break; - - case 'V': - print_version(); - exit(0); - break; - - case 'C': - if (OB_SUCCESS != dump_config_to_json()) { - MPRINT("dump config to json failed"); - } - exit(0); - break; - - case '6': - opts.use_ipv6_ = true; - break; - - case 'I': - MPRINT("local_ip: %s", value); - opts.local_ip_ = value; - break; - - case 'L': - MPRINT("plugins_load: %s", value); - opts.plugins_load_ = value; - break; - - case 'h': - default: - print_help(); - exit(1); + int ret = OB_SUCCESS; + + ObCommandLineParser parser; + + // 解析参数,结果直接设置到opts中 + if (OB_FAIL(parser.parse_args(argc, argv, opts))) { + MPRINT("Failed to parse command line arguments, ret=%d", ret); } -} -// process long only option -static void -parse_long_opt(const char *name, const char *value, ObServerOptions &opts) -{ - MPRINT("long: %s %s", name, value); - UNUSED(name); - UNUSED(value); - UNUSED(opts); + return ret; } static int callback(struct dl_phdr_info *info, size_t size, void *data) @@ -360,10 +225,10 @@ static int callback(struct dl_phdr_info *info, size_t size, void *data) if (OB_ISNULL(info)) { LOG_ERROR_RET(OB_INVALID_ARGUMENT, "invalid argument", K(info)); } else { - MPRINT("name=%s (%d segments)", info->dlpi_name, info->dlpi_phnum); + _LOG_INFO("name=%s (%d segments)", info->dlpi_name, info->dlpi_phnum); for (int j = 0; j < info->dlpi_phnum; j++) { if (NULL != info->dlpi_phdr) { - MPRINT( + _LOG_INFO( "\t\t header %2d: address=%10p", j, (void *)(info->dlpi_addr + info->dlpi_phdr[j].p_vaddr)); @@ -373,30 +238,6 @@ static int callback(struct dl_phdr_info *info, size_t size, void *data) return 0; } -static void parse_opts(int argc, char *argv[], ObServerOptions &opts) -{ - static const int MAX_OPTS_CNT = 128; - static char short_opts[MAX_OPTS_CNT * 2 + 1]; - static struct option long_opts[MAX_OPTS_CNT]; - - get_opts_setting(long_opts, short_opts, MAX_OPTS_CNT); - - int long_opts_idx = 0; - - bool end = false; - while (!end) { - int c = getopt_long(argc, argv, short_opts, long_opts, &long_opts_idx); - - if (-1 == c || long_opts_idx >= MAX_OPTS_CNT) { // end - end = true; - } else if (0 == c) { - parse_long_opt(long_opts[long_opts_idx].name, optarg, opts); - } else { - parse_short_opt(c, optarg, opts); - } - } -} - static void print_limit(const char *name, const int resource) { struct rlimit limit; @@ -527,15 +368,7 @@ int inner_main(int argc, char *argv[]) ObCurTraceId::SeqGenerator::seq_generator_ = ObTimeUtility::current_time(); static const int LOG_FILE_SIZE = 256 * 1024 * 1024; - char LOG_DIR[] = "log"; - char PID_DIR[] = "run"; - char CONF_DIR[] = "etc"; - char ALERT_DIR[] = "log/alert"; const char *const LOG_FILE_NAME = "log/observer.log"; - const char *const RS_LOG_FILE_NAME = "log/rootservice.log"; - const char *const ELECT_ASYNC_LOG_FILE_NAME = "log/election.log"; - const char *const TRACE_LOG_FILE_NAME = "log/trace.log"; - const char *const ALERT_LOG_FILE_NAME = "log/alert/alert.log"; const char *const PID_FILE_NAME = "run/observer.pid"; int ret = OB_SUCCESS; @@ -543,11 +376,15 @@ int inner_main(int argc, char *argv[]) if (OB_FAIL(ObSignalHandle::change_signal_mask())) { MPRINT("change signal mask failed, ret=%d", ret); } - ObServerOptions opts; - int64_t pos = 0; + lib::ObMemAttr mem_attr(OB_SYS_TENANT_ID, "ObserverAlloc"); + ObServerOptions *opts = nullptr; + if (OB_FAIL(ret)) { + } else if (OB_ISNULL(opts = OB_NEW(ObServerOptions, mem_attr))) { + ret = OB_ALLOCATE_MEMORY_FAILED; + MPRINT("Failed to allocate memory for ObServerOptions."); + } - print_args(argc, argv); // no diagnostic info attach to main thread. ObDisableDiagnoseGuard disable_guard; setlocale(LC_ALL, ""); @@ -556,11 +393,32 @@ int inner_main(int argc, char *argv[]) setlocale(LC_CTYPE, "C"); setlocale(LC_TIME, "en_US.UTF-8"); setlocale(LC_NUMERIC, "en_US.UTF-8"); - // memset(&opts, 0, sizeof (opts)); - opts.log_level_ = OB_LOG_LEVEL_WARN; - parse_opts(argc, argv, opts); - if (OB_SUCC(ret) && OB_FAIL(check_uid_before_start(CONF_DIR))) { + opts->log_level_ = OB_LOG_LEVEL_WARN; + if (FAILEDx(parse_args(argc, argv, *opts))) { + } + + if (OB_FAIL(ret)) { + } else if (opts->initialize_) { + if (OB_FAIL(init_deploy_env(*opts))) { + MPRINT("Failed to initialize deploy environment."); + } + } + + if (OB_FAIL(ret)) { + } else if (0 != chdir(opts->base_dir_.ptr())) { + ret = OB_ERR_UNEXPECTED; + MPRINT("Failed to change working directory to base dir. path='%s', system error='%s'", + opts->base_dir_.ptr(), strerror(errno)); + } else { + MPRINT("Change working directory to base dir. path='%s'", opts->base_dir_.ptr()); + if (opts->initialize_) { + MPRINT("Start to initialize observer, please wait..."); + } + } + + if (OB_FAIL(ret)) { + } else if (OB_FAIL(check_uid_before_start(CONF_DIR))) { MPRINT("Fail check_uid_before_start, please use the initial user to start observer!"); } else if (OB_FAIL(FileDirectoryUtils::create_full_path(PID_DIR))) { MPRINT("create pid dir fail: ./run/"); @@ -568,33 +426,28 @@ int inner_main(int argc, char *argv[]) MPRINT("create log dir fail: ./log/"); } else if (OB_FAIL(FileDirectoryUtils::create_full_path(CONF_DIR))) { MPRINT("create log dir fail: ./etc/"); - } else if (OB_FAIL(FileDirectoryUtils::create_full_path(ALERT_DIR))) { - MPRINT("create log dir fail: ./log/alert"); } else if (OB_FAIL(ObEncryptionUtil::init_ssl_malloc())) { MPRINT("failed to init crypto malloc"); - } else if (!opts.nodaemon_ && OB_FAIL(start_daemon(PID_FILE_NAME))) { + } else if (!opts->nodaemon_) { + MPRINT("Start observer server as a daemon."); + if (OB_FAIL(start_daemon(PID_FILE_NAME))) { + MPRINT("Start observer server as a daemon failed."); + } + } + if (OB_FAIL(ret)) { } else { ObCurTraceId::get_trace_id()->set("Y0-0000000000000001-0-0"); CURLcode curl_code = curl_global_init(CURL_GLOBAL_ALL); OB_ASSERT(CURLE_OK == curl_code); const char *syslog_file_info = ObServerUtils::build_syslog_file_info(ObAddr()); - OB_LOGGER.set_log_level(opts.log_level_); + OB_LOGGER.set_log_level(opts->log_level_); OB_LOGGER.set_max_file_size(LOG_FILE_SIZE); OB_LOGGER.set_new_file_info(syslog_file_info); - OB_LOGGER.set_file_name(LOG_FILE_NAME, false, true, RS_LOG_FILE_NAME, ELECT_ASYNC_LOG_FILE_NAME, - TRACE_LOG_FILE_NAME, ALERT_LOG_FILE_NAME); + OB_LOGGER.set_file_name(LOG_FILE_NAME, opts->initialize_/*no_redirect_flag*/); ObPLogWriterCfg log_cfg; - // if (OB_SUCCESS != (ret = ASYNC_LOG_INIT(ELECT_ASYNC_LOG_FILE_NAME, opts.log_level_, true))) { - // LOG_ERROR("election async log init error.", K(ret)); - // ret = OB_ELECTION_ASYNC_LOG_WARN_INIT; - // } LOG_INFO("succ to init logger", "default file", LOG_FILE_NAME, - "rs file", RS_LOG_FILE_NAME, - "election file", ELECT_ASYNC_LOG_FILE_NAME, - "trace file", TRACE_LOG_FILE_NAME, - "alert file", ALERT_LOG_FILE_NAME, "max_log_file_size", LOG_FILE_SIZE, "enable_async_log", OB_LOGGER.enable_async_log()); if (0 == memory_used) { @@ -605,7 +458,7 @@ int inner_main(int argc, char *argv[]) // print in log file. LOG_INFO("Build basic information for each syslog file", "info", syslog_file_info); print_args(argc, argv); - print_version(); + ObCommandLineParser::print_version(); print_all_limits(); dl_iterate_phdr(callback, NULL); @@ -617,6 +470,8 @@ int inner_main(int argc, char *argv[]) // records all WARN and ERROR logs in log directory. ObWarningBuffer::set_warn_log_on(true); if (OB_SUCC(ret)) { + const bool embed_mode = opts->embed_mode_; + const bool initialize = opts->initialize_; // Create worker to make this thread having a binding // worker. When ObThWorker is creating, it'd be aware of this // thread has already had a worker, which can prevent binding @@ -628,15 +483,26 @@ int inner_main(int argc, char *argv[]) // to speed up bootstrap phase, need set election INIT TS // to count election keep silence time as soon as possible after observer process started ATOMIC_STORE(&palf::election::INIT_TS, palf::election::get_monotonic_ts()); - if (OB_FAIL(observer.init(opts, log_cfg))) { + if (OB_FAIL(observer.init(*opts, log_cfg))) { LOG_ERROR("observer init fail", K(ret)); - raise(SIGKILL); // force stop when fail - } else if (OB_FAIL(observer.start())) { + } + OB_DELETE(ObServerOptions, mem_attr, opts); + if (OB_FAIL(ret)) { + } else if (OB_FAIL(observer.start(embed_mode))) { LOG_ERROR("observer start fail", K(ret)); - raise(SIGKILL); // force stop when fail + } else if (initialize) { + MPRINT("observer initialized successfully, you can start observer server now"); + _exit(0); } else if (OB_FAIL(observer.wait())) { LOG_ERROR("observer wait fail", K(ret)); } + + if (OB_FAIL(ret)) { + if (initialize) { + MPRINT("observer start failed. Please check the log file for details."); + } + _exit(1); + } print_all_thread("BEFORE_DESTROY", OB_SERVER_TENANT_ID); observer.destroy(); } diff --git a/src/observer/mysql/ob_async_cmd_driver.cpp b/src/observer/mysql/ob_async_cmd_driver.cpp index 024f31631..da0d9710a 100644 --- a/src/observer/mysql/ob_async_cmd_driver.cpp +++ b/src/observer/mysql/ob_async_cmd_driver.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/mysql/ob_async_cmd_driver.h b/src/observer/mysql/ob_async_cmd_driver.h index e5f211702..dc4c661cc 100644 --- a/src/observer/mysql/ob_async_cmd_driver.h +++ b/src/observer/mysql/ob_async_cmd_driver.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_ASYNC_CMD_DRIVER_ diff --git a/src/observer/mysql/ob_async_plan_driver.cpp b/src/observer/mysql/ob_async_plan_driver.cpp index 3b18f2df1..ea873389f 100644 --- a/src/observer/mysql/ob_async_plan_driver.cpp +++ b/src/observer/mysql/ob_async_plan_driver.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -42,9 +46,9 @@ int ObAsyncPlanDriver::response_result(ObMySQLResultSet &result) { ACTIVE_SESSION_FLAG_SETTER_GUARD(in_sql_execution); int ret = OB_SUCCESS; - // result.open 后 pkt_param 所需的 last insert id 等各项参数都已经计算完毕 - // 对于异步增删改的情况,需要提前update last insert id,以确保回调pkt_param参数正确 - // 后续result set close的时候,还会进行一次store_last_insert_id的调用 + // After result.open, all required parameters such as last insert id for pkt_param have been calculated + // For asynchronous add, delete, and modify operations, it is necessary to update the last insert id in advance to ensure the pkt_param parameter is correct in the callback + // After the result set is closed, store_last_insert_id will be called again ObCurTraceId::TraceId *cur_trace_id = NULL; if (OB_ISNULL(cur_trace_id = ObCurTraceId::get_trace_id())) { ret = OB_ERR_UNEXPECTED; @@ -54,24 +58,24 @@ int ObAsyncPlanDriver::response_result(ObMySQLResultSet &result) } else if (OB_FAIL(result.update_last_insert_id_to_client())) { LOG_WARN("failed to update last insert id after open", K(ret)); } else { - // open 成功,允许异步回包 + // open success, allow asynchronous response result.set_end_trans_async(true); } if (OB_SUCCESS != ret) { - // 如果try_again为true,说明这条SQL需要重做。考虑到重做之前我们需要回滚整个事务,会调用EndTransCb - // 所以这里设置一个标记,告诉EndTransCb这种情况下不要给客户端回包。 + // If try_again is true, it means this SQL needs to be redone. Considering that we need to roll back the entire transaction before redoing, EndTransCb will be called + // So here we set a flag to tell EndTransCb not to send a response to the client in this case. int cli_ret = OB_SUCCESS; retry_ctrl_.test_and_save_retry_state(gctx_, ctx_, result, ret, cli_ret); if (retry_ctrl_.need_retry()) { result.set_will_retry(); result.set_end_trans_async(false); } - // close背后的故事: + // the story behind close: // if (try_again) { - // result.close()结束后返回到这里,然后运行重试逻辑 + // return here after result.close() ends, then run the retry logic // } else { - // result.close()结束后,process流程应该干净利落地结束,有什么事留到callback里面做 + // After result.close() ends, the process flow should end cleanly, leave everything else to be done in the callback // } int cret = result.close(); if (retry_ctrl_.need_retry()) { @@ -84,12 +88,12 @@ int ObAsyncPlanDriver::response_result(ObMySQLResultSet &result) ret = cli_ret; } else if (is_prexecute_ && OB_FAIL(response_query_header(result, false, false, true))) { /* - * prexecute 仅在执行成功时候发送 header 包 - * 执行失败时候有两种表现 - * 1. 只返回一个 error 包, 这个时候需要注意 ps stmt 的泄漏问题 - * 2. 重试, local 重试直接交给上层做, package 重试需要 注意 ps stmt 的泄漏问题 - * 3. response_query_header & flush_buffer 不会产生需要重试的报错,此位置是 ObAsyncPlanDriver 重试前的一步,中间不会有别的可能重试的操作 - * 4. ps stmt 清理要注意异步回包的情况,可能需要在异步包里面做清理 + * prexecute only sends the header packet when execution is successful + * There are two manifestations when execution fails + * 1. Only an error packet is returned, at which point attention should be paid to the leakage of ps stmt + * 2. Retry, local retries are directly handed over to the upper layer, package retries need to pay attention to the leakage of ps stmt + * 3. response_query_header & flush_buffer will not produce errors that require retry, this position is one step before ObAsyncPlanDriver retries, with no other possible retry operations in between + * 4. Cleaning up ps stmt needs to consider the situation of asynchronous responses, and cleanup may need to be done within the asynchronous packets */ // need close result set int close_ret = OB_SUCCESS; @@ -103,14 +107,14 @@ int ObAsyncPlanDriver::response_result(ObMySQLResultSet &result) } else if (OB_FAIL(result.close())) { LOG_WARN("result close failed, let's leave process(). EndTransCb will clean this mess", K(ret)); } else { - // async 并没有调用 ObSqlEndTransCb 回复 OK 包 - // 所以 二合一协议的 OK 包也要放在这里处理 + // async did not call ObSqlEndTransCb to reply OK package + // So the OK packet of the combined protocol should also be handled here if (is_prexecute_) { if (stmt::T_SELECT == result.get_stmt_type()) { ret = OB_ERR_UNEXPECTED; LOG_WARN("select stmt do not use async plan in prexecute.", K(ret)); } else if (!result.is_async_end_trans_submitted()) { - // is_async_end_trans_submitted 表示异步回包准备好了 + // is_async_end_trans_submitted indicates that the asynchronous response is ready ObOKPParam ok_param; ok_param.affected_rows_ = result.get_affected_rows(); ok_param.is_partition_hit_ = session_.partition_hit().get_bool(); @@ -122,10 +126,9 @@ int ObAsyncPlanDriver::response_result(ObMySQLResultSet &result) } } } - - // 仅在end_trans执行后(无论成功与否)才会设置,意味着一定会回调 - // 之所以设计这么一个值,是因为open/close可能“半途而废”,根本没走到 - // end_trans()接口。这个变量相当于一个最终的确认。 + // Only set after end_trans is executed (regardless of success or failure), meaning a callback will definitely occur + // The reason for designing this value is that open/close might "fall short" and never actually reach the end + // end_trans() interface. This variable acts as a final confirmation. bool async_resp_used = result.is_async_end_trans_submitted(); if (async_resp_used && retry_ctrl_.need_retry()) { LOG_ERROR("the async request is ok, couldn't send request again"); @@ -137,18 +140,17 @@ int ObAsyncPlanDriver::response_result(ObMySQLResultSet &result) if (OB_TIMEOUT == ret && session_.is_user_session()) { LOG_USER_ERROR(OB_TIMEOUT, THIS_WORKER.get_timeout_ts() - session_.get_query_start_time()); } - - // 错误处理,没有走异步的时候负责回错误包 + // Error handling, responsible for returning error packets when not going asynchronous if (!OB_SUCC(ret) && !async_resp_used && !retry_ctrl_.need_retry()) { int sret = OB_SUCCESS; bool is_partition_hit = session_.get_err_final_partition_hit(ret); if (OB_SUCCESS != (sret = sender_.send_error_packet(ret, NULL, is_partition_hit))) { LOG_WARN("send error packet fail", K(sret), K(ret)); } - //根据与事务层的约定,无论end_participant和end_stmt是否成功, - //判断事务commit或回滚是否成功都只看最后的end_trans是否成功, - //而SQL是要保证一定要调到end_trans的,调end_trans的时候判断了是否需要断连接, - //所以这里不需要判断是否需要断连接了 + //According to the agreement with the transaction layer, regardless of whether end_participant and end_stmt succeed or not, + //Determine whether the transaction commit or rollback is successful by only checking if the final end_trans is successful, + // and SQL must ensure that end_trans is called, when calling end_trans it checks if the connection needs to be terminated, + //So here there is no need to check if the connection needs to be terminated } return ret; } diff --git a/src/observer/mysql/ob_async_plan_driver.h b/src/observer/mysql/ob_async_plan_driver.h index e48077ad0..7dc40caee 100644 --- a/src/observer/mysql/ob_async_plan_driver.h +++ b/src/observer/mysql/ob_async_plan_driver.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_ASYNC_PLAN_DRIVER_ diff --git a/src/observer/mysql/ob_construct_queue.cpp b/src/observer/mysql/ob_construct_queue.cpp index 48abd475a..9d4684628 100644 --- a/src/observer/mysql/ob_construct_queue.cpp +++ b/src/observer/mysql/ob_construct_queue.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -63,4 +67,4 @@ void ObConstructQueueTask::runTimerTask() } else if (OB_FAIL(request_manager_->get_queue().prepare_alloc_queue())) { LOG_WARN("fail to prepare alloc queue", K(ret)); } -} \ No newline at end of file +} diff --git a/src/observer/mysql/ob_construct_queue.h b/src/observer/mysql/ob_construct_queue.h index 35ebc4de4..4cbf8ae35 100644 --- a/src/observer/mysql/ob_construct_queue.h +++ b/src/observer/mysql/ob_construct_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_CONSTRUCT_QUEUE_ diff --git a/src/observer/mysql/ob_diag.h b/src/observer/mysql/ob_diag.h index d8342325f..9aa25f85e 100644 --- a/src/observer/mysql/ob_diag.h +++ b/src/observer/mysql/ob_diag.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_DIAG_H_ diff --git a/src/observer/mysql/ob_dl_queue.cpp b/src/observer/mysql/ob_dl_queue.cpp index f612db95d..6d4774fa8 100644 --- a/src/observer/mysql/ob_dl_queue.cpp +++ b/src/observer/mysql/ob_dl_queue.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -384,4 +388,4 @@ int ObDlQueue::release_record(int64_t release_cnt, } }; // end namespace common -}; // end namespace oceanbase \ No newline at end of file +}; // end namespace oceanbase diff --git a/src/observer/mysql/ob_dl_queue.h b/src/observer/mysql/ob_dl_queue.h index 15152c304..d7667b3bc 100644 --- a/src/observer/mysql/ob_dl_queue.h +++ b/src/observer/mysql/ob_dl_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_MYSQL_OB_DL_QUEUE_H_ diff --git a/src/observer/mysql/ob_eliminate_task.cpp b/src/observer/mysql/ob_eliminate_task.cpp index 612864de6..a86b7ecbc 100644 --- a/src/observer/mysql/ob_eliminate_task.cpp +++ b/src/observer/mysql/ob_eliminate_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -52,8 +56,7 @@ int ObEliminateTask::init(const ObMySQLRequestManager *request_manager) } return ret; } - -// 检查配置内存限时是否更改:mem_limit = tenant_mem_limit * ob_sql_audit_percentage +// Check if the configuration memory limit has changed: mem_limit = tenant_mem_limit * ob_sql_audit_percentage int ObEliminateTask::check_config_mem_limit(bool &is_change) { const int64_t MINIMUM_LIMIT = 64 * 1024 * 1024; // at lease 64M @@ -67,7 +70,7 @@ int ObEliminateTask::check_config_mem_limit(bool &is_change) LOG_WARN("invalid argument", K(request_manager_), K(ret)); } else if (FALSE_IT(tenant_id = request_manager_->get_tenant_id())) { } else if (tenant_id > OB_SYS_TENANT_ID && tenant_id <= OB_MAX_RESERVED_TENANT_ID) { - // 50x租户在没有对应的tenant schema,查询配置一定失败 + // 50x tenant does not have a corresponding tenant schema, the query configuration will definitely fail // do nothing } else if (OB_FAIL(ObMySQLRequestManager::get_mem_limit(tenant_id, mem_limit))) { // if memory limit is not retrivable @@ -87,13 +90,12 @@ int ObEliminateTask::check_config_mem_limit(bool &is_change) } return ret; } - -//剩余内存淘汰曲线图,当mem_limit在[64M, 100M]时, 内存剩余20M时淘汰; -// 当mem_limit在[100M, 5G]时, 内存甚于mem_limit*0.2时淘汰; -// 当mem_limit在[5G, +∞]时, 内存剩余1G时淘汰; -//高低水位线内存差曲线图,当mem_limit在[64M, 100M]时, 内存差为:20M; -// 当mem_limit在[100M, 5G]时,内存差:mem_limit*0.2; -// 当mem_limit在[5G, +∞]时, 内存差是:1G, +//Remaining memory eviction curve chart, when mem_limit is in [64M, 100M], evict when 20M memory remains; +// When mem_limit is in [100M, 5G], evict when memory usage exceeds mem_limit * 0.2; +// When mem_limit is in [5G, +∞], evict when 1G of memory remains; +//High and low water level memory difference curve chart, when mem_limit is in [64M, 100M], the memory difference is: 20M; +// When mem_limit is in [100M, 5G], memory difference: mem_limit*0.2; +// When mem_limit is in [5G, +∞], the memory difference is: 1G, // ______ // / // _____/ @@ -176,7 +178,7 @@ void ObEliminateTask::runTimerTask() if (OB_SUCC(ret)) { int64_t start_time = ObTimeUtility::current_time(); int64_t evict_batch_count = 0; - //按内存淘汰 + //Evict by memory if (evict_high_mem_level < allocator->allocated()) { LOG_INFO("sql audit evict mem start", K(request_manager_->get_tenant_id()), @@ -209,8 +211,7 @@ void ObEliminateTask::runTimerTask() last_time_allocated = allocator->allocated(); } } - - //如果sql_audit_memory_limit改变, 则需要将ObConcurrentFIFOAllocator中total_limit_更新; + //If sql_audit_memory_limit changes, then total_limit_ in ObConcurrentFIFOAllocator needs to be updated; if (true == is_change) { allocator->set_total_limit(config_mem_limit_); } diff --git a/src/observer/mysql/ob_eliminate_task.h b/src/observer/mysql/ob_eliminate_task.h index 34ab16ae6..565855fab 100644 --- a/src/observer/mysql/ob_eliminate_task.h +++ b/src/observer/mysql/ob_eliminate_task.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_ELIMINATE_TASK_ diff --git a/src/observer/mysql/ob_feedback_proxy_info.h b/src/observer/mysql/ob_feedback_proxy_info.h index 5bad91823..e05e53588 100644 --- a/src/observer/mysql/ob_feedback_proxy_info.h +++ b/src/observer/mysql/ob_feedback_proxy_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_FEEDBACK_PROXY_INFO_H diff --git a/src/observer/mysql/ob_feedback_proxy_utils.cpp b/src/observer/mysql/ob_feedback_proxy_utils.cpp index 86302c4ff..1885ccf0a 100644 --- a/src/observer/mysql/ob_feedback_proxy_utils.cpp +++ b/src/observer/mysql/ob_feedback_proxy_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL diff --git a/src/observer/mysql/ob_feedback_proxy_utils.h b/src/observer/mysql/ob_feedback_proxy_utils.h index b64e54b5d..6fbe515aa 100644 --- a/src/observer/mysql/ob_feedback_proxy_utils.h +++ b/src/observer/mysql/ob_feedback_proxy_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_FEEDBACK_PROXY_UTILS_H diff --git a/src/observer/mysql/ob_mysql_end_trans_cb.cpp b/src/observer/mysql/ob_mysql_end_trans_cb.cpp index 21d9def93..3e337e7c9 100644 --- a/src/observer/mysql/ob_mysql_end_trans_cb.cpp +++ b/src/observer/mysql/ob_mysql_end_trans_cb.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -38,7 +42,7 @@ int ObSqlEndTransCb::set_packet_param(const sql::ObEndTransCbPacketParam &pkt_pa ret = OB_ERR_UNEXPECTED; SERVER_LOG(ERROR, "invalid copy", K(ret)); } else { - pkt_param_ = pkt_param; //! 拷贝语义 + pkt_param_ = pkt_param; //! Copy semantics } return ret; } @@ -74,11 +78,11 @@ void ObSqlEndTransCb::callback(int cb_param) sql::ObSqlTransControl::reset_session_tx_state(session_info, reuse_tx); sessid = session_info->get_server_sid(); proxy_sessid = session_info->get_proxy_sessid(); - // 临界区内检查这些变量,预防并发callback造成的不良影响 + // Check these variables within the critical section to prevent adverse effects caused by concurrent callbacks if (OB_UNLIKELY(!pkt_param_.is_valid())) { ret = OB_ERR_UNEXPECTED; SERVER_LOG(ERROR, "pkt_param_ is invalid", K(ret), K(pkt_param_)); - } else if (FALSE_IT(ObCurTraceId::set(pkt_param_.get_trace_id()))) { // 尽早设置trace_id + } else if (FALSE_IT(ObCurTraceId::set(pkt_param_.get_trace_id()))) { // set trace_id as early as possible //do nothing } else if (!packet_sender_.is_conn_valid()) { //network problem, callback will still be called @@ -152,7 +156,7 @@ void ObSqlEndTransCb::callback(int cb_param) ob_setup_tsi_warning_buffer(NULL); - pkt_param_.reset(); // 过期作废,再次调callback的时候必须重新设置参数 + pkt_param_.reset(); // expired and invalid, parameters must be reset again when callback is called need_disconnect_ = false; sess_info_ = NULL; packet_sender_.reset(); diff --git a/src/observer/mysql/ob_mysql_end_trans_cb.h b/src/observer/mysql/ob_mysql_end_trans_cb.h index 9a3fd9c15..eacb7c1c8 100644 --- a/src/observer/mysql/ob_mysql_end_trans_cb.h +++ b/src/observer/mysql/ob_mysql_end_trans_cb.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_MYSQL_OB_MYSQL_END_TRANS_CB_CPP_ diff --git a/src/observer/mysql/ob_mysql_request_manager.cpp b/src/observer/mysql/ob_mysql_request_manager.cpp index da88b977c..7c38be47e 100644 --- a/src/observer/mysql/ob_mysql_request_manager.cpp +++ b/src/observer/mysql/ob_mysql_request_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -249,7 +253,7 @@ int ObMySQLRequestManager::record_request(const ObAuditRecordData &audit_record, free(record); record = NULL; } else if (OB_FAIL(queue_.push(record, record->data_.request_id_))) { - //sql audit槽位已满时会push失败, 依赖后台线程进行淘汰获得可用槽位 + //sql audit slot will push fail when full, relying on background thread to evict and obtain available slots if (REACH_TIME_INTERVAL(2 * 1000 * 1000)) { SERVER_LOG(WARN, "push into queue failed", K(ret)); } diff --git a/src/observer/mysql/ob_mysql_request_manager.h b/src/observer/mysql/ob_mysql_request_manager.h index 163d9d431..70f7113dd 100644 --- a/src/observer/mysql/ob_mysql_request_manager.h +++ b/src/observer/mysql/ob_mysql_request_manager.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_MYSQL_OB_MYSQL_REQUEST_MANAGER_H_ @@ -77,17 +81,17 @@ class ObMySQLRequestManager static const int64_t MAX_PARAM_BUF_SIZE = 64 * 1024; static const int32_t MAX_RELEASE_TIME = 5 * 1000; //5ms static const int64_t US_PER_HOUR = 3600000000; - //初始化queue大小,常规模式1000w,mini模式10w + //Initialize queue size, regular mode 10 million, mini mode 1 million static const int64_t MAX_QUEUE_SIZE = 10000000; //1000w static const int64_t MINI_MODE_MAX_QUEUE_SIZE = 100000; // 10w - //按行淘汰的高低水位线,以queue大小的百分比设定 + //High and low watermarks for line-by-line eviction, set as a percentage of queue size static constexpr float HIGH_LEVEL_EVICT_PERCENTAGE = 0.9; // 90% static constexpr float LOW_LEVEL_EVICT_PERCENTAGE = 0.8; // 80% - //每进行一次release_old操作删除的sql_audit百分比 + //Percentage of sql_audit deleted per release_old operation static const int64_t BATCH_RELEASE_SIZE = 64 * 1024; //32k static const int64_t MINI_MODE_BATCH_RELEASE_SIZE = 4 * 1024; //4k static const int64_t CONSTRUCT_EVICT_INTERVAL = 500000; //0.5s - //启动淘汰检查的时间间隔 + //Start the time interval for eviction check static const int64_t EVICT_INTERVAL = 500000; //1s typedef common::ObDlQueue::DlRef DlRef; typedef lib::ObLockGuard LockGuard; diff --git a/src/observer/mysql/ob_mysql_result_set.cpp b/src/observer/mysql/ob_mysql_result_set.cpp index c639c218c..1bc9e93fd 100644 --- a/src/observer/mysql/ob_mysql_result_set.cpp +++ b/src/observer/mysql/ob_mysql_result_set.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -40,7 +44,7 @@ int ObMySQLResultSet::to_mysql_field(const ObField &field, ObMySQLField &mfield) mfield.length_ = field.length_; ObScale decimals = mfield.accuracy_.get_scale(); ObPrecision pre = mfield.accuracy_.get_precision(); - // TIMESTAMP、UNSIGNED通过map直接映射 + // TIMESTAMP, UNSIGNED are directly mapped through map if (0 == field.type_name_.case_compare("SYS_REFCURSOR")) { mfield.type_ = MYSQL_TYPE_CURSOR; } else { @@ -116,7 +120,7 @@ int ObMySQLResultSet::to_oracle_field(const ObField &field, ObMySQLField &mfield mfield.length_ = field.length_; ObScale decimals = mfield.accuracy_.get_scale(); ObPrecision pre = mfield.accuracy_.get_precision(); - // TIMESTAMP、UNSIGNED通过map直接映射 + // TIMESTAMP, UNSIGNED are directly mapped through map if (0 == field.type_name_.case_compare("SYS_REFCURSOR")) { mfield.type_ = MYSQL_TYPE_CURSOR; } else { diff --git a/src/observer/mysql/ob_mysql_result_set.h b/src/observer/mysql/ob_mysql_result_set.h index d6a1b5fa6..58775d8fe 100644 --- a/src/observer/mysql/ob_mysql_result_set.h +++ b/src/observer/mysql/ob_mysql_result_set.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_MYSQL_RESULT_SET_H_ @@ -38,9 +42,9 @@ class ObMySQLResultSet { public: /** - * 构造函数 + * Constructor * - * @param [in] obrs SQL执行起返回的数据集 + * @param [in] obrs Dataset returned by SQL execution */ ObMySQLResultSet(sql::ObSQLSessionInfo &session, common::ObIAllocator &allocator) : ObResultSet(session, allocator), field_index_(0), param_index_(0), has_more_result_(false) @@ -49,16 +53,16 @@ class ObMySQLResultSet } /** - * 析构函数 + * Destructor */ virtual ~ObMySQLResultSet() {}; /** - * 返回下一个字段的信息 + * Return the information of the next field * - * @param [out] obmf 下一个字段的信息 + * @param [out] obmf Information of the next field * - * @return 成功返回OB_SUCCESS。如果没有数据,则返回Ob_ITER_END + * @return Returns OB_SUCCESS on success. If there is no data, returns Ob_ITER_END */ int next_field(ObMySQLField &obmf); @@ -71,7 +75,7 @@ class ObMySQLResultSet int next_param(ObMySQLField &obmf); /** - * 对于Multi-Query,指示是否为最后一个resultset + * For Multi-Query, indicates whether it is the last resultset */ bool has_more_result() const { @@ -83,11 +87,11 @@ class ObMySQLResultSet } /** - * 获取下一行的数据 + * Get the data of the next row * - * @param [out] obmr 下一行数据 + * @param [out] obmr Data of the next row * - * @return 成功返回OB_SUCCESS。如果没有数据,则返回Ob_ITER_END + * @return Returns OB_SUCCESS on success. If there is no data, returns Ob_ITER_END */ int next_row(const ObNewRow *&obmr); int64_t to_string(char *buf, const int64_t buf_len) const; @@ -98,8 +102,8 @@ class ObMySQLResultSet static void switch_ps(ObPrecision &pre, ObScale &scale, EMySQLFieldType type); private: - int64_t field_index_; /**< 下一个需要读取的字段的序号 */ - int64_t param_index_; /* < 下一个需要读取的参数的序号*/ + int64_t field_index_; /**< The index of the next field to be read */ + int64_t param_index_; /* < The index of the next parameter to be read */ bool has_more_result_; }; // end class ObMySQLResultSet diff --git a/src/observer/mysql/ob_query_driver.cpp b/src/observer/mysql/ob_query_driver.cpp index 33c746ce4..6505b8921 100644 --- a/src/observer/mysql/ob_query_driver.cpp +++ b/src/observer/mysql/ob_query_driver.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -37,7 +41,7 @@ int ObQueryDriver::response_query_header(ObResultSet &result, { int ret = OB_SUCCESS; if (is_prexecute_) { - // 二合一协议发送 header 包, 不单独发送 column + // Two-in-one protocol sends header package, does not send column separately if (OB_FAIL(static_cast(sender_).response_query_header(session_, result, need_flush_buffer))) { LOG_WARN("prexecute response query head fail. ", K(ret)); } @@ -78,17 +82,16 @@ int ObQueryDriver::response_query_header(const ColumnsFieldIArray &fields, } else if (OB_FAIL(session_.get_autocommit(ac))) { LOG_WARN("fail to get autocommit", K(ret)); } else if (!(NULL != result && result->get_is_com_filed_list())) { - // 普通协议发送 cnt 值 + // Normal protocol sends cnt value OMPKResheader rhp; rhp.set_field_count(fields.count()); if (OB_FAIL(sender_.response_packet(rhp, &session_))) { LOG_WARN("response packet fail", K(ret)); } } else { - // com field 协议在这里什么都不发,直接发送 field 信息 + // com field protocol sends nothing here, directly sending field information } - - // 发送 field 信息 + // send field information if (OB_SUCC(ret)) { for (int64_t i = 0; OB_SUCC(ret) && i < fields.count(); ++i) { bool is_not_match = false; @@ -140,7 +143,7 @@ int ObQueryDriver::response_query_header(const ColumnsFieldIArray &fields, flags.status_flags_.OB_SERVER_STATUS_AUTOCOMMIT = (ac ? 1 : 0); flags.status_flags_.OB_SERVER_MORE_RESULTS_EXISTS = has_more_result; flags.status_flags_.OB_SERVER_PS_OUT_PARAMS = need_set_ps_out_flag ? 1 : 0; - // NULL == result 说明是老协议 ps cursor execute 回包,或者fetch 协议回包, cursor_exit = true + // NULL == result indicates it is an old protocol ps cursor execute response, or fetch protocol response, cursor_exit = true flags.status_flags_.OB_SERVER_STATUS_CURSOR_EXISTS = NULL == result ? 1 : 0; if (!session_.is_obproxy_mode()) { // in java client or others, use slow query bit to indicate partition hit or not @@ -149,8 +152,8 @@ int ObQueryDriver::response_query_header(const ColumnsFieldIArray &fields, eofp.set_server_status(flags); if (ps_cursor_execute && sender_.need_send_extra_ok_packet()) { - // 老协议 ps cursor execute 回包, 只回 field 信息, 所以对于 proxy , 需要额外回一个 OK包 - // 但是由于 2.0 协议需要在回 OK 包的同时了解 EOF 包的情况,所以这个 OK 包没办法抽到 execute 协议层处理 + // Old protocol ps cursor execute response, only returns field information, so for proxy, an additional OK packet needs to be returned + // However, since the 2.0 protocol needs to understand the EOF packet situation at the same time as sending an OK packet, this OK packet cannot be extracted to the execute protocol layer for processing if (OB_FAIL(sender_.update_last_pkt_pos())) { LOG_WARN("failed to update last packet pos", K(ret)); } else { @@ -230,10 +233,10 @@ int ObQueryDriver::response_query_result(ObResultSet &result, LOG_DEBUG("is_prexecute_ and row_num is equal with limit_count", K(limit_count)); break; } - // 如果是第一行,则先给客户端回复field等信息 + // If it is the first line, then reply to the client with field information etc. if (is_first_row) { is_first_row = false; - can_retry = false; // 已经获取到第一行数据,不再重试了 + can_retry = false; // Already obtained the first row of data, no longer retrying if (OB_FAIL(response_query_header(result, has_more_result, false))) { LOG_WARN("fail to response query header", K(ret), K(row_num), K(can_retry)); } @@ -315,7 +318,7 @@ int ObQueryDriver::response_query_result(ObResultSet &result, LOG_WARN("fail to iterate and response", K(ret), K(row_num), K(can_retry)); } if (OB_SUCC(ret) && 0 == row_num) { - // 如果是一行数据也没有,则还是要给客户端回复field等信息,并且不再重试了 + // If there is no data at all, we still need to reply to the client with field information, and no more retries will be attempted can_retry = false; if (OB_FAIL(response_query_header(result, has_more_result, false))) { LOG_WARN("fail to response query header", K(ret), K(row_num), K(can_retry)); @@ -470,8 +473,8 @@ int ObQueryDriver::convert_lob_locator_to_longtext(ObObj& value, ObIAllocator *allocator) { int ret = OB_SUCCESS; - // 如果客户端使用新的lob locator, 则返回lob locator数据 - // 如果客户端使用老的lob(没有locator头, 仅数据), 则返回老的lob + // If the client uses the new lob locator, then return the lob locator data + // If the client uses the old lob (without locator header, only data), then return the old lob if (lib::is_mysql_mode()) { // do nothing for mysql } @@ -736,9 +739,9 @@ int ObQueryDriver::convert_text_value_charset(ObObj& value, return ret; } -/*@brief:is_com_filed_list_match_wildcard_str 用于匹配client发过来的COM_FIELD_LIST中包含的参数中有匹配符 -* 情形,eg:COM_FIELD_LIST(t1, c*) , t1 中有c1,c2,pk 三列 ==> 仅返回c1, c2,不返回 pk,因为他和 c* 不匹配; -* 其规则类似于like情形;详细参考链接: +/*@brief: is_com_filed_list_match_wildcard_str is used to match the parameters in the COM_FIELD_LIST sent by the client that contain wildcard characters +* Scenario, e.g.: COM_FIELD_LIST(t1, c*) , t1 has columns c1, c2, pk ==> only return c1, c2, do not return pk, because it does not match c*; +* The rule is similar to the like scenario; for details, refer to the link: * */ int ObQueryDriver::is_com_filed_list_match_wildcard_str(ObResultSet &result, @@ -751,7 +754,7 @@ int ObQueryDriver::is_com_filed_list_match_wildcard_str(ObResultSet &result, if (!result.get_is_com_filed_list() || result.get_wildcard_string().empty()) { /*do nothing*/ } else { - /*需要考虑不同的字符集之间进行比较时需要转换为同一种字符集进行比较*/ + /*Need to consider converting to the same character set for comparison when comparing between different character sets*/ ObIAllocator &allocator = result.get_mem_pool(); ObString wildcard_str; if (result.get_session().get_nls_collation() != from_collation) { diff --git a/src/observer/mysql/ob_query_driver.h b/src/observer/mysql/ob_query_driver.h index e0baf6d1d..720d8af18 100644 --- a/src/observer/mysql/ob_query_driver.h +++ b/src/observer/mysql/ob_query_driver.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_QUERY_DRIVER_ diff --git a/src/observer/mysql/ob_query_response_time.cpp b/src/observer/mysql/ob_query_response_time.cpp index 22afcd666..e5511cfbc 100644 --- a/src/observer/mysql/ob_query_response_time.cpp +++ b/src/observer/mysql/ob_query_response_time.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL #include "ob_query_response_time.h" diff --git a/src/observer/mysql/ob_query_response_time.h b/src/observer/mysql/ob_query_response_time.h index 40f554ca3..4896774e3 100644 --- a/src/observer/mysql/ob_query_response_time.h +++ b/src/observer/mysql/ob_query_response_time.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef DEF_RESP_TIME_SQL_TYPE diff --git a/src/observer/mysql/ob_query_retry_ctrl.cpp b/src/observer/mysql/ob_query_retry_ctrl.cpp index 776b9a20c..3122d1fb9 100644 --- a/src/observer/mysql/ob_query_retry_ctrl.cpp +++ b/src/observer/mysql/ob_query_retry_ctrl.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -40,7 +44,7 @@ void ObRetryPolicy::try_packet_retry(ObRetryParam &v) const // in batch optimization, can't do packet retry v.retry_type_ = RETRY_TYPE_LOCAL; } else if (multi_stmt_item.is_part_of_multi_stmt() && multi_stmt_item.get_seq_num() > 0) { - // muti stmt,并且不是第一句,不能扔回队列重试,因为前面的无法回滚 + // multi stmt, and not the first statement, cannot be put back in the queue for retry, because the previous ones cannot be rolled back v.retry_type_ = RETRY_TYPE_LOCAL; } else if (!THIS_WORKER.can_retry()) { // false == THIS_WORKER.can_retry() means throw back to queue disabled by SOME logic @@ -242,8 +246,8 @@ class ObBeforeRetryCheckPolicy : public ObRetryPolicy K(THIS_WORKER.get_timeout_ts()), K(v.result_.get_stmt_type()), K(v.session_.get_retry_info().get_last_query_retry_err())); if (v.session_.get_retry_info().is_rpc_timeout() || is_transaction_rpc_timeout_err(v.err_)) { - // rpc超时了,可能是location cache不对,异步刷新location cache - v.result_.force_refresh_location_cache(true, v.err_); // 非阻塞 + // rpc timeout, possibly due to incorrect location cache, asynchronously refresh location cache + v.result_.force_refresh_location_cache(true, v.err_); // non-blocking LOG_WARN("sql rpc timeout, or trans rpc timeout, maybe location is changed, " "refresh location cache non blockly", K(v), K(v.session_.get_retry_info().is_rpc_timeout())); @@ -330,7 +334,7 @@ class ObCheckSchemaUpdatePolicy : public ObRetryPolicy virtual void test(ObRetryParam &v) const override { int ret = OB_SUCCESS; - // 设计讨论参考: + // Design discussion reference: if (NULL == GCTX.schema_service_) { v.client_ret_ = OB_INVALID_ARGUMENT; v.retry_type_ = RETRY_TYPE_NONE; @@ -342,7 +346,7 @@ class ObCheckSchemaUpdatePolicy : public ObRetryPolicy int64_t local_sys_version_latest = 0; if (OB_FAIL(GCTX.schema_service_->get_tenant_schema_guard( v.session_.get_effective_tenant_id(), schema_guard))) { - // 不需要重试了,同时让它返回get_schema_guard出错的错误码,因为是由它引起不重试的 + // No need to retry, and let it return the error code from get_schema_guard because it is the cause of not retrying LOG_WARN("get schema guard failed", K(v), K(ret)); v.client_ret_ = ret; v.retry_type_ = RETRY_TYPE_NONE; @@ -366,15 +370,15 @@ class ObCheckSchemaUpdatePolicy : public ObRetryPolicy int64_t global_tenant_version_start = v.curr_query_tenant_global_schema_version_; int64_t local_sys_version_start = v.curr_query_sys_local_schema_version_; int64_t global_sys_version_start = v.curr_query_sys_global_schema_version_; - // (c1) 需要考虑远端机器的Schema比本地落后,远端机器抛出Schema错误的情景 - // 当远端抛出Schema错误的时候,强行将所有Schema错误转化成OB_ERR_WAIT_REMOTE_SCHEMA_REFRESH - // 权限不足也会触发该重试规则,因为远端schema刷新不及时可能误报权限不足,此时是需要重试的 - // (c4) 弱一致性读场景,会校验schema版本是否大于等于数据的schema版本, - // 如果schema版本旧,则要求重试; - // 目的是保证:始终采用新schema解析老数据 - // (c5) 梳理了OB_SCHEMA_EAGAIN使用的地方,主路径上出现了该错误码的地方需要触发SQL重试 - // (c2) 表存在或不存在/数据库存在或不存在/用户存在或不存在,并且local和global版本不等时重试 - // (c3) 其它任何sql开始执行时local version比当前local version小导致schema错误的情况 + // (c1) Need to consider the scenario where the remote machine's Schema is behind the local one, and the remote machine throws a Schema error + // When the remote throws a Schema error, forcibly convert all Schema errors into OB_ERR_WAIT_REMOTE_SCHEMA_REFRESH + // Insufficient permissions will also trigger this retry rule, because the remote schema refresh may be delayed and incorrectly report insufficient permissions, in which case a retry is needed + // (c4) Weak consistency read scenario, it will verify if the schema version is greater than or equal to the data's schema version, + // If the schema version is old, a retry is required; + // The purpose is to ensure: always use the new schema to parse old data + // (c5) Reviewed the usage of OB_SCHEMA_EAGAIN, this error code should trigger SQL retry where it appears on the main path + // (c2) table exists or not/database exists or not/user exists or not, and retry when local and global versions are not equal + // (c3) Any other SQL starts execution with a local version smaller than the current local version causing schema errors // (c6) For local server, related tenant's schema maybe not refreshed yet when observer restarts or create tenant. // (c7) For remote server, related tenant's schema maybe not refreshed yet when observer restarts or create tenant. if ((OB_ERR_WAIT_REMOTE_SCHEMA_REFRESH == v.err_) || // (c1) @@ -393,14 +397,14 @@ class ObCheckSchemaUpdatePolicy : public ObRetryPolicy try_packet_retry(v); } if (RETRY_TYPE_LOCAL == v.retry_type_) { - // 线性重试响应更快 + // Linear retry response is faster sleep_before_local_retry(v, RETRY_SLEEP_TYPE_LINEAR, WAIT_RETRY_SHORT_US, THIS_WORKER.get_timeout_ts()); } } else { - // 这里的client_ret不好决定,让它依然返回err + // Here the client_ret is hard to decide, let it still return err v.client_ret_ = v.err_; v.retry_type_ = RETRY_TYPE_NONE; v.no_more_test_ = true; @@ -466,8 +470,8 @@ class ObDMLPeerServerStateUncertainPolicy : public ObRetryPolicy ObPhyPlanType plan_type = v.result_.get_physical_plan()->get_plan_type(); bool in_transaction = v.session_.is_in_transaction(); if (ObSqlTransUtil::is_remote_trans(autocommit, in_transaction, plan_type)) { - // 当前observer内部无法进行重试 - // err是OB_RPC_CONNECT_ERROR + // The current observer cannot retry internally + // err is OB_RPC_CONNECT_ERROR v.client_ret_ = v.err_; v.retry_type_ = RETRY_TYPE_NONE; v.no_more_test_ = true; @@ -799,10 +803,10 @@ void ObQueryRetryCtrl::nonblock_location_error_proc(ObRetryParam &v) void ObQueryRetryCtrl::location_error_nothing_readable_proc(ObRetryParam &v) { - // 强一致性读的情况,主不可读了,有可能是invalid servers将主过滤掉了。 - // 弱一致性读的情况,没有副本可以选择了,有可能是invalid servers将所有副本都过滤掉了。 - // 为了更好地处理主短暂地断网的情况,将retry info清空(主要是invalid servers清空, - // 但是还是要保持inited的状态以便通过防御性检查,所以不能调reset,而是要调clear),然后再重试。 + // Strong consistency read scenario, the leader is not readable, it might be that invalid servers have filtered out the leader. + // The case of weak consistency read, where no replicas are available to choose from, possibly because invalid servers have filtered out all replicas. + // To better handle the situation where the leader is briefly offline, clear the retry info (mainly clearing invalid servers, + // But we still need to keep the inited state for defensive checks, so we cannot call reset, but should call clear), and then retry. v.session_.get_retry_info_for_update().clear(); location_error_proc(v); if (can_start_retry_wait_event(v.retry_type_)) { @@ -849,8 +853,8 @@ void ObQueryRetryCtrl::snapshot_discard_proc(ObRetryParam &v) v.retry_type_ = RETRY_TYPE_NONE; LOG_WARN_RET(v.client_ret_, "snapshot discarded in serializable isolation should not retry", K(v)); } else { - // 读到落后太多的备机或者正在回放日志的副本了 - // 副本不可读类型的错误最多在本线程重试1次。 + // Read a follower that is too far behind or a replica that is replaying logs + // The error of unreadable replica will be retried at most once in this thread. const int64_t MAX_DATA_NOT_READABLE_ERROR_LOCAL_RETRY_TIMES = 1; if (v.stmt_retry_times_ < MAX_DATA_NOT_READABLE_ERROR_LOCAL_RETRY_TIMES) { v.retry_type_ = RETRY_TYPE_LOCAL; @@ -934,8 +938,8 @@ void ObQueryRetryCtrl::inner_try_lock_row_conflict_proc(ObRetryParam &v) void ObQueryRetryCtrl::inner_table_location_error_proc(ObRetryParam &v) { - // 这种情况一般是内部sql执行的时候获取不到location,可能是宕机, - // 这里涉及到的是内部表,刷新本sql查询的表的location cache没有意义,因此不刷新。 + // This situation usually occurs when the internal SQL execution cannot obtain the location, possibly due to a shutdown, + // Here involves internal tables, refreshing the location cache of the table queried by this SQL is not meaningful, therefore it is not refreshed. ObRetryObject retry_obj(v); ObCommonRetryIndexLongWaitPolicy retry_long_wait; retry_obj.test(retry_long_wait); @@ -974,10 +978,10 @@ void ObQueryRetryCtrl::inner_location_error_proc(ObRetryParam &v) void ObQueryRetryCtrl::inner_location_error_nothing_readable_proc(ObRetryParam &v) { - // 强一致性读的情况,主不可读了,有可能是invalid servers将主过滤掉了。 - // 弱一致性读的情况,没有副本可以选择了,有可能是invalid servers将所有副本都过滤掉了。 - // 为了更好地处理主短暂地断网的情况,将retry info清空(主要是invalid servers清空, - // 但是还是要保持inited的状态以便通过防御性检查,所以不能调reset,而是要调clear),然后再重试。 + // Strong consistency read scenario, the leader is not readable, it might be that invalid servers have filtered out the leader. + // Weak consistency read scenario, no replicas are available to choose from, possibly because invalid servers filtered out all replicas. + // To better handle the situation where the leader is briefly offline, clear the retry info (mainly clearing invalid servers, + // But we still need to keep the inited state for defensive checks, so we cannot call reset, but should call clear), and then retry. v.session_.get_retry_info_for_update().clear(); inner_location_error_proc(v); if (can_start_retry_wait_event(v.retry_type_)) { @@ -1023,8 +1027,8 @@ void ObQueryRetryCtrl::inner_peer_server_status_uncertain_proc(ObRetryParam &v) void ObQueryRetryCtrl::empty_proc(ObRetryParam &v) { - // 根据"给用户返回导致不重试的最后一个错误码"的原则, - // 这里是err不在重试错误码列表中的情况,需要将client_ret设置为相应的值 + // According to the principle of "returning the last error code that causes no retry to the user", + // This is the case where err is not in the retry error code list, and client_ret needs to be set to the corresponding value v.client_ret_ = v.err_; v.retry_type_ = RETRY_TYPE_NONE; if (OB_ERR_PROXY_REROUTE != v.client_ret_) { @@ -1057,9 +1061,9 @@ void ObQueryRetryCtrl::after_func(ObRetryParam &v) if (OB_TRY_LOCK_ROW_CONFLICT == v.client_ret_ || OB_ERR_PROXY_REROUTE == v.client_ret_ || (v.is_from_pl_ && OB_READ_NOTHING == v.client_ret_)) { - //锁冲突不打印了,避免日志刷屏 - // 二次路由不打印 - // PL 里面的 OB_READ_NOTHING 不打印日志 + //Lock conflict will not be printed to avoid log flooding + // Secondary routing does not print + // PL inside the OB_READ_NOTHING does not print logs } else { LOG_WARN_RET(v.client_ret_, "[RETRY] check if need retry", K(v), "need_retry", RETRY_TYPE_NONE != v.retry_type_); } diff --git a/src/observer/mysql/ob_query_retry_ctrl.h b/src/observer/mysql/ob_query_retry_ctrl.h index 1ca03fb23..68af75d42 100644 --- a/src/observer/mysql/ob_query_retry_ctrl.h +++ b/src/observer/mysql/ob_query_retry_ctrl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OB_QUERY_RETRY_CTRL_ @@ -33,16 +37,16 @@ namespace observer class ObMySQLResultSet; enum ObQueryRetryType { - RETRY_TYPE_NONE, // 不重试 - RETRY_TYPE_LOCAL, // 在本线程重试 - RETRY_TYPE_PACKET, // 扔回队列中重试 + RETRY_TYPE_NONE, // no retry + RETRY_TYPE_LOCAL, // Retry in the same thread + RETRY_TYPE_PACKET, // retry in the queue }; enum RetrySleepType { RETRY_SLEEP_TYPE_NONE, // no sleep - RETRY_SLEEP_TYPE_LINEAR, // 线性重试 - RETRY_SLEEP_TYPE_INDEX, // 指数重试 + RETRY_SLEEP_TYPE_LINEAR, // linear retry + RETRY_SLEEP_TYPE_INDEX, // exponential retry }; struct ObRetryParam @@ -95,10 +99,10 @@ struct ObRetryParam const sql::ObSqlCtx &ctx_; sql::ObResultSet &result_; // for refresh location cache sql::ObSQLSessionInfo &session_; - const int64_t curr_query_tenant_local_schema_version_; // Query开始、Loc刷新前的普通租户shm ver - const int64_t curr_query_tenant_global_schema_version_; // Query开始时的普通租户schema version - const int64_t curr_query_sys_local_schema_version_; // Query开始、Loc刷新前的系统租户shm ver - const int64_t curr_query_sys_global_schema_version_; // Query开始时的系统租户schema version + const int64_t curr_query_tenant_local_schema_version_; // Schema version of the normal tenant shm before Query starts and Loc refreshes + const int64_t curr_query_tenant_global_schema_version_; // Schema version of the normal tenant at the start of the query + const int64_t curr_query_sys_local_schema_version_; // System tenant shm ver before Query starts and Loc refreshes + const int64_t curr_query_sys_global_schema_version_; // System tenant schema version at the start of the query const int64_t stmt_retry_times_; // statement retry times, including each retry, local or packet // note: PL block don't have a stmt_retry_times_ attribute const int64_t local_retry_times_; // local retry times, reset to zero when packet retry @@ -123,14 +127,14 @@ class ObRetryPolicy int64_t base_sleep_us, int64_t timeout_timestamp) const; public: - // schema类型的错误最多在本线程重试5次。 - // 5是拍脑袋决定的 + // The error of schema type will be retried at most 5 times in this thread. + // 5 is a gut feeling decision static const int64_t MAX_SCHEMA_ERROR_LOCAL_RETRY_TIMES = 5; // schema, rpc - // 1ms, schema刷新只需要一个RPC来回 + // 1ms, schema refresh only requires one RPC round trip static const uint32_t WAIT_RETRY_SHORT_US = 1 * 1000; // leader election - // 8ms, 选出新的主耗时是秒级别(宕机14s,主动切换2s) + // 8ms, the time to elect a new leader is in seconds level (outage 14s, active switch 2s) static const uint32_t WAIT_RETRY_LONG_US = 8 * 1000; private: static uint32_t linear_timeout_factor(uint64_t times, uint64_t threshold = 100) @@ -171,9 +175,8 @@ class ObQueryRetryCtrl static int init(); // must ensure calling destroy after all threads exit static void destroy(); - - //本接口目前在ObMPQuery和SPI使用,SPI使用的时候必须本地重试直至超时,所以需要传入force_local_retry为true - //force_local_retry为true时,不做try_packet_retry + //This interface is currently used in ObMPQuery and SPI, when used in SPI, local retry must be performed until timeout, so force_local_retry needs to be set to true + //when force_local_retry is true, do not perform try_packet_retry void test_and_save_retry_state(const ObGlobalContext &gctx, const sql::ObSqlCtx &ctx, sql::ObResultSet &result, @@ -276,16 +279,16 @@ class ObQueryRetryCtrl static void start_replica_not_readable_retry_wait_event(sql::ObSQLSessionInfo &session); static void start_other_retry_wait_event(sql::ObSQLSessionInfo &session, const int error_code); public: - // schema类型的错误最多在本线程重试5次。 - // 5是拍脑袋决定的,之后还要看统计数据的反馈再修改。TODO qianfu.zpf + // The error of schema type will be retried at most 5 times in this thread. + // 5 is a gut feeling decision, and will be modified based on feedback from statistical data. TODO qianfu.zpf static const int64_t MAX_SCHEMA_ERROR_LOCAL_RETRY_TIMES = 5; - // 副本不可读类型的错误最多在本线程重试1次。 + // The error of unreadable replica type will be retried at most once in this thread. static const int64_t MAX_DATA_NOT_READABLE_ERROR_LOCAL_RETRY_TIMES = 1; - // 1ms, schema刷新只需要一个RPC来回 + // 1ms, schema refresh only requires one RPC round trip static const uint32_t WAIT_LOCAL_SCHEMA_REFRESHED_US = 1 * 1000; - // 8ms, 选出新的主耗时是秒级别(宕机14s,主动切换2s) + // 8ms, time taken to elect a new leader is in seconds level (outage 14s, active switch 2s) static const uint32_t WAIT_NEW_MASTER_ELECTED_US = 8 * 1000; - // 1ms,重试write dml等待时间 + // 1ms, retry write dml wait time static const uint32_t WAIT_RETRY_WRITE_DML_US = 1 * 1000; public: @@ -335,13 +338,13 @@ class ObQueryRetryCtrl // map_ is used to fast lookup the error code retry processor typedef common::ObTuple RetryFuncs; static common::hash::ObHashMap map_; - int64_t curr_query_tenant_local_schema_version_; // Query开始、Loc刷新前的普通租户shm ver - int64_t curr_query_tenant_global_schema_version_; // Query开始时的普通租户schema version - int64_t curr_query_sys_local_schema_version_; // Query开始、Loc刷新前的系统租户shm ver - int64_t curr_query_sys_global_schema_version_; // Query开始时的系统租户schema version + int64_t curr_query_tenant_local_schema_version_; // Schema version of the normal tenant shm before Query starts and Loc refreshes + int64_t curr_query_tenant_global_schema_version_; // Schema version of the normal tenant at the start of the query + int64_t curr_query_sys_local_schema_version_; // System tenant shm ver before Query starts and Loc refreshes + int64_t curr_query_sys_global_schema_version_; // System tenant schema version at the start of the query int64_t retry_times_; ObQueryRetryType retry_type_; - int retry_err_code_; //记录重试时的错误码(目前用于区分复制表引起重试) + int retry_err_code_; // record the error code during retries (currently used to distinguish retries caused by table replication) /* disallow copy & assign */ DISALLOW_COPY_AND_ASSIGN(ObQueryRetryCtrl); }; diff --git a/src/observer/mysql/ob_ra_queue.h b/src/observer/mysql/ob_ra_queue.h index 6529afbe0..b1525c773 100644 --- a/src/observer/mysql/ob_ra_queue.h +++ b/src/observer/mysql/ob_ra_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_MYSQL_OB_RA_QUEUE_H_ diff --git a/src/observer/mysql/ob_sync_cmd_driver.cpp b/src/observer/mysql/ob_sync_cmd_driver.cpp index 0cdbf0212..e001789da 100644 --- a/src/observer/mysql/ob_sync_cmd_driver.cpp +++ b/src/observer/mysql/ob_sync_cmd_driver.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -123,7 +127,7 @@ int ObSyncCmdDriver::response_result(ObMySQLResultSet &result) OMPKEOF eofp; bool need_send_eof = false; if (OB_FAIL(result.open())) { - // 只有open失败的时候才可能重试,因open的时候会开启事务/语句等,并且没有给用户返回任何信息 + // Only retry when open fails, because open will start transactions/statements, etc., and no information is returned to the user int cret = OB_SUCCESS; int cli_ret = OB_SUCCESS; if (ObStmt::is_ddl_stmt(result.get_stmt_type(), result.has_global_variable())) { @@ -138,8 +142,7 @@ int ObSyncCmdDriver::response_result(ObMySQLResultSet &result) if (cret != OB_SUCCESS) { LOG_WARN("close result set fail", K(cret)); } - - // open失败,决定是否需要重试 + // open failed, decide whether to retry retry_ctrl_.test_and_save_retry_state(gctx_, ctx_, result, ret, cli_ret); LOG_WARN("result set open failed, check if need retry", K(ret), K(cli_ret), K(retry_ctrl_.need_retry())); @@ -248,9 +251,8 @@ int ObSyncCmdDriver::process_schema_version_changes( LOG_WARN("fail to update session last schema_version", K(ret)); } } - - // TODO: (xiaochu.yh) 和xiyu沟通结论:这段逻辑可以下移 - // > 应该是当时没有细想吧, 可以放到下层的result set中 + // TODO: (xiaochu.yh) Communicate with xiyu conclusion: This logic can be moved down + // > It should be that we didn't think it through at the time, it could be placed in the lower layer's result set if (OB_SUCC(ret)) { // - promote local schema up to target version if last_schema_version is set if (result.get_stmt_type() == stmt::T_VARIABLE_SET) { @@ -278,10 +280,9 @@ int ObSyncCmdDriver::process_schema_version_changes( } return ret; } - -// FIXME: 在目标租户执行 set @@ob_last_schema_version = 123456; -// 后是否需要触发刷 schema? -// 当前的行为是,只要通过 sql 主动设置,则按照设置的来。 +// FIXME: Execute set @@ob_last_schema_version = 123456; on the target tenant; +// Should schema brushing be triggered afterwards? +// The current behavior is, as long as it is actively set through SQL, it will follow the setting. int ObSyncCmdDriver::check_and_refresh_schema(uint64_t tenant_id) { int ret = OB_SUCCESS; diff --git a/src/observer/mysql/ob_sync_cmd_driver.h b/src/observer/mysql/ob_sync_cmd_driver.h index d7bc2fdec..622f0509b 100644 --- a/src/observer/mysql/ob_sync_cmd_driver.h +++ b/src/observer/mysql/ob_sync_cmd_driver.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_SYNC_CMD_DRIVER_ diff --git a/src/observer/mysql/ob_sync_plan_driver.cpp b/src/observer/mysql/ob_sync_plan_driver.cpp index eaadcf3f3..9f011ffc6 100644 --- a/src/observer/mysql/ob_sync_plan_driver.cpp +++ b/src/observer/mysql/ob_sync_plan_driver.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -57,7 +61,7 @@ int ObSyncPlanDriver::response_result(ObMySQLResultSet &result) int cret = OB_SUCCESS; int cli_ret = OB_SUCCESS; // move result.close() below, after test_and_save_retry_state(). - // open失败,决定是否需要重试 + // open failed, decide whether to retry retry_ctrl_.test_and_save_retry_state(gctx_, ctx_, result, @@ -65,7 +69,7 @@ int ObSyncPlanDriver::response_result(ObMySQLResultSet &result) cli_ret); if (OB_TRANSACTION_SET_VIOLATION != ret && OB_REPLICA_NOT_READABLE != ret) { if (OB_TRY_LOCK_ROW_CONFLICT == ret && retry_ctrl_.need_retry()) { - //锁冲突重试不打印日志,避免刷屏 + //Lock conflict retry does not print logs to avoid screen flooding } else { LOG_WARN("result set open failed, check if need retry", K(ret), K(cli_ret), K(retry_ctrl_.need_retry())); @@ -82,7 +86,7 @@ int ObSyncPlanDriver::response_result(ObMySQLResultSet &result) } ret = cli_ret; } else if (result.is_with_rows()) { - // 是结果集,开始发送数据之后不再重试 + // is the result set, no retries after starting to send data bool can_retry = false; if (OB_FAIL(response_query_result(result, result.is_ps_protocol(), @@ -93,9 +97,9 @@ int ObSyncPlanDriver::response_result(ObMySQLResultSet &result) LOG_WARN("response query result fail", K(ret)); // move result.close() below, after test_and_save_retry_state(). if (can_retry) { - // 还能重试,在这里判断一下要不要重试 + // Can retry, check here if we need to retry int cli_ret = OB_SUCCESS; - // response query result失败,决定是否需要重试 + // response query result failed, decide whether to retry retry_ctrl_.test_and_save_retry_state(gctx_, ctx_, result, @@ -158,8 +162,8 @@ int ObSyncPlanDriver::response_result(ObMySQLResultSet &result) // do nothing } else if ((is_prexecute_ && stmt::T_SELECT != result.get_stmt_type()) || (!is_prexecute_ && sender_.need_send_extra_ok_packet() && !result.has_more_result())) { - // 二合一协议 select 语句的 OK 包全部放在协议层发送 - // sync plan 此时需要为 二合一协议单独发送 OK 包 , for obproxy, + // Two-in-one protocol select statement's OK packet is entirely sent at the protocol layer + // sync plan At this time, a separate OK packet needs to be sent for the combined protocol, for obproxy, // in multi-stmt, send extra ok packet in the last stmt(has no more result) ObOKPParam ok_param; ok_param.affected_rows_ = result.get_affected_rows(); @@ -176,8 +180,8 @@ int ObSyncPlanDriver::response_result(ObMySQLResultSet &result) } } } else { - // 二合一协议 select 语句结果集后的 EOF 包都要在这里发送 - // 非 二合一协议, 不需要额外 OK 包的 EOF 包需要在这里发送 + // Two-in-one protocol select statement result set EOF packets should be sent here + // Not a combined protocol, the EOF packet without an additional OK packet needs to be sent here if (need_send_eof && OB_FAIL(sender_.response_packet(eofp, &result.get_session()))) { LOG_WARN("response packet fail", K(ret)); } @@ -249,7 +253,7 @@ int ObSyncPlanDriver::response_result(ObMySQLResultSet &result) !retry_ctrl_.need_retry() && !admission_fail_and_need_retry && OB_BATCHED_MULTI_STMT_ROLLBACK != ret) { - //OB_BATCHED_MULTI_STMT_ROLLBACK如果是batch stmt rollback错误,不要返回给客户端,退回到mpquery上重试 + //OB_BATCHED_MULTI_STMT_ROLLBACK if it is a batch stmt rollback error, do not return to the client, fall back to mpquery for retry if (ctx_.multi_stmt_item_.is_batched_multi_stmt()) { // The error of batch optimization execution does not need to send error packet here, // because the upper layer will force a fallback to a single line execution retry diff --git a/src/observer/mysql/ob_sync_plan_driver.h b/src/observer/mysql/ob_sync_plan_driver.h index 88c683037..2f4dd66c7 100644 --- a/src/observer/mysql/ob_sync_plan_driver.h +++ b/src/observer/mysql/ob_sync_plan_driver.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_SYNC_PLAN_DRIVER_ diff --git a/src/observer/mysql/obmp_auth_response.cpp b/src/observer/mysql/obmp_auth_response.cpp index 257ec2a20..836a9b0c7 100644 --- a/src/observer/mysql/obmp_auth_response.cpp +++ b/src/observer/mysql/obmp_auth_response.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/mysql/obmp_auth_response.h b/src/observer/mysql/obmp_auth_response.h index 195c5e57b..bf60091c8 100644 --- a/src/observer/mysql/obmp_auth_response.h +++ b/src/observer/mysql/obmp_auth_response.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OBMP_AUTH_RESPONSE_H_ diff --git a/src/observer/mysql/obmp_base.cpp b/src/observer/mysql/obmp_base.cpp index f65cb8085..ab0059c18 100644 --- a/src/observer/mysql/obmp_base.cpp +++ b/src/observer/mysql/obmp_base.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -46,8 +50,8 @@ ObMPBase::ObMPBase(const ObGlobalContext &gctx) ObMPBase::~ObMPBase() { - // wakeup_request内部会判断has_req_wakeup_标, - // 这里调一次兜底异常路径忘记flush_buffer的场景 + // wakeup_request internally will judge the has_req_wakeup_ flag, + // Here calls the fallback exception path where flush_buffer is forgotten if (!THIS_WORKER.need_retry()) { packet_sender_.finish_sql_request(); } @@ -115,7 +119,7 @@ int ObMPBase::after_process(int error_code) && !THIS_WORKER.need_retry(); if (is_slow) { if (THIS_WORKER.need_retry() && OB_TRY_LOCK_ROW_CONFLICT == error_code) { - //如果是锁冲突,且接下来会重试,则不需要打印这条日志了 + // If it is a lock conflict and a retry will follow, then this log does not need to be printed. } else { FORCE_PRINT_TRACE(THE_TRACE, "[slow query]"); @@ -123,7 +127,7 @@ int ObMPBase::after_process(int error_code) FLUSH_TRACE(); } } else if (can_force_print(error_code)) { - // 需要打印TRACE日志的错误码添加在这里 + // Error codes that need to print TRACE logs are added here int process_ret = error_code; NG_TRACE_EXT(process_ret, OB_Y(process_ret)); FORCE_PRINT_TRACE(THE_TRACE, "[err query]"); @@ -223,9 +227,9 @@ int ObMPBase::load_system_variables(const ObSysVariableSchema &sys_variable_sche } } if (OB_SUCC(ret)) { - //设置系统变量的最大版本号 + //Set the maximum version number of the system variable session.set_global_vars_version(sys_variable_schema.get_schema_version()); - //将影响plan的系统变量序列化并缓存 + //Serialize and cache the system variable sequence that affects the plan if (OB_FAIL(session.gen_sys_var_in_pc_str())) { LOG_WARN("fail to gen sys var in pc str", K(ret)); } else if (OB_FAIL(session.gen_configs_in_pc_str())) { @@ -348,7 +352,7 @@ int ObMPBase::init_process_var(sql::ObSqlCtx &ctx, const ObMySQLRawPacket &pkt = reinterpret_cast(req_->get_packet()); if (0 == multi_stmt_item.get_seq_num()) { - // 第一条sql + // The first sql ctx.can_reroute_sql_ = (pkt.can_reroute_pkt() && get_conn()->is_support_proxy_reroute()); } ctx.is_protocol_weak_read_ = false; // never use weak read in lite-mode @@ -359,9 +363,8 @@ int ObMPBase::init_process_var(sql::ObSqlCtx &ctx, } return ret; } - -//外层调用会忽略do_after_process的错误码,因此这里将set_session_state的错误码返回也没有意义。 -//因此这里忽略set_session_state错误码,warning buffer的reset和trace log 记录的流程不收影响。 +//The outer call will ignore the error code of do_after_process, therefore returning the error code of set_session_state here is also meaningless. +//Therefore, here the set_session_state error code is ignored, and the reset of the warning buffer and the trace log recording process are not affected. int ObMPBase::do_after_process(sql::ObSQLSessionInfo &session, bool async_resp_used) const { @@ -373,9 +376,9 @@ int ObMPBase::do_after_process(sql::ObSQLSessionInfo &session, session.set_retry_active_time(0); } // reset warning buffers - // 注意,此处req_has_wokenup_可能为true,不能再访问req对象 - // @todo 重构wb逻辑 - if (!async_resp_used) { // 异步回包不重置warning buffer,重置操作在callback中做 + // Note, req_has_wokenup_ may be true here, do not access the req object again + // @todo Refactor wb logic + if (!async_resp_used) { // Asynchronous response does not reset warning buffer, reset operation is done in callback session.reset_warnings_buf(); if (!session.get_is_in_retry()) { session.set_session_sleep(); @@ -400,7 +403,7 @@ int ObMPBase::record_flt_trace(sql::ObSQLSessionInfo &session) const NG_TRACE(query_end); if (session.is_use_trace_log()) { - //不影响正常逻辑 + //Does not affect normal logic // show trace will always show last request info if (OB_FAIL(ObFLTUtils::clean_flt_show_trace_env(session))) { LOG_WARN("failed to clean flt show trace env", K(ret)); diff --git a/src/observer/mysql/obmp_base.h b/src/observer/mysql/obmp_base.h index 2306b3794..6492f936c 100644 --- a/src/observer/mysql/obmp_base.h +++ b/src/observer/mysql/obmp_base.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBMP_BASE_H_ @@ -117,7 +121,7 @@ class ObMPBase : public rpc::frame::ObSqlProcessor, public ObIMPPacketSender int build_encode_param_(obmysql::ObProtoEncodeParam ¶m, obmysql::ObMySQLPacket *pkt, const bool is_last); void set_request_expect_group_id(sql::ObSQLSessionInfo *session); - // 计算并设置当前用户所属 cgroup,用于资源隔离。如未设置,默认 cgroup id 为 0 + // Calculate and set the current user's cgroup for resource isolation. If not set, the default cgroup id is 0 int response_row(sql::ObSQLSessionInfo &session, common::ObNewRow &row, const ColumnsFieldIArray *fields, @@ -138,14 +142,14 @@ class ObMPBase : public rpc::frame::ObSqlProcessor, public ObIMPPacketSender private: DISALLOW_COPY_AND_ASSIGN(ObMPBase); int64_t process_timestamp_; - uint64_t proxy_version_; // 控制prepare statement返回stmt id的策略 + uint64_t proxy_version_; // Control the strategy for prepare statement to return stmt id }; // end of class ObMPBase inline void ObMPBase::setup_wb(sql::ObSQLSessionInfo &session) { // just in case, not really need to call this session.reset_warnings_buf(); - // 将当前session的wb设置到线程局部,以便于代码中随处可以写warning进wb + // Set the current session's wb to thread-local so that warning can be written to wb anywhere in the code ob_setup_tsi_warning_buffer(&session.get_warnings_buffer()); } diff --git a/src/observer/mysql/obmp_change_user.cpp b/src/observer/mysql/obmp_change_user.cpp index 119c3586a..e3406c01e 100644 --- a/src/observer/mysql/obmp_change_user.cpp +++ b/src/observer/mysql/obmp_change_user.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/mysql/obmp_change_user.h b/src/observer/mysql/obmp_change_user.h index e5e664ab4..46787236d 100644 --- a/src/observer/mysql/obmp_change_user.h +++ b/src/observer/mysql/obmp_change_user.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OBMP_CHANGE_USER diff --git a/src/observer/mysql/obmp_connect.cpp b/src/observer/mysql/obmp_connect.cpp index 90d6635c3..8e5d8558a 100644 --- a/src/observer/mysql/obmp_connect.cpp +++ b/src/observer/mysql/obmp_connect.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -189,7 +193,7 @@ int ObMPConnect::init_process_single_stmt(const ObMultiStmtItem &multi_stmt_item const ObString &sql = multi_stmt_item.get_sql(); ObVirtualTableIteratorFactory vt_iter_factory(*gctx_.vt_iter_creator_); ObSchemaGetterGuard schema_guard; - // init_connect可以执行query和dml语句,必须加上req_timeinfo_guard + // init_connect can execute query and dml statements, must add req_timeinfo_guard observer::ObReqTimeGuard req_timeinfo_guard; //Do not change the order of SqlCtx and Allocator. ObSqlCtx uses the resultset's allocator to //allocate memory for ObSqlCtx::base_constraints_. The allocator must be deconstructed after sqlctx. @@ -207,7 +211,7 @@ int ObMPConnect::init_process_single_stmt(const ObMultiStmtItem &multi_stmt_item } else { //set session log_level.Must use ObThreadLogLevelUtils::clear() in pair ObThreadLogLevelUtils::init(session.get_log_id_level_map()); - ctx.retry_times_ = 0; // 这里是建立连接的时候的初始化sql的执行,不重试 + ctx.retry_times_ = 0; // This is the initialization SQL execution when establishing a connection, no retry ctx.schema_guard_ = &schema_guard; HEAP_VAR(ObMySQLResultSet, result, session, allocator) { result.set_has_more_result(has_more_result); @@ -231,10 +235,9 @@ int ObMPConnect::init_process_single_stmt(const ObMultiStmtItem &multi_stmt_item } ObThreadLogLevelUtils::clear(); } - - //对于tracelog的处理,不影响正常逻辑,错误码无须赋值给ret + //For the handling of tracelog, it does not affect the normal logic, and the error code does not need to be assigned to ret int tmp_ret = OB_SUCCESS; - tmp_ret = do_after_process(session, false); // 不是异步回包 + tmp_ret = do_after_process(session, false); // not asynchronous response UNUSED(tmp_ret); } return ret; @@ -519,9 +522,8 @@ int ObMPConnect::load_privilege_info(ObSQLSessionInfo &session) ret = OB_ERR_INVALID_TENANT_NAME; LOG_WARN("invalid tenant name. “$” is not allowed in tenant name.", K(ret), K_(tenant_name)); } - - //在oracle租户下需要转换db_name和user_name,处理双引号和大小写 - //在mysql租户下不会作任何处理,只简单拷贝下~ + //Under the oracle tenant, db_name and user_name need to be converted, handling double quotes and case sensitivity + //Under the mysql tenant, no processing will be done, only a simple copy will be made~ if (OB_SUCC(ret)) { if (db_name_.length() > OB_MAX_DATABASE_NAME_LENGTH || user_name_.length() > OB_MAX_USER_NAME_LENGTH) { @@ -560,7 +562,7 @@ int ObMPConnect::load_privilege_info(ObSQLSessionInfo &session) login_info.client_ip_ = client_ip_; SSL *ssl_st = SQL_REQ_OP.get_sql_ssl_st(req_); const ObUserInfo *user_info = NULL; - // 当 oracle 模式下,用户登录没有指定 schema_name 时,将其默认设置为对应的 user_name + // When in oracle mode, if the user login does not specify a schema_name, set it to the corresponding user_name by default if (OB_SUCC(ret) && ORACLE_MODE == session.get_compatibility_mode() && db_name_.empty()) { login_info.db_ = user_name_; } else if (!db_name_.empty()) { @@ -713,7 +715,7 @@ int ObMPConnect::load_privilege_info(ObSQLSessionInfo &session) tenant_id, schema_guard))) { LOG_WARN("get schema guard failed", K(ret), K(tmp_ret), K(tenant_id)); } else if (OB_SUCCESS == inner_ret) { - //schema刷新成功,并且内部执行也没有出错,尝试重新登录 + //Schema refresh successful, and no errors occurred during internal execution, attempt to re-login if (OB_FAIL(schema_guard.check_user_access(login_info, session_priv, enable_role_id_array, ssl_st, user_info))) { LOG_WARN("User access denied", K(login_info), K(ret)); @@ -831,7 +833,7 @@ int ObMPConnect::load_privilege_info(ObSQLSessionInfo &session) } else if (OB_SUCCESS != (tmp_ret = schema_guard.get_database_id(effective_tenant_id, session.get_database_name(), db_id))) { LOG_WARN("failed to get database id", K(ret), K(tmp_ret)); } else { - // 只有成功刷到schema时才重置错误码 + // Only reset the error code when schema is successfully refreshed ret = OB_SUCCESS; } } @@ -1086,8 +1088,7 @@ int ObMPConnect::get_last_failed_login_info( ret = OB_ERR_UNEXPECTED; LOG_WARN("more than one row returned", K(ret)); } - - //清理result + //clean result /* int temp_ret = OB_SUCCESS; if (OB_SUCCESS != (temp_ret = result->close())) { @@ -1452,8 +1453,7 @@ int ObMPConnect::get_client_create_time(int64_t &client_create_time) const } return ret; } - -//proxy连接方式时获取client->proxy的连接创建时间 +//proxy connection method when obtaining the client->proxy connection creation time int ObMPConnect::get_proxy_sess_create_time(int64_t &sess_create_time) const { int ret = OB_SUCCESS; @@ -2045,7 +2045,7 @@ int ObMPConnect::convert_oracle_object_name(const uint64_t tenant_id, ObString & int ret = OB_SUCCESS; lib::Worker::CompatMode compat_mode = lib::Worker::CompatMode::MYSQL; if (object_name.empty()) { - //这里传进来的obj_name是可能为空的,所以不赋错误码 + //Here the obj_name passed in may be empty, so no error code is assigned LOG_DEBUG("object name is null when try to convert it"); } else if (OB_FAIL(ObCompatModeGetter::get_tenant_mode(tenant_id, compat_mode))) { LOG_WARN("fail to get tenant mode in convert_oracle_object_name", K(ret)); @@ -2053,8 +2053,8 @@ int ObMPConnect::convert_oracle_object_name(const uint64_t tenant_id, ObString & if (object_name.length() > 1 && '\"' == object_name[0] && '\"' == object_name[object_name.length() - 1]) { - //如果object_name是带上了双引号,则不作任何转换 - //如果只有"",则名字设置为空 + //If object_name is enclosed in double quotes, then no conversion is made + //If it is only "", then the name is set to empty if (2 != object_name.length()) { object_name.assign_ptr(object_name.ptr() + 1, object_name.length() - 2); } else { @@ -2084,11 +2084,11 @@ int ObMPConnect::set_proxy_version(ObSMConnection &conn) is_found = true; } } - int64_t min_len = 5;//传过来的合法version字符串最短的为“1.1.1”,长度至少为5 + int64_t min_len = 5;//The shortest valid version string passed over is "1.1.1", with a length of at least 5 if (!is_found || OB_ISNULL(proxy_version_str) || length < min_len) { conn.proxy_version_ = 0; } else { - const int64_t VERSION_ITEM = 3;//版本号只需要取前三位就行,比如“1.7.6.1” 只需要取“1.7.6” 就能决定; + const int64_t VERSION_ITEM = 3;//The version number only needs to take the first three digits, for example, "1.7.6.1" only needs to take "1.7.6" to determine; ObArenaAllocator allocator(ObModIds::OB_SQL_EXPR); char *buff = static_cast(allocator.alloc(length + 1)); if (OB_ISNULL(buff)) { @@ -2130,11 +2130,11 @@ int ObMPConnect::set_client_version(ObSMConnection &conn) is_found = true; } } - int64_t min_len = 5;//传过来的合法version字符串最短的为“1.1.1”,长度至少为5 + int64_t min_len = 5;//The shortest valid version string passed over is "1.1.1", with a length of at least 5 if (!is_found || OB_ISNULL(client_version_str) || length < min_len) { conn.client_version_ = 0; } else { - const int64_t VERSION_ITEM = 3;//版本号只需要取前三位就行,比如“1.7.6.1” 只需要取“1.7.6” 就能决定; + const int64_t VERSION_ITEM = 3;//The version number only needs the first three digits, for example, "1.7.6.1" only needs to take "1.7.6" to determine; char buff[OB_MAX_VERSION_LENGTH]; memset(buff, 0, OB_MAX_VERSION_LENGTH); int64_t cur_item = 0; diff --git a/src/observer/mysql/obmp_connect.h b/src/observer/mysql/obmp_connect.h index e98d71184..beb607546 100644 --- a/src/observer/mysql/obmp_connect.h +++ b/src/observer/mysql/obmp_connect.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OBMP_CONNECT_H_ diff --git a/src/observer/mysql/obmp_debug.cpp b/src/observer/mysql/obmp_debug.cpp index dbd78de23..5410e8258 100644 --- a/src/observer/mysql/obmp_debug.cpp +++ b/src/observer/mysql/obmp_debug.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/mysql/obmp_debug.h b/src/observer/mysql/obmp_debug.h index 142be36e3..855b35a58 100644 --- a/src/observer/mysql/obmp_debug.h +++ b/src/observer/mysql/obmp_debug.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBMP_DEBUG_H_ diff --git a/src/observer/mysql/obmp_default.h b/src/observer/mysql/obmp_default.h index d5d101e04..adfb13f97 100644 --- a/src/observer/mysql/obmp_default.h +++ b/src/observer/mysql/obmp_default.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OBMP_DEFAULT_H diff --git a/src/observer/mysql/obmp_disconnect.cpp b/src/observer/mysql/obmp_disconnect.cpp index 3d5be6b6c..564585808 100644 --- a/src/observer/mysql/obmp_disconnect.cpp +++ b/src/observer/mysql/obmp_disconnect.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -42,13 +46,13 @@ int ObMPDisconnect::kill_unfinished_session(uint32_t sessid) LOG_ERROR("fail to get session info", K(session), K(sessid), K(ret)); } else { /* NOTE: - * 在Disconnect的上下文中,两种可能: - * (1) 长SQL先执行,并且正在执行,那么它已经能够检测到IS_KILLED标记 - * 此时disconnect_session会等待长SQL执行退出后才结束session中的事务 - * (2) disconnect_session先执行,它会结束事务并返回,然后执行后面的free_session - * (free_session 并不是释放 session 内存,只是一个逻辑删除的动作)。 - * 当长SQL拿到query_lock锁,它会立即检测IS_KILLED状态,检测到后立即退出处理流程。 - * 最终引用计数减为0,session被物理回收。 + * In the context of Disconnect, there are two possibilities: + * (1) The long SQL is executed first and is currently running, so it can already detect the IS_KILLED flag + * At this point, disconnect_session will wait for the long SQL to exit before ending the transaction in the session + * (2) disconnect_session is executed first, it will end the transaction and return, then execute the subsequent free_session + * (free_session does not release session memory, it is just a logical deletion action). + * When the long SQL acquires the query_lock lock, it will immediately check the IS_KILLED status, and exit the processing flow upon detection. + * Ultimately, the reference count is reduced to 0, and the session is physically recycled. */ if (OB_FAIL(GCTX.session_mgr_->disconnect_session(*session))) { LOG_WARN("fail to disconnect session", K(session), K(sessid), K(ret)); diff --git a/src/observer/mysql/obmp_disconnect.h b/src/observer/mysql/obmp_disconnect.h index 271d68d9e..62f6de452 100644 --- a/src/observer/mysql/obmp_disconnect.h +++ b/src/observer/mysql/obmp_disconnect.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OBMP_DISCONNECT_H_ diff --git a/src/observer/mysql/obmp_error.h b/src/observer/mysql/obmp_error.h index 90a77c778..a63dd2575 100644 --- a/src/observer/mysql/obmp_error.h +++ b/src/observer/mysql/obmp_error.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBMP_ERROR_H_ diff --git a/src/observer/mysql/obmp_init_db.cpp b/src/observer/mysql/obmp_init_db.cpp index b6917f002..3943df8ee 100644 --- a/src/observer/mysql/obmp_init_db.cpp +++ b/src/observer/mysql/obmp_init_db.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -145,12 +149,12 @@ int ObMPInitDB::process() K(session->get_server_sid()), K(session->get_proxy_sessid())); } else if (RETRY_TYPE_LOCAL == retry_type) { - // 在本线程重试 + // Retry in this thread force_local_retry = true; } else if (RETRY_TYPE_PACKET == retry_type) { - // 扔回队列中重试 + // Put back into the queue for retry if (!THIS_WORKER.can_retry()) { - // 不允许丢回队列,在本线程重试 + // Do not requeue, retry in this thread // FIXME: when will we be here? force_local_retry = true; LOG_WARN("fail to set retry flag, force to do local retry"); @@ -181,7 +185,7 @@ int ObMPInitDB::process() if (false == is_packet_retry && need_disconnect && is_conn_valid()) { force_disconnect(); LOG_WARN("disconnect connection when process query", K(ret)); - } else if (false == is_packet_retry && OB_FAIL(send_error_packet(ret, NULL))) { // 覆盖ret, 无需继续抛出 + } else if (false == is_packet_retry && OB_FAIL(send_error_packet(ret, NULL))) { // override ret, no need to throw further LOG_WARN("failed to send error packet", K(ret)); } } else if (OB_LIKELY(NULL != session)) { @@ -226,9 +230,9 @@ int ObMPInitDB::do_process(sql::ObSQLSessionInfo *session) } else if (OB_FAIL(schema_guard.check_db_access(session_priv, session->get_enable_role_array(), catalog_id, db_name_))) { LOG_WARN("fail to check db access.", K(catalog_id), K_(db_name), K(ret)); if (OB_ERR_NO_DB_SELECTED == ret) { - sret = OB_ERR_BAD_DATABASE; // 将错误码抛出让外层重试 + sret = OB_ERR_BAD_DATABASE; // Throw the error code to let the upper layer retry } else { - sret = ret; // 保险起见,也抛出 + sret = ret; // For safety, throw it as well } } else { // for external catalog, we will assign mocked db_id diff --git a/src/observer/mysql/obmp_init_db.h b/src/observer/mysql/obmp_init_db.h index f6bbebb1a..0e4cd3812 100644 --- a/src/observer/mysql/obmp_init_db.h +++ b/src/observer/mysql/obmp_init_db.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OBMP_INIT_DB_H diff --git a/src/observer/mysql/obmp_packet_sender.cpp b/src/observer/mysql/obmp_packet_sender.cpp index 9135ffc09..79fa4b243 100644 --- a/src/observer/mysql/obmp_packet_sender.cpp +++ b/src/observer/mysql/obmp_packet_sender.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -433,13 +437,13 @@ int ObMPPacketSender::send_error_packet(int err, } if (ObServerConfig::get_instance().enable_rich_error_msg) { - // 测试过程中,如果通过proxy访问oceanbase集群, - // 往往不知道sql发给了哪个observer, - // 需要先查询proxy日志,仔细对照sql文本和错误码才能确认,十分低效。 - // 增加本功能后,可以通过 - // 1. ip:port直接定位到observer - // 2. 然后通过时间定为到日志文件 - // 3. 最后通过trace id直接定位到日志 + // During the test process, if accessing the OceanBase cluster through a proxy, + // Often it is unknown which observer the sql was sent to, + // Need to query the proxy logs first, carefully compare the SQL text and error codes to confirm, which is very inefficient. + // After adding this feature, it can be achieved through + // 1. ip:port directly locates to observer + // 2. Then time-stamp to the log file + // 3. Finally locate the log directly through the trace id int32_t msg_buf_size = 0; const ObAddr addr = ObCurTraceId::get_addr(); @@ -533,9 +537,8 @@ int ObMPPacketSender::send_error_packet(int err, } } } - - // TODO: 应该把下面这部分逻辑从send_error_packet中剥离开,因为connect失败的时候, - // 也需要调用send_error_packet,而此时没有session + // TODO: Should separate the logic below from send_error_packet because connect fails, + // Also need to call send_error_packet, but there is no session at this time // // for obproxy or OCJ, followed by another OK packet if (conn_valid_) { diff --git a/src/observer/mysql/obmp_packet_sender.h b/src/observer/mysql/obmp_packet_sender.h index fc894f17e..61c2cc7a9 100644 --- a/src/observer/mysql/obmp_packet_sender.h +++ b/src/observer/mysql/obmp_packet_sender.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_MYSQL_OBMP_PACKET_SENDER_H_ diff --git a/src/observer/mysql/obmp_ping.cpp b/src/observer/mysql/obmp_ping.cpp index bdf520831..370703986 100644 --- a/src/observer/mysql/obmp_ping.cpp +++ b/src/observer/mysql/obmp_ping.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/mysql/obmp_ping.h b/src/observer/mysql/obmp_ping.h index 10c6cc422..d81fc086b 100644 --- a/src/observer/mysql/obmp_ping.h +++ b/src/observer/mysql/obmp_ping.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBMP_PING_H_ diff --git a/src/observer/mysql/obmp_process_info.cpp b/src/observer/mysql/obmp_process_info.cpp index 88bfa23f6..c1213c7d9 100644 --- a/src/observer/mysql/obmp_process_info.cpp +++ b/src/observer/mysql/obmp_process_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/mysql/obmp_process_info.h b/src/observer/mysql/obmp_process_info.h index 743bb2a21..0c4004308 100644 --- a/src/observer/mysql/obmp_process_info.h +++ b/src/observer/mysql/obmp_process_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBMP_PROCESS_INFO_H_ diff --git a/src/observer/mysql/obmp_process_kill.cpp b/src/observer/mysql/obmp_process_kill.cpp index 98381853b..127549e1a 100644 --- a/src/observer/mysql/obmp_process_kill.cpp +++ b/src/observer/mysql/obmp_process_kill.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/mysql/obmp_process_kill.h b/src/observer/mysql/obmp_process_kill.h index 963d967a6..72a395247 100644 --- a/src/observer/mysql/obmp_process_kill.h +++ b/src/observer/mysql/obmp_process_kill.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBMP_PROCESS_KILL_H_ diff --git a/src/observer/mysql/obmp_query.cpp b/src/observer/mysql/obmp_query.cpp index f5671c578..69aaa8251 100644 --- a/src/observer/mysql/obmp_query.cpp +++ b/src/observer/mysql/obmp_query.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -57,7 +61,7 @@ int ObMPQuery::process() ObSQLSessionInfo *sess = NULL; bool need_response_error = true; bool need_disconnect = true; - bool async_resp_used = false; // 由事务提交线程异步回复客户端 + bool async_resp_used = false; // Asynchronously reply to the client by the transaction commit thread int64_t query_timeout = 0; ObCurTraceId::TraceId *cur_trace_id = ObCurTraceId::get_trace_id(); ObSMConnection *conn = get_conn(); @@ -136,7 +140,7 @@ int ObMPQuery::process() LOG_WARN("session has been killed", K(session.get_session_state()), K_(sql), K(session.get_server_sid()), "proxy_sessid", session.get_proxy_sessid(), K(ret)); } else if (OB_FAIL(session.check_and_init_retry_info(*cur_trace_id, sql_))) { - // 注意,retry info和last query trace id的逻辑要写在query lock内,否则会有并发问题 + // Note, the logic for retry info and last query trace id should be written inside the query lock, otherwise there will be concurrency issues LOG_WARN("fail to check and init retry info", K(ret), K(*cur_trace_id), K_(sql)); } else if (OB_FAIL(session.get_query_timeout(query_timeout))) { LOG_WARN("fail to get query timeout", K_(sql), K(ret)); @@ -193,7 +197,7 @@ int ObMPQuery::process() need_response_error = false; ObParser parser(THIS_WORKER.get_sql_arena_allocator(), session.get_sql_mode(), session.get_charsets4parser()); - //为了性能优化考虑,减少数组长度,降低无用元素的构造和析构开销 + //For performance optimization, reduce the array length to lower the construction and destruction overhead of unused elements ObSEArray queries; ObMPParseStat parse_stat; if (GCONF.enable_record_trace_id) { @@ -210,32 +214,32 @@ int ObMPQuery::process() if (OB_FAIL(ret)) { //do nothing } else if (OB_FAIL(parser.split_multiple_stmt(sql_, queries, parse_stat))) { - // 进入本分支,说明push_back出错,OOM,委托外层代码返回错误码 - // 且进入此分支之后,要断连接 + // Enter this branch, indicating that push_back failed due to OOM, delegate the outer code to return an error code + // and after entering this branch, the connection should be terminated need_response_error = true; if (OB_ERR_PARSE_SQL == ret) { need_disconnect = false; } } else if (OB_UNLIKELY(queries.count() <= 0)) { ret = OB_ERR_UNEXPECTED; - need_response_error = true;//进入此分支之后,要断连接,极其严重错误 + need_response_error = true;//Enter this branch, the connection must be terminated, it is a critical error LOG_ERROR("emtpy query count. client would have suspended. never be here!", K_(sql), K(ret)); } else if (OB_UNLIKELY(1 == session.get_capability().cap_flags_.OB_CLIENT_MULTI_STATEMENTS)) { - // 处理Multiple Statement - /* MySQL处理Multi-Stmt出错时候的行为: - * 遇到首次运行失败(包括解析或执行)的SQL后,停止读取后继数据 - * 例如: + // Handle Multiple Statement + /* MySQL behavior when handling Multi-Stmt errors: + * After encountering the first failed SQL (including parsing or execution), stop reading subsequent data + * For example: * (1) select 1; selct 2; select 3; - * select 1执行成功,selct 2报语法错误,select 3不被执行 + * select 1 executes successfully, selct 2 reports a syntax error, select 3 is not executed * (2) select 1; drop table not_exists_table; select 3; - * select 1执行成功,drop table not_exists_table报表不存在错误,select 3不被执行 + * select 1 executes successfully, drop table not_exists_table reports a table does not exist error, select 3 is not executed * - * 特别注意: - * split_multiple_stmt是根据分号来分割语句,但有可能遇到“语法错误”, - * 这里说的“语法错误”不是说select写成了selct,而是“token”级别的语法错误,例如语句 + * Special note: + * split_multiple_stmt splits statements based on semicolons, but there might be "syntax errors", + * here "syntax error" does not mean select is written as selct, but "token" level syntax errors, for example the statement * select 1;`select 2; select 3; - * 上面`和'都没有形成闭合的字符串token,token parser会报告语法错误 - * 上面的例子中,得到的queries.count() 等于 2,分别为select 1和 `select 2; select 3; + * In the above example, ` and ' do not form closed string tokens, the token parser will report a syntax error + * In the above example, queries.count() equals 2, which are select 1 and `select 2; select 3; */ bool optimization_done = false; const char *p_normal_start = nullptr; @@ -270,21 +274,21 @@ int ObMPQuery::process() if (OB_UNLIKELY(parse_stat.parse_fail_ && (i == parse_stat.fail_query_idx_) && ObSQLUtils::check_need_disconnect_parser_err(parse_stat.fail_ret_))) { - // 进入本分支,说明在multi_query中的某条query parse失败,如果不是语法错,则进入该分支 - // 如果当前query_count 为1, 则不断连接;如果大于1, - // 则需要在发错误包之后断连接,防止客户端一直在等接下来的回包 - // 这个改动是为了解决 + // Enter this branch, indicating that parsing of a query in multi_query failed, if not due to a syntax error, then enter this branch + // If the current query_count is 1, then keep connecting; if greater than 1, + // then it is necessary to disconnect after sending the error packet to prevent the client from waiting indefinitely for the next response + // This change is to solve ret = parse_stat.fail_ret_; need_response_error = true; break; } else { has_more = (queries.count() > i + 1); - // 本来可以做成不管queries.count()是多少,最后一个query都可以异步回包的, - // 但是目前的代码实现难以在不同的线程处理同一个请求的回包, - // 因此这里只允许只有一个query的multi query请求异步回包。 + // Originally, it could have been designed so that the last query can always respond asynchronously regardless of queries.count(), + // However, the current code implementation struggles to handle the response packets of the same request in different threads, + // Therefore, only one query is allowed in an asynchronous response for a multi-query request here. force_sync_resp = queries.count() <= 1? false : true; - // is_part_of_multi 表示当前sql是 multi stmt 中的一条, - // 原来的值默认为true,会影响单条sql的二次路由,现在改为用 queries.count() 判断。 + // is_part_of_multi indicates that the current sql is one of the statements in a multi stmt, + // The original value defaults to true, which affects the secondary routing of a single SQL statement. Now it is changed to use queries.count() for judgment. bool is_part_of_multi = queries.count() > 1 ? true : false; ret = process_single_stmt(ObMultiStmtItem(is_part_of_multi, i, queries.at(i)), conn, @@ -296,9 +300,9 @@ int ObMPQuery::process() } } } - // 以multiple query协议发过来的语句总数 + // The total number of statements sent over the multiple query protocol EVENT_INC(SQL_MULTI_QUERY_COUNT); - // 以multiple query协议发过来,但实际只包含一条SQL的语句的个数 + // Sent using the multiple query protocol, but actually contains only one SQL statement count if (queries.count() <= 1) { EVENT_INC(SQL_MULTI_ONE_QUERY_COUNT); } @@ -310,7 +314,7 @@ int ObMPQuery::process() LOG_WARN("unexpected error. multi stmts sql while OB_CLIENT_MULTI_STATEMENTS not enabled.", K(ret), K(sql_)); } else { EVENT_INC(SQL_SINGLE_QUERY_COUNT); - // 处理普通的Single Statement + // Handle ordinary Single Statement ret = process_single_stmt(ObMultiStmtItem(false, 0, sql_), conn, session, @@ -325,7 +329,7 @@ int ObMPQuery::process() } } } - // THIS_WORKER.need_retry()是指是否扔回队列重试,包括大查询被扔回队列的情况。 + // THIS_WORKER.need_retry() means whether to put it back in the queue for retry, including the case of large queries being put back in the queue. session.check_and_reset_retry_info(*cur_trace_id, THIS_WORKER.need_retry()); session.set_last_trace_id(ObCurTraceId::get_trace_id()); IGNORE_RETURN record_flt_trace(session); @@ -348,8 +352,7 @@ int ObMPQuery::process() force_disconnect(); LOG_WARN("disconnect connection", KR(ret)); } - - // 如果已经异步回包,则这部分逻辑在cb中执行,这里跳过flush_buffer() + // If the response has already been sent asynchronously, this logic will be executed in cb, so skip flush_buffer() here if (!THIS_WORKER.need_retry()) { if (async_resp_used) { async_resp_used_ = true; @@ -365,7 +368,7 @@ int ObMPQuery::process() } // bugfix: - // 必须总是将 THIS_WORKER 里的指针设置为 null + // Must always set the pointer in THIS_WORKER to null THIS_WORKER.set_session(NULL); // clear session if (sess != NULL) { @@ -397,9 +400,9 @@ int ObMPQuery::try_batched_multi_stmt_optimization(sql::ObSQLSessionInfo &sessio if (queries.count() <= 1 || parse_stat.parse_fail_) { /*do nothing*/ } else if (!enable_batch_opt) { - // 未打开batch开关 + // batch switch is not turned on } else if (!use_plan_cache) { - // 不打开plan_cache开关,则优化不支持 + // If the plan_cache switch is not turned on, optimization is not supported } else if (OB_FAIL(process_single_stmt(ObMultiStmtItem(false, 0, sql_, &queries, is_ins_multi_val_opt), conn, session, @@ -442,13 +445,12 @@ int ObMPQuery::process_single_stmt(const ObMultiStmtItem &multi_stmt_item, observer::ObProcessMallocCallback pmcb(0, session.get_raw_audit_record().request_memory_used_); lib::ObMallocCallbackGuard guard(pmcb); - // 执行setup_wb后,所有WARNING都会写入到当前session的WARNING BUFFER中 + // After executing setup_wb, all WARNINGS will be written to the WARNING BUFFER of the current session setup_wb(session); - // 当新语句开始的时候,将该值归0,因为curr_trans_last_stmt_end_time是用于 - // 实现事务内部的语句执行间隔过长超时功能的。 + // When a new statement starts, set this value to 0, because curr_trans_last_stmt_end_time is used for + // Implement the timeout function for excessively long execution intervals of statements within a transaction. session.set_curr_trans_last_stmt_end_time(0); - - //============================ 注意这些变量的生命周期 ================================ + //============================ Pay attention to the lifecycle of these variables ================================ if (OB_FAIL(init_process_var(ctx_, multi_stmt_item, session))) { LOG_WARN("init process var failed.", K(ret), K(multi_stmt_item)); } else { @@ -474,12 +476,12 @@ int ObMPQuery::process_single_stmt(const ObMultiStmtItem &multi_stmt_item, LOG_WARN("fail to update time zone info", K(ret)); } else { need_response_error = false; - //每次执行不同sql都需要更新 + //Each execution of different SQL requires an update ctx_.self_add_plan_ = false; - retry_ctrl_.reset_retry_times();//每个statement单独记录retry times + retry_ctrl_.reset_retry_times();//each statement records retry times separately oceanbase::lib::Thread::WaitGuard guard(oceanbase::lib::Thread::WAIT_FOR_LOCAL_RETRY); do { - ret = OB_SUCCESS; //当发生本地重试的时候,需要重置错误码,不然无法推进重试 + ret = OB_SUCCESS; //When a local retry occurs, the error code needs to be reset, otherwise the retry cannot proceed need_disconnect = true; // if query need mock schema, will remember table_id in mocked_tables (local thread var) // when resolve, and then will try mock a table schema in sqlschemaguard. @@ -536,24 +538,21 @@ int ObMPQuery::process_single_stmt(const ObMultiStmtItem &multi_stmt_item, } } } - - //对于tracelog的处理,不影响正常逻辑,错误码无须赋值给ret + //For the handling of tracelog, it does not affect the normal logic, and the error code does not need to be assigned to ret int tmp_ret = OB_SUCCESS; - //清空WARNING BUFFER + //Clear WARNING BUFFER tmp_ret = do_after_process(session, async_resp_used); - - // 设置上一条语句的结束时间,由于这里只用于实现事务内部的语句之间的执行超时, - // 因此,首先,需要判断是否处于事务执行的过程中。然后对于事务提交的时候的异步回包, - // 也不需要在这里设置结束时间,因为这已经相当于事务的最后一条语句了。 - // 最后,需要判断ret错误码,只有成功执行的sql才记录结束时间 + // Set the end time of the previous statement, since here it is only used to implement the execution timeout between statements within a transaction, + // Therefore, first, it is necessary to determine whether a transaction execution process is in progress. Then for the asynchronous response at the time of transaction submission, + // It is also not necessary to set the end time here, because this is already equivalent to the last statement of the transaction. + // Finally, need to determine the ret error code, only successfully executed sql records the end time if (session.get_in_transaction() && !async_resp_used && OB_SUCC(ret)) { session.set_curr_trans_last_stmt_end_time(ObClockGenerator::getClock()); } - - // need_response_error这个变量保证仅在 - // do { do_process } while(retry) 之前出错才会 - // 走到send_error_packet逻辑 - // 所以无需考虑当前为sync还是async模式 + // the need_response_error variable ensures that it only occurs in + // do { do_process } while(retry) will only occur if an error happens before + // Walk to the send_error_packet logic + // So there is no need to consider whether the current mode is sync or async if (!OB_SUCC(ret) && need_response_error && is_conn_valid() && !ctx_.multi_stmt_item_.is_batched_multi_stmt()) { send_error_packet(ret, NULL); @@ -605,7 +604,7 @@ OB_INLINE int ObMPQuery::get_tenant_schema_info_(const uint64_t tenant_id, bool need_refresh = false; if (!cached_guard.is_inited()) { - // 第一次获取schema guard + // First get schema guard need_refresh = true; } else if (tenant_id != cached_guard.get_tenant_id()) { // change tenant @@ -618,14 +617,14 @@ OB_INLINE int ObMPQuery::get_tenant_schema_info_(const uint64_t tenant_id, } else if (OB_FAIL(cached_guard.get_schema_version(tenant_id, tenant_version))) { LOG_WARN("fail get schema version", K(ret), K(tenant_id)); } else if (tmp_tenant_version != tenant_version) { - //需要获取schema guard + //Need to obtain schema guard need_refresh = true; } else if (OB_FAIL(gctx_.schema_service_->get_tenant_refreshed_schema_version(OB_SYS_TENANT_ID, tmp_sys_version))) { LOG_WARN("get sys tenant refreshed schema version error", K(ret), "sys_tenant_id", OB_SYS_TENANT_ID); } else if (OB_FAIL(cached_guard.get_schema_version(OB_SYS_TENANT_ID, sys_version))) { LOG_WARN("fail get sys schema version", K(ret)); } else if (tmp_sys_version != sys_version) { - //需要获取schema guard + //Need to obtain schema guard need_refresh = true; } else { // do nothing @@ -633,12 +632,12 @@ OB_INLINE int ObMPQuery::get_tenant_schema_info_(const uint64_t tenant_id, } if (OB_SUCC(ret)) { if (!need_refresh) { - //获取session上缓存的最新schema guard + //Get the latest schema guard cached on the session schema_guard = &(cache_info->get_schema_guard()); } else if (OB_FAIL(cache_info->refresh_tenant_schema_guard(tenant_id))) { LOG_WARN("refresh tenant schema guard failed", K(ret), K(tenant_id)); } else { - //获取session上缓存的最新schema guard + //Get the latest schema guard cached on the session schema_guard = &(cache_info->get_schema_guard()); if (OB_FAIL(schema_guard->get_schema_version(tenant_id, tenant_version))) { LOG_WARN("fail get schema version", K(ret), K(tenant_id)); @@ -707,7 +706,7 @@ OB_INLINE int ObMPQuery::do_process_trans_ctrl(ObSQLSessionInfo &session, } single_process_timestamp_ = ObTimeUtility::current_time(); /* !!! - * 注意req_timeinfo_guard一定要放在result前面 + * Note that req_timeinfo_guard must be placed before result * !!! */ ObReqTimeGuard req_timeinfo_guard; @@ -743,8 +742,7 @@ OB_INLINE int ObMPQuery::do_process_trans_ctrl(ObSQLSessionInfo &session, // generate sql_id with sql cmd (void)ObSQLUtils::md5(sql, ctx_.sql_id_, (int32_t)sizeof(ctx_.sql_id_)); session.set_cur_sql_id(ctx_.sql_id_); - - //监控项统计开始 + //Monitoring item statistics start exec_start_timestamp_ = ObTimeUtility::current_time(); need_response_error = false; is_diagnostics_stmt = false; @@ -761,8 +759,7 @@ OB_INLINE int ObMPQuery::do_process_trans_ctrl(ObSQLSessionInfo &session, need_response_error = true; LOG_WARN("fail to execute trans ctrl cmd", KR(ret), K(sql)); } - - // 如果没有异步提交,且执行成功,则发送ok包给客户端 + // If there is no asynchronous submission, and the execution is successful, then send an ok packet to the client if (!async_resp_used && OB_SUCC(ret)) { ObOKPParam ok_param; ok_param.affected_rows_ = 0; @@ -773,13 +770,12 @@ OB_INLINE int ObMPQuery::do_process_trans_ctrl(ObSQLSessionInfo &session, } } } - - //注意: 在response_result接口调用后不要再使用sql_这个成员变量,这是因为sql_指向的内存来自于ObReqPacket - //而在事务异步提交应答客户端的流程中,应答客户端的流程位于ApplyService线程,跟SQL Worker线程没有时序保证 - //response_result启动异步应答客户端流程后,有可能会造成先回包再执行下面的逻辑,如果回包先完成,将会导致 - //ObReqPacket内存被释放,因而导致sql_指向非法内存地址,在下面这些逻辑访问sql_将导致crash - //而同步应答客户端的流程并没有类似的问题,这是因为同步应答客户端对最后一个包的flush动作位于这个接口的最下方, - //但异步应答流程没有这个保证 + // Note: Do not use the sql_ member variable after calling the response_result interface, because the memory that sql_ points to comes from ObReqPacket + // while in the transaction asynchronous commit response client process, the response client process is located in the ApplyService thread, and there is no timing guarantee with the SQL Worker thread + //After starting the asynchronous response client process with response_result, it is possible that the response packet will be returned before executing the following logic. If the response packet is completed first, it will lead to + //ObReqPacket memory is released, thus leading to sql_ pointing to an invalid memory address, accessing sql_ in the following logic will cause a crash + // And the process of synchronously responding to the client does not have similar issues, because the flush action for the last packet in the synchronous response client is located at the very bottom of this interface, + //But the asynchronous response process does not have this guarantee int tmp_ret = OB_SUCCESS; tmp_ret = OB_E(EventTable::EN_PRINT_QUERY_SQL) OB_SUCCESS; if (OB_SUCCESS != tmp_ret) { @@ -790,8 +786,7 @@ OB_INLINE int ObMPQuery::do_process_trans_ctrl(ObSQLSessionInfo &session, "database_name", session.get_database_name(), "trans_id", audit_record.trans_id_); } - - //监控项统计结束 + //Monitoring item statistics end exec_end_timestamp_ = ObTimeUtility::current_time(); // some statistics must be recorded for plan stat, even though sql audit disabled @@ -806,18 +801,18 @@ OB_INLINE int ObMPQuery::do_process_trans_ctrl(ObSQLSessionInfo &session, // but will do it in the callback thread. session.update_show_warnings_buf(); } else { - session.set_show_warnings_buf(ret); // TODO: 挪个地方性能会更好,减少部分wb拷贝 + session.set_show_warnings_buf(ret); // TODO: Move this to a better place, reduce some wb copying } if (OB_FAIL(ret) && !async_resp_used && need_response_error && is_conn_valid() && !ctx_.multi_stmt_item_.is_batched_multi_stmt()) { LOG_WARN("query failed", K(ret), K(session), K(sql)); - // 这个请求出错了,还没处理完。如果不是已经交给异步EndTrans收尾, - // 则需要在下面回复一个error_packet作为收尾。 - // 否则后面没人帮忙发错误包给客户端了,可能会导致客户端挂起等回包。 + // This request has errored, it hasn't been processed yet. If it hasn't already been handed over to async EndTrans for cleanup, + // then it is necessary to reply with an error_packet as a footer. + // Otherwise, no one will help send the error packet to the client, which may cause the client to hang waiting for a response. bool is_partition_hit = session.get_err_final_partition_hit(ret); int err = send_error_packet(ret, NULL, is_partition_hit, (void *)ctx_.get_reroute_info()); - if (OB_SUCCESS != err) { // 发送error包 + if (OB_SUCCESS != err) { // send error packet LOG_WARN("send error packet failed", K(ret), K(err)); } } @@ -882,7 +877,7 @@ OB_INLINE int ObMPQuery::do_process_trans_ctrl(ObSQLSessionInfo &session, clear_wb_content(session); } - need_disconnect = (need_disconnect && !is_query_killed_return(ret));//明确是kill query时,不应该断连接 + need_disconnect = (need_disconnect && !is_query_killed_return(ret)); // Clearly it is a kill query, the connection should not be disconnected if (need_disconnect) { LOG_WARN("need disconnect", K(ret), K(need_disconnect)); } @@ -988,7 +983,7 @@ OB_INLINE int ObMPQuery::do_process(ObSQLSessionInfo &session, const bool enable_sqlstat = session.is_sqlstat_enabled(); single_process_timestamp_ = ObTimeUtility::current_time(); /* !!! - * 注意req_timeinfo_guard一定要放在result前面 + * Note that req_timeinfo_guard must be placed before result * !!! */ ObReqTimeGuard req_timeinfo_guard; @@ -1068,9 +1063,9 @@ OB_INLINE int ObMPQuery::do_process(ObSQLSessionInfo &session, } ret = cli_ret; if (OB_ERR_PROXY_REROUTE == ret) { - // 该错误码在下层是由编译阶段被设置,async_resp_used标志一定为false - // 所以此时可以同步回包,设置need_response_error - // 向客户端返回一个error包,表示需要二次路由 + // This error code is set by the compiler at the compilation stage, the async_resp_used flag must be false + // So at this point, we can sync the response packet and set need_response_error + // Return an error packet to the client indicating a secondary routing is required need_response_error = true; } else if (ctx_.multi_stmt_item_.is_batched_multi_stmt()) { // batch execute with error,should not response error packet @@ -1084,11 +1079,11 @@ OB_INLINE int ObMPQuery::do_process(ObSQLSessionInfo &session, session.get_retry_info_for_update().inc_retry_cnt(); } } else { - //监控项统计开始 + //Monitoring item statistics start exec_start_timestamp_ = ObTimeUtility::current_time(); result.get_exec_context().set_plan_start_time(exec_start_timestamp_); - // 本分支内如果出错,全部会在response_result内部处理妥当 - // 无需再额外处理回复错误包 + // All errors within this branch will be handled properly inside response_result + // No need to handle the error response packet additionally need_response_error = false; is_diagnostics_stmt = ObStmt::is_diagnostic_stmt(result.get_literal_stmt_type()); ctx_.is_show_trace_stmt_ = ObStmt::is_show_trace_stmt(result.get_literal_stmt_type()); @@ -1120,13 +1115,12 @@ OB_INLINE int ObMPQuery::do_process(ObSQLSessionInfo &session, } } } - - //注意: 在response_result接口调用后不要再使用sql_这个成员变量,这是因为sql_指向的内存来自于ObReqPacket - //而在事务异步提交应答客户端的流程中,应答客户端的流程位于ApplyService线程,跟SQL Worker线程没有时序保证 - //response_result启动异步应答客户端流程后,有可能会造成先回包再执行下面的逻辑,如果回包先完成,将会导致 - //ObReqPacket内存被释放,因而导致sql_指向非法内存地址,在下面这些逻辑访问sql_将导致crash - //而同步应答客户端的流程并没有类似的问题,这是因为同步应答客户端对最后一个包的flush动作位于这个接口的最下方, - //但异步应答流程没有这个保证 + // Note: Do not use the sql_ member variable after calling the response_result interface, because the memory that sql_ points to comes from ObReqPacket + // while in the transaction asynchronous commit response client process, the response client process is located in the ApplyService thread, and there is no timing guarantee with the SQL Worker thread + //After starting the asynchronous response client process with response_result, it is possible that the response packet will be returned before executing the following logic. If the response packet is completed first, it will lead to + //ObReqPacket memory is released, thus leading to sql_ pointing to an invalid memory address, accessing sql_ in the following logic will cause a crash + // While the process of synchronously responding to the client does not have similar issues, this is because the flush action for the last packet in the synchronous response client is located at the very bottom of this interface, + //but the asynchronous response process does not have this guarantee int tmp_ret = OB_SUCCESS; tmp_ret = OB_E(EventTable::EN_PRINT_QUERY_SQL) OB_SUCCESS; if (OB_SUCCESS != tmp_ret) { @@ -1137,8 +1131,7 @@ OB_INLINE int ObMPQuery::do_process(ObSQLSessionInfo &session, "database_name", result.get_session().get_database_name(), "trans_id", audit_record.trans_id_); } - - //监控项统计结束 + //Monitoring item statistics end exec_end_timestamp_ = ObTimeUtility::current_time(); // some statistics must be recorded for plan stat, even though sql audit disabled @@ -1151,14 +1144,14 @@ OB_INLINE int ObMPQuery::do_process(ObSQLSessionInfo &session, const int64_t time_cost = exec_end_timestamp_ - get_receive_timestamp(); ObSQLUtils::record_execute_time(result.get_physical_plan()->get_plan_type(), time_cost); } - // 重试需要满足一下条件: - // 1. rs.open 执行失败 - // 2. 没有给客户端返回结果,本次执行没有副作用 - // 3. need_retry(result, ret):schema 或 location cache 失效 - // 4. 小于重试次数限制 + // Retry needs to meet the following conditions: + // 1. rs.open execution failed + // 2. No result was returned to the client, this execution has no side effects + // 3. need_retry(result, ret): schema or location cache invalidation + // 4. less than retry count limit if (OB_UNLIKELY(retry_ctrl_.need_retry())) { if (OB_TRANSACTION_SET_VIOLATION != ret && OB_REPLICA_NOT_READABLE != ret && OB_TRY_LOCK_ROW_CONFLICT != ret) { - //锁冲突重试不打印日志, 避免刷屏 + //Lock conflict retry does not print log, to avoid screen flooding LOG_WARN("try to execute again", K(ret), N_TYPE, result.get_stmt_type(), @@ -1166,9 +1159,8 @@ OB_INLINE int ObMPQuery::do_process(ObSQLSessionInfo &session, "timeout_remain", THIS_WORKER.get_timeout_remain()); } } else { - - // 首个plan执行完成后立即freeze partition hit - // partition_hit一旦freeze后,后继的try_set_bool操作都不生效 + // Immediately freeze partition hit after the first plan execution completes + // partition_hit once frozen, subsequent try_set_bool operations are ineffective if (OB_LIKELY(NULL != result.get_physical_plan())) { session.partition_hit().freeze(); } @@ -1180,7 +1172,7 @@ OB_INLINE int ObMPQuery::do_process(ObSQLSessionInfo &session, // but will do it in the callback thread. session.update_show_warnings_buf(); } else { - session.set_show_warnings_buf(ret); // TODO: 挪个地方性能会更好,减少部分wb拷贝 + session.set_show_warnings_buf(ret); // TODO: Move this to a better place, reduce some wb copy } if (OB_FAIL(ret) && !async_resp_used && need_response_error && is_conn_valid() && !THIS_WORKER.need_retry() && @@ -1192,13 +1184,13 @@ OB_INLINE int ObMPQuery::do_process(ObSQLSessionInfo &session, "sql", ctx_.is_sensitive_ ? ObString(OB_MASKED_STR) : sql, K(retry_ctrl_.need_retry())); } - // 当need_retry=false时,可能给客户端回过包了,可能还没有回过任何包。 - // 不过,可以确定:这个请求出错了,还没处理完。如果不是已经交给异步EndTrans收尾, - // 则需要在下面回复一个error_packet作为收尾。否则后面没人帮忙发错误包给客户端了, - // 可能会导致客户端挂起等回包。 + // When need_retry=false, a packet may have been sent to the client, or no packets may have been sent at all. + // However, it can be determined: this request has errored, and is not yet complete. If it has not already been handed over to asynchronous EndTrans for finalization, + // then it is necessary to reply with an error_packet below as a conclusion. Otherwise, no one will help send the error packet to the client afterwards, + // May cause the client to hang waiting for a response. bool is_partition_hit = session.get_err_final_partition_hit(ret); int err = send_error_packet(ret, NULL, is_partition_hit, (void *)ctx_.get_reroute_info()); - if (OB_SUCCESS != err) { // 发送error包 + if (OB_SUCCESS != err) { // send error packet LOG_WARN("send error packet failed", K(ret), K(err)); } } @@ -1340,7 +1332,7 @@ OB_INLINE int ObMPQuery::do_process(ObSQLSessionInfo &session, } need_disconnect = (result.get_exec_context().need_disconnect() - && !is_query_killed_return(ret));//明确是kill query时,不应该断连接 + && !is_query_killed_return(ret));//Explicitly when it is a kill query, the connection should not be dropped if (need_disconnect) { LOG_WARN("need disconnect", K(ret), K(need_disconnect)); } @@ -1456,8 +1448,8 @@ int ObMPQuery::check_readonly_stmt(ObMySQLResultSet &result) { int ret = OB_SUCCESS; bool is_readonly = false; - //在该阶段,show语句会转换为select语句, - //literal_stmt_type若不为stmt::T_NONE,则表示原有的类型show + //In this phase, the show statement will be converted to a select statement, + //if literal_stmt_type is not stmt::T_NONE, then it indicates the original type show const stmt::StmtType type = stmt::T_NONE == result.get_literal_stmt_type() ? result.get_stmt_type() : result.get_literal_stmt_type(); @@ -1468,14 +1460,14 @@ int ObMPQuery::check_readonly_stmt(ObMySQLResultSet &result) ret = OB_ERR_READ_ONLY; LOG_WARN("stmt is not readonly", K(ret), K(result)); } else if (stmt::T_SELECT == type) { - //对select语句,需要禁强一致读 - //通过设置/*+read_consistency()*/ hint - //or 指定session级别ob_read_consistency = 2 - //来设置弱一致性读 + //For the select statement, strong consistency read needs to be disabled + //Through setting /*+read_consistency()*/ hint + //or specify session-level ob_read_consistency = 2 + // to set weak consistency read const int64_t table_count = DAS_CTX(result.get_exec_context()).get_table_loc_list().size(); if (0 == table_count) { - //此处比较特殊,jdbc在发送查询语句时会带上特殊的语句select @@session.tx_read_only; - //为方便obtest测试,需要放开对无table_locatitons的select语句的限制 + //This case is special, jdbc will send a special statement select @@session.tx_read_only when sending the query statement; + //For convenience of obtest testing, the restriction on the select statement for no table_locations needs to be removed } else if (OB_FAIL(result.get_read_consistency(consistency))) { LOG_WARN("get read consistency fail", K(ret)); } else if (WEAK != consistency) { @@ -1495,7 +1487,7 @@ int ObMPQuery::is_readonly_stmt(ObMySQLResultSet &result, bool &is_readonly) result.get_literal_stmt_type(); switch (type) { case stmt::T_SELECT: { - //对select...for update语句,也需要禁止 + //Forbid the select...for update statement as well ObPhysicalPlan *physical_plan = result.get_physical_plan(); if (NULL == physical_plan) { ret = OB_ERR_UNEXPECTED; @@ -1508,7 +1500,7 @@ int ObMPQuery::is_readonly_stmt(ObMySQLResultSet &result, bool &is_readonly) break; } case stmt::T_VARIABLE_SET: { - //禁止set @@global.variable语句 + //Prohibit set @@global.variable statement if (result.has_global_variable()) { is_readonly = false; } else { @@ -1598,18 +1590,17 @@ OB_INLINE int ObMPQuery::response_result(ObMySQLResultSet &result, { int ret = OB_SUCCESS; FLTSpanGuard(sql_execute); - //ac = 1时线程新启事务进行oracle临时表数据清理会和clog回调形成死锁, 这里改成同步方式 + // When ac = 1, starting a new transaction in the thread to clean up data in the Oracle temporary table will form a deadlock with the clog callback, so it is changed to a synchronous method here ObSQLSessionInfo &session = result.get_session(); CHECK_COMPATIBILITY_MODE(&session); bool need_trans_cb = result.need_end_trans_callback() && (!force_sync_resp); - - // 通过判断 plan 是否为 null 来确定是 plan 还是 cmd - // 针对 plan 和 cmd 分开处理,逻辑会较为清晰。 + // Determine whether it is plan or cmd by checking if plan is null + // Handle plan and cmd separately, the logic will be clearer. if (OB_LIKELY(NULL != result.get_physical_plan())) { if (need_trans_cb) { ObAsyncPlanDriver drv(gctx_, ctx_, session, retry_ctrl_, *this); - // NOTE: sql_end_cb必须在drv.response_result()之前初始化好 + // NOTE: sql_end_cb must be initialized before drv.response_result() ObSqlEndTransCb &sql_end_cb = session.get_mysql_end_trans_cb(); if (OB_FAIL(sql_end_cb.init(packet_sender_, &session))) { LOG_WARN("failed to init sql end callback", K(ret)); @@ -1618,7 +1609,7 @@ OB_INLINE int ObMPQuery::response_result(ObMySQLResultSet &result, } async_resp_used = result.is_async_end_trans_submitted(); } else { - // 试点ObQuerySyncDriver + // Pilot ObQuerySyncDriver ObSyncPlanDriver drv(gctx_, ctx_, session, retry_ctrl_, *this); ret = drv.response_result(result); } @@ -1727,22 +1718,22 @@ inline void ObMPQuery::record_stat(const stmt::StmtType type, int ObMPQuery::deserialize_com_field_list() { int ret = OB_SUCCESS; - //如果设置了只需要返回列定义,说明client传来的是COM_FIELD_LIST命令 - /* mysql中的COM_FIELD_LIST命令用于获取table中的列定义,其从client to server的packet为: + //If only column definitions are to be returned, it means the client sent a COM_FIELD_LIST command + /* mysql's COM_FIELD_LIST command is used to get the column definitions of a table, its packet from client to server is: * 1 [04] COM_FIELD_LIST * string[NUL] table * string[EOF] field wildcard - * 首先是CMD类型,然后是表名,最后是匹配条件 + * First is the CMD type, then the table name, followed by the match condition * - * server to client的packet为下面中的其中一个: - * 1. a ERR_Packet(返回一个错误包) - * 2. one or more Column Definition packets and a closing EOF_Packet(返回n个列定义+EOF) + * The packet from server to client is one of the following: + * 1. an ERR_Packet (returns an error packet) + * 2. one or more Column Definition packets and a closing EOF_Packet (returns n column definitions + EOF) * - * 由于普通的select的查询结果已经包含了column定义,同时最大限度复用当前的代码逻辑,因此可以将COM_FIELD_LIST的命令 - * 等价于: - * select * from table limit 0 ==> 获取filed define ==> 根据field wildcard 按需反回 Column Definition + * Since the result of a regular SELECT query already includes column definitions, and to maximize the reuse of the current code logic, the COM_FIELD_LIST command + * can be considered equivalent to: + * select * from table limit 0 ==> get field define ==> return Column Definition based on field wildcard as needed * - * 参考:https://dev.mysql.com/doc/internals/en/com-field-list.html + * Reference: https://dev.mysql.com/doc/internals/en/com-field-list.html */ ObIAllocator *alloc = &THIS_WORKER.get_sql_arena_allocator(); if (OB_ISNULL(alloc)) { @@ -1758,7 +1749,7 @@ int ObMPQuery::deserialize_com_field_list() const int64_t str1_len = strlen(str1); const int64_t str2_len = strlen(str2); const int pre_size = str1_len + str2_len; - //寻找client传过来的table_name和filed wildcard之间的分隔符(table_name [NULL] filed wildcard) + //Find the delimiter between client-provided table_name and field wildcard (table_name [NULL] field wildcard) for (; static_cast(str[i]) != 0 && i < length; ++i) {} char *dest_str = static_cast(alloc->alloc(length + pre_size)); if (OB_ISNULL(dest_str)) { diff --git a/src/observer/mysql/obmp_query.h b/src/observer/mysql/obmp_query.h index 80015500e..6dd413baa 100644 --- a/src/observer/mysql/obmp_query.h +++ b/src/observer/mysql/obmp_query.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OBMP_QUERY_H_ @@ -132,14 +136,14 @@ class ObMPQuery : public ObMPBase private: DISALLOW_COPY_AND_ASSIGN(ObMPQuery); private: - //生命周期在process_single_stmt()中 + //Lifecycle in process_single_stmt() sql::ObSqlCtx ctx_; ObQueryRetryCtrl retry_ctrl_; common::ObString sql_; int64_t single_process_timestamp_; int64_t exec_start_timestamp_; int64_t exec_end_timestamp_; - //由于mysql的COM_FIELD_LIST命令本质上就是获取列的定义信息,只需要返回列定义 + //Since the MySQL COM_FIELD_LIST command essentially retrieves column definition information, only the column definitions need to be returned bool is_com_filed_list_; common::ObString wild_str_;//used to save wildware string in COM_FIELD_LIST int64_t params_value_len_; diff --git a/src/observer/mysql/obmp_quit.h b/src/observer/mysql/obmp_quit.h index 7dba4bc9d..009e40900 100644 --- a/src/observer/mysql/obmp_quit.h +++ b/src/observer/mysql/obmp_quit.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBMP_QUIT_H_ diff --git a/src/observer/mysql/obmp_refresh.cpp b/src/observer/mysql/obmp_refresh.cpp index 717bb5ecc..a6a6e42ac 100644 --- a/src/observer/mysql/obmp_refresh.cpp +++ b/src/observer/mysql/obmp_refresh.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/mysql/obmp_refresh.h b/src/observer/mysql/obmp_refresh.h index 38ebcb2b3..c6693ad91 100644 --- a/src/observer/mysql/obmp_refresh.h +++ b/src/observer/mysql/obmp_refresh.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBMP_REFRESH_H_ diff --git a/src/observer/mysql/obmp_reset_connection.cpp b/src/observer/mysql/obmp_reset_connection.cpp index 49cc2f8e5..c475e6658 100644 --- a/src/observer/mysql/obmp_reset_connection.cpp +++ b/src/observer/mysql/obmp_reset_connection.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -178,8 +182,8 @@ int ObMPResetConnection::process() if (OB_SUCC(ret)) { ObObj last_insert_id; last_insert_id.set_uint64(0); - // FIXME @qianfu 暂时写成update_sys_variable函数,以后再实现一个可以传入ObSysVarClassType并且 - // 和set系统变量语句走同一套逻辑的函数,在这里调用 + // FIXME @qianfu temporarily written as update_sys_variable function, to be implemented with the ability to pass in ObSysVarClassType and + // and set system variable statement follow the same logic function, call here if (OB_FAIL(session->update_sys_variable(SYS_VAR_LAST_INSERT_ID, last_insert_id))) { LOG_WARN("fail to update last_insert_id", K(ret)); } else if (OB_FAIL(session->update_sys_variable(SYS_VAR_IDENTITY, last_insert_id))) { @@ -202,16 +206,13 @@ int ObMPResetConnection::process() // 10. OB unique design if (OB_SUCC(ret)) { - // 10.1 pl debug 功能, pl debug不支持分布式调试,但调用也不会有副作用 - - // 10.2 非分布式需要的话,分布式也需要,用于清理package的全局变量值 + // 10.1 pl debug function, pl debug does not support distributed debugging, but calling it will have no side effects + // 10.2 Non-distributed needs it, distributed also needs it, used for cleaning the global variable values of the package session->reset_all_package_state(); - - // 10.3 currval 清理 + // 10.3 currval cleanup session->reuse_all_sequence_value(); - - // reuse_context_map 没有使用 malloc free 内存,会导致内存泄漏, - // mem_context_ 清理时会产生 unfree error 日志 + // reuse_context_map does not use malloc free memory, which will lead to memory leaks, + // mem_context_ cleanup will generate unfree error log //session->reuse_context_map(); // 10.5 warning buf diff --git a/src/observer/mysql/obmp_reset_connection.h b/src/observer/mysql/obmp_reset_connection.h index dc4925d5b..24b871057 100644 --- a/src/observer/mysql/obmp_reset_connection.h +++ b/src/observer/mysql/obmp_reset_connection.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OBMP_RESET_CONNECTION diff --git a/src/observer/mysql/obmp_set_option.cpp b/src/observer/mysql/obmp_set_option.cpp index f26003692..11818bbec 100644 --- a/src/observer/mysql/obmp_set_option.cpp +++ b/src/observer/mysql/obmp_set_option.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -110,7 +114,7 @@ int ObMPSetOption::process() if (need_disconnect && is_conn_valid()) { force_disconnect(); LOG_WARN("disconnect connection when process query", K(ret)); - } else if (OB_FAIL(send_error_packet(ret, NULL))) { // 覆盖ret, 无需继续抛出 + } else if (OB_FAIL(send_error_packet(ret, NULL))) { // override ret, no need to throw further LOG_WARN("failed to send error packet", K(ret)); } } diff --git a/src/observer/mysql/obmp_set_option.h b/src/observer/mysql/obmp_set_option.h index 942f6f3d6..e9cc6968e 100644 --- a/src/observer/mysql/obmp_set_option.h +++ b/src/observer/mysql/obmp_set_option.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OBMP_SET_OPTION_H_ diff --git a/src/observer/mysql/obmp_statistic.cpp b/src/observer/mysql/obmp_statistic.cpp index 896774e78..5fd5bf046 100644 --- a/src/observer/mysql/obmp_statistic.cpp +++ b/src/observer/mysql/obmp_statistic.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/mysql/obmp_statistic.h b/src/observer/mysql/obmp_statistic.h index 8ab9af89d..cf73bfa5f 100644 --- a/src/observer/mysql/obmp_statistic.h +++ b/src/observer/mysql/obmp_statistic.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OBMP_STATISTIC_H_ diff --git a/src/observer/mysql/obmp_stmt_close.cpp b/src/observer/mysql/obmp_stmt_close.cpp index b3bddb5d7..c92b58d98 100644 --- a/src/observer/mysql/obmp_stmt_close.cpp +++ b/src/observer/mysql/obmp_stmt_close.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -91,11 +95,11 @@ int ObMPStmtClose::process() } } if (OB_FAIL(session->close_ps_stmt(stmt_id_))) { - // overwrite ret, 优先级低,被覆盖 + // overwrite ret, low priority, will be overridden LOG_WARN("fail to close ps stmt", K(ret), K_(stmt_id), K(session->get_server_sid())); } if (OB_SUCCESS != tmp_ret) { - // close_cursor 失败时错误码的优先级比 close_ps_stmt 高,此处进行覆盖 + // close_cursor failure error code priority is higher than close_ps_stmt, here we override ret = tmp_ret; } } diff --git a/src/observer/mysql/obmp_stmt_close.h b/src/observer/mysql/obmp_stmt_close.h index 0a831567b..107e090dd 100644 --- a/src/observer/mysql/obmp_stmt_close.h +++ b/src/observer/mysql/obmp_stmt_close.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBMP_STMT_CLOSE_H_ diff --git a/src/observer/mysql/obmp_stmt_execute.cpp b/src/observer/mysql/obmp_stmt_execute.cpp index 7620fa9e3..b7cd7e716 100644 --- a/src/observer/mysql/obmp_stmt_execute.cpp +++ b/src/observer/mysql/obmp_stmt_execute.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -545,7 +549,7 @@ int ObMPStmtExecute::after_do_process_for_arraybinding(ObMySQLResultSet &result) true/*arraybinding only local retry*/); if (OB_TRANSACTION_SET_VIOLATION != ret && OB_REPLICA_NOT_READABLE != ret) { if (OB_TRY_LOCK_ROW_CONFLICT == ret && retry_ctrl_.need_retry()) { - //锁冲突重试不打印日志,避免刷屏 + //Lock conflict retry does not print logs to avoid screen flooding } else { LOG_WARN("result set open failed, check if need retry", K(ret), K(cli_ret), K(retry_ctrl_.need_retry())); @@ -895,7 +899,7 @@ int ObMPStmtExecute::request_params(ObSQLSessionInfo *session, LOG_WARN("ps_session_info is null", K(ret)); } else if (DEFAULT_ITERATION_COUNT == ps_stmt_checksum) { // do nothing - // 新协议不在这里做 + // New protocol is not handled here } else if (ps_stmt_checksum != ps_session_info->get_ps_stmt_checksum()) { ret = OB_ERR_PREPARE_STMT_CHECKSUM; LOG_ERROR("ps stmt checksum fail", K(ret), "session_id", session->get_server_sid(), @@ -946,14 +950,13 @@ int ObMPStmtExecute::request_params(ObSQLSessionInfo *session, ParamCastArray param_cast_infos; ParamTypeArray returning_param_types; ParamTypeInfoArray returning_param_type_infos; - - // Step1: 处理空值位图 + // Step1: Handle null value bitmap const char *bitmap = pos; int64_t bitmap_types = (params_num_ + 7) / 8; PS_DEFENSE_CHECK(bitmap_types + 1) // null value bitmap + new param bound flag { pos += bitmap_types; - // Step2: 获取new_param_bound_flag字段 + // Step2: Get the new_param_bound_flag field ObMySQLUtil::get_int1(pos, new_param_bound_flag); if (new_param_bound_flag == 1) { // reset param_types @@ -989,8 +992,7 @@ int ObMPStmtExecute::request_params(ObSQLSessionInfo *session, } else if (OB_FAIL(returning_param_type_infos.prepare_allocate(params_num_ - input_param_num))) { LOG_WARN("array prepare allocate failed", K(ret)); } - - // Step3: 获取type信息 + // Step3: Get type information if (OB_SUCC(ret)) { if (1 == new_param_bound_flag) { ParamTypeArray tmp_param_types; @@ -1021,8 +1023,7 @@ int ObMPStmtExecute::request_params(ObSQLSessionInfo *session, analysis_checker_.need_check_ = false; } } - - // Step3-2: 获取returning into params type信息 + // Step3-2: Get returning into params type information if (OB_SUCC(ret) && returning_params_num > 0) { if (new_param_bound_flag != 1) { ret = OB_ERR_UNEXPECTED; @@ -1195,7 +1196,7 @@ int ObMPStmtExecute::execute_response(ObSQLSessionInfo &session, } else if (is_execute_ps_cursor()) { ObDbmsCursorInfo *cursor = NULL; bool use_stream = false; - // 1.创建cursor + // 1.create cursor if (OB_NOT_NULL(session.get_cursor(stmt_id_))) { if (OB_FAIL(session.close_cursor(stmt_id_))) { LOG_WARN("fail to close result set", K(ret), K(stmt_id_), K(session.get_server_sid())); @@ -1247,10 +1248,10 @@ int ObMPStmtExecute::execute_response(ObSQLSessionInfo &session, } } /* - * PS模式exec-cursor协议中, - * 不返回 result_set 结果集,只返回包头信息 - * 并在EOF包中设置 OB_SERVER_STATUS_CURSOR_EXISTS 状态 - * 提示驱动发送fetch协议 + * In the PS mode exec-cursor protocol, + * do not return the result_set, only return the packet header information + * and set the OB_SERVER_STATUS_CURSOR_EXISTS status in the EOF packet + * to prompt the driver to send the fetch protocol */ OZ (response_query_header(session, *cursor)); if (OB_SUCCESS != ret && OB_NOT_NULL(cursor)) { @@ -1284,12 +1285,12 @@ int ObMPStmtExecute::execute_response(ObSQLSessionInfo &session, need_response_error = true; } } else { - //监控项统计开始 + //Monitoring item statistics start exec_start_timestamp_ = ObTimeUtility::current_time(); result.get_exec_context().set_plan_start_time(exec_start_timestamp_); session.reset_plsql_exec_time(); - // 本分支内如果出错,全部会在response_result内部处理妥当 - // 无需再额外处理回复错误包 + // All errors within this branch will be handled properly inside response_result + // No need to handle the error response packet additionally need_response_error = false; is_diagnostics_stmt = ObStmt::is_diagnostic_stmt(result.get_literal_stmt_type()); @@ -1338,7 +1339,7 @@ int ObMPStmtExecute::do_process(ObSQLSessionInfo &session, single_process_timestamp_ = ObTimeUtility::current_time(); /* !!! - * 注意req_timeinfo_guard一定要放在result前面 + * Note that req_timeinfo_guard must be placed before result * !!! */ ObReqTimeGuard req_timeinfo_guard; @@ -1421,7 +1422,7 @@ int ObMPStmtExecute::do_process(ObSQLSessionInfo &session, } } } - //监控项统计结束 + //Monitoring item statistics end exec_end_timestamp_ = ObTimeUtility::current_time(); // some statistics must be recorded for plan stat, even though sql audit disabled @@ -1442,13 +1443,13 @@ int ObMPStmtExecute::do_process(ObSQLSessionInfo &session, && !THIS_WORKER.need_retry() && !retry_ctrl_.need_retry()) { LOG_WARN("query failed", K(ret), K(retry_ctrl_.need_retry()), K_(stmt_id)); - // 当need_retry=false时,可能给客户端回过包了,可能还没有回过任何包。 - // 不过,可以确定:这个请求出错了,还没处理完。如果不是已经交给异步EndTrans收尾, - // 则需要在下面回复一个error_packet作为收尾。否则后面没人帮忙发错误包给客户端了, - // 可能会导致客户端挂起等回包。 + // When need_retry=false, a response packet may have been sent to the client, or no packets may have been sent at all. + // However, it can be determined: this request has errored, and is not yet complete. If it has not already been handed over to asynchronous EndTrans for finalization, + // then it is necessary to reply with an error_packet below as a conclusion. Otherwise, no one will help send the error packet to the client afterwards, + // May cause the client to hang waiting for a response. bool is_partition_hit = session.get_err_final_partition_hit(ret); int err = send_error_packet(ret, NULL, is_partition_hit, (void *)ctx_.get_reroute_info()); - if (OB_SUCCESS != err) { // 发送error包 + if (OB_SUCCESS != err) { // send error packet LOG_WARN("send error packet failed", K(ret), K(err)); } } @@ -1603,7 +1604,7 @@ int ObMPStmtExecute::response_result( if (OB_LIKELY(NULL != result.get_physical_plan())) { if (need_trans_cb) { ObAsyncPlanDriver drv(gctx_, ctx_, session, retry_ctrl_, *this, is_prexecute()); - // NOTE: sql_end_cb必须在drv.response_result()之前初始化好 + // NOTE: sql_end_cb must be initialized before drv.response_result() ObSqlEndTransCb &sql_end_cb = session.get_mysql_end_trans_cb(); if (OB_FAIL(sql_end_cb.init(packet_sender_, &session, stmt_id_, params_num_, @@ -1614,7 +1615,7 @@ int ObMPStmtExecute::response_result( } async_resp_used = result.is_async_end_trans_submitted(); } else { - // 试点ObQuerySyncDriver + // Pilot ObQuerySyncDriver int32_t iteration_count = OB_INVALID_COUNT; if (is_prexecute()) { iteration_count = static_cast(this)->get_iteration_count(); @@ -1694,11 +1695,11 @@ int ObMPStmtExecute::do_process_single(ObSQLSessionInfo &session, { int ret = OB_SUCCESS; ObReqTimeGuard req_timeinfo_guard; - // 每次执行不同sql都需要更新 + // Each execution of different SQL requires an update ctx_.self_add_plan_ = false; oceanbase::lib::Thread::WaitGuard guard(oceanbase::lib::Thread::WAIT_FOR_LOCAL_RETRY); do { - // 每次都必须设置为OB_SCCESS, 否则可能会因为没有调用do_process()造成死循环 + // Must always be set to OB_SUCCESS, otherwise it may cause a deadlock due to do_process() not being called ret = OB_SUCCESS; share::schema::ObSchemaGetterGuard schema_guard; int64_t tenant_version = 0; @@ -1733,8 +1734,8 @@ int ObMPStmtExecute::do_process_single(ObSQLSessionInfo &session, } while (RETRY_TYPE_LOCAL == retry_ctrl_.get_retry_type()); if (OB_SUCC(ret) && retry_ctrl_.get_retry_times() > 0) { - // 经过重试之后才成功的,把sql打印出来。这里只能覆盖到本地重试的情况,没法覆盖到扔回队列重试的情况。 - // 如果需要重试则ret不可能为OB_SUCCESS,因此这里不用判断retry_type。 + // After successful retry, print the sql. Here it can only cover the local retry case, cannot cover the case of retrying by putting back into the queue. + // If a retry is needed, ret will never be OB_SUCCESS, so there is no need to check retry_type here. LOG_TRACE("sql retry", K(ret), "retry_times", retry_ctrl_.get_retry_times(), "sql", ctx_.cur_sql_); } @@ -1774,8 +1775,8 @@ int ObMPStmtExecute::try_batch_multi_stmt_optimization(ObSQLSessionInfo &session bool &async_resp_used, bool &optimization_done) { - // 1. save_exception 不能batch - // 2. returning 不能batch + // 1. save_exception cannot be batch + // 2. returning cannot batch int ret = OB_SUCCESS; optimization_done = false; ctx_.multi_stmt_item_.set_ps_mode(true); @@ -1787,13 +1788,13 @@ int ObMPStmtExecute::try_batch_multi_stmt_optimization(ObSQLSessionInfo &session ObIAllocator &alloc = CURRENT_CONTEXT->get_arena_allocator(); if (!enable_batch_opt) { - // 不支持做batch执行 + // Does not support batch execution LOG_TRACE("not open the batch optimization"); } else if (!use_plan_cache) { LOG_TRACE("not enable the plan_cache", K(use_plan_cache)); - // plan_cache开关没打开 + // plan_cache switch is not turned on } else if (!is_prexecute()) { - // 只对二合一协议开启batch优化 + // Only enable batch optimization for the combined protocol } else if (is_pl_stmt(stmt_type_)) { LOG_TRACE("is pl execution, can't do the batch optimization"); } else if (1 == arraybinding_size_) { @@ -1810,14 +1811,14 @@ int ObMPStmtExecute::try_batch_multi_stmt_optimization(ObSQLSessionInfo &session array_binding_params))) { LOG_WARN("fail to trans_form extend type params_store", K(ret), K(arraybinding_size_)); } else if (OB_FAIL(do_process_single(session, array_binding_params, has_more_result, force_sync_resp, async_resp_used))) { - // 调用do_single接口 + // Call the do_single interface if (THIS_WORKER.need_retry()) { // just go back to large query queue and retry } else if (OB_BATCHED_MULTI_STMT_ROLLBACK == ret) { LOG_TRACE("batched multi_stmt needs rollback", K(ret)); ret = OB_SUCCESS; } else { - // 无论什么报错,都走单行执行一次,用于容错 + // Regardless of the error, execute once per line for fault tolerance int ret_tmp = ret; ret = OB_SUCCESS; LOG_WARN("failed to process batch stmt, cover the error code, reset retry flag, then execute with single row", @@ -1839,10 +1840,9 @@ int ObMPStmtExecute::process_execute_stmt(const ObMultiStmtItem &multi_stmt_item { int ret = OB_SUCCESS; bool need_response_error = true; - - // 执行setup_wb后,所有WARNING都会写入到当前session的WARNING BUFFER中 + // After executing setup_wb, all WARNINGS will be written to the WARNING BUFFER of the current session setup_wb(session); - //============================ 注意这些变量的生命周期 ================================ + //============================ Note the lifecycle of these variables ================================ ObSMConnection *conn = get_conn(); if (OB_FAIL(init_process_var(ctx_, multi_stmt_item, session))) { LOG_WARN("init process var failed.", K(ret), K(multi_stmt_item)); @@ -1897,7 +1897,7 @@ int ObMPStmtExecute::process_execute_stmt(const ObMultiStmtItem &multi_stmt_item } } } - // 释放数组内存避免内存泄漏 + // Release array memory to avoid memory leak OZ (response_result_for_arraybinding(session, exception_array)); } else { @@ -1922,8 +1922,7 @@ int ObMPStmtExecute::process_execute_stmt(const ObMultiStmtItem &multi_stmt_item } } } - - //对于tracelog的处理, 不影响正常逻辑, 错误码无须赋值给ret, 清空WARNING BUFFER + //For tracelog processing, it does not affect normal logic, error code does not need to be assigned to ret, clear WARNING BUFFER do_after_process(session, async_resp_used); if (OB_FAIL(ret) && need_response_error && is_conn_valid()) { @@ -1942,7 +1941,7 @@ int ObMPStmtExecute::process() ObSQLSessionInfo *sess = NULL; bool need_response_error = true; bool need_disconnect = true; - bool async_resp_used = false; // 由事务提交线程异步回复客户端 + bool async_resp_used = false; // Asynchronously reply to the client by the transaction commit thread int64_t query_timeout = 0; ObCurTraceId::TraceId *cur_trace_id = ObCurTraceId::get_trace_id(); @@ -2052,8 +2051,7 @@ int ObMPStmtExecute::process() false, // has_mode false, // force_sync_resp async_resp_used); - - // 退出前打印出SQL语句,便于定位各种问题 + // Print out the SQL statement before exiting, for easy problem location if (OB_FAIL(ret)) { if (OB_EAGAIN == ret) { //large query, do nothing @@ -2109,8 +2107,7 @@ int ObMPStmtExecute::process() LOG_WARN("disconnect connection when process query", K(ret)); } } - - // 如果已经异步回包,则这部分逻辑在cb中执行,这里跳过flush_buffer() + // If the response has already been sent asynchronously, this logic will be executed in cb, so skip flush_buffer() here if (!THIS_WORKER.need_retry()) { if (async_resp_used) { async_resp_used_ = true; diff --git a/src/observer/mysql/obmp_stmt_execute.h b/src/observer/mysql/obmp_stmt_execute.h index edfc31fb4..b35794883 100644 --- a/src/observer/mysql/obmp_stmt_execute.h +++ b/src/observer/mysql/obmp_stmt_execute.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBMP_STMT_EXECUTE_H_ @@ -344,7 +348,7 @@ class ObMPStmtExecute : public ObMPBase virtual int before_process(); virtual int after_process(int error_code); int response_query_header(sql::ObSQLSessionInfo &session, pl::ObDbmsCursorInfo &cursor); - //重载response,在response中不去调用flush_buffer(true);flush_buffer(true)在需要回包时显示调用 + // Overload response, do not call flush_buffer(true) in response; flush_buffer(true) should be explicitly called when a response packet is needed to be sent // copy or convert string, resove %extra_buf_len before result string. @@ -370,7 +374,7 @@ class ObMPStmtExecute : public ObMPBase int64_t arraybinding_size_; int64_t arraybinding_rowcnt_; - ObPSCursorType ps_cursor_type_; // cursor read only 类型的语句 + ObPSCursorType ps_cursor_type_; // cursor read only type statement int64_t single_process_timestamp_; int64_t exec_start_timestamp_; diff --git a/src/observer/mysql/obmp_stmt_fetch.cpp b/src/observer/mysql/obmp_stmt_fetch.cpp index f97cba9b0..3e681179a 100644 --- a/src/observer/mysql/obmp_stmt_fetch.cpp +++ b/src/observer/mysql/obmp_stmt_fetch.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -145,15 +149,15 @@ int ObMPStmtFetch::do_process(ObSQLSessionInfo &session, if (OB_ISNULL(cursor)) { ret = OB_ERR_FETCH_OUT_SEQUENCE; LOG_WARN("cursor not found", K(cursor_id_), K(ret)); - //如果发生fetch过程中找不到cursor的情况,无论什么原因立刻断连接,由应用程序进行容错 + //If a cursor is not found during the fetch process for any reason, immediately disconnect and let the application handle the fault tolerance //disconnect(); } else { ObWaitEventStat total_wait_desc; int64_t fetch_limit = OB_INVALID_COUNT == fetch_rows_ ? INT64_MAX : fetch_rows_; int64_t true_row_num = 0; { - //记录sql_audit的执行等待时间,需要依赖max_wait_guard和total_wait_guard生命周期结束, - //因此要让total_wait_guard的析构早于audit record的统计逻辑 + //Record the execution wait time of sql_audit, which depends on the end of the lifecycle of max_wait_guard and total_wait_guard, + //Therefore, the destructor of total_wait_guard should be called before the audit record statistics logic int64_t execution_id = 0; ObMaxWaitGuard max_wait_guard( enable_perf_event ? &audit_record.exec_record_.max_wait_event_ : nullptr); @@ -177,10 +181,10 @@ int ObMPStmtFetch::do_process(ObSQLSessionInfo &session, exec_start_timestamp_ = ObTimeUtility::current_time(); } if (OB_SUCC(ret)) { - //监控项统计开始 + //Monitoring item statistics start exec_start_timestamp_ = ObTimeUtility::current_time(); - // 本分支内如果出错,全部会在response_result内部处理妥当 - // 无需再额外处理回复错误包 + // All errors within this branch will be handled properly inside response_result + // No need to handle the error response packet additionally session.set_current_execution_id(execution_id); OX(need_response_error = false); if (0 == fetch_limit && !cursor->is_streaming() && cursor->is_ps_cursor() @@ -198,7 +202,7 @@ int ObMPStmtFetch::do_process(ObSQLSessionInfo &session, OX(need_response_error = true); } } - //监控项统计结束 + //Monitoring item statistics end exec_end_timestamp_ = ObTimeUtility::current_time(); // some statistics must be recorded for plan stat, even though sql audit disabled @@ -256,10 +260,10 @@ int ObMPStmtFetch::do_process(ObSQLSessionInfo &session, } } session.partition_hit().freeze(); - session.set_show_warnings_buf(ret); // TODO: 挪个地方性能会更好,减少部分wb拷贝 + session.set_show_warnings_buf(ret); // TODO: Move this to a better place, reduce some wb copy clear_wb_content(session); - // 流式审计信息交给dbms_cursor来做 + // Stream audit information is handled by dbms_cursor ObSQLUtils::handle_audit_record(false/*no need retry*/, EXECUTE_PS_FETCH, session); } return ret; @@ -268,7 +272,7 @@ int ObMPStmtFetch::do_process(ObSQLSessionInfo &session, int ObMPStmtFetch::response_query_header(ObSQLSessionInfo &session, const ColumnsFieldArray *fields) { - // TODO: 增加com类型的处理 + // TODO: Add handling for com type int ret = OB_SUCCESS; bool ac = true; ObSqlCtx ctx; @@ -290,11 +294,11 @@ int ObMPStmtFetch::response_query_header(ObSQLSessionInfo &session, return ret; } -/* fetch协议返向客户端发送结果集 - * 协议上需要注意的: oracle协议每次返回结果集之前需要发送head packet, mysql不需要特殊处理 - * 内存使用上需要注意的: 获取fetch需要返回的row时注意要切换到 cursor 所在的 allocator - * cursor的fetch通过dbms_cursor里的方法完成 - * offset功能实现:通过操作当前偏移量实现 +/* fetch protocol sends result set to the reverse client + * Protocol notes: Oracle protocol needs to send a head packet before returning each result set, MySQL does not require special handling + * Memory usage notes: When obtaining rows to be returned by fetch, note that you need to switch to the allocator where the cursor is located + * Cursor fetch is completed through methods in dbms_cursor + * Offset functionality implementation: achieved by manipulating the current offset */ int ObMPStmtFetch::response_result(pl::ObPLCursorInfo &cursor, ObSQLSessionInfo &session, @@ -340,16 +344,16 @@ int ObMPStmtFetch::response_result(pl::ObPLCursorInfo &cursor, fields = &static_cast(cursor).get_field_columns(); } if (OB_SUCC(ret) && lib::is_oracle_mode()) { - // oracle 模式每次都需要返回head packet - // mysql模式 兼容 mysql 协议,不返回 headpacket + // oracle mode always needs to return head packet + // mysql mode compatible with mysql protocol, do not return headpacket OZ (response_query_header(session, fields)); } if (OB_SUCC(ret)) { - // offset类型 - // TODO: 流式只能前滚,所以只能兼容next,default,relative(偏移量大于0),absolute(其实位置大于当前位置) - // 非流式用OB_RA_ROW_STORE实现,可以根据index访问任意行,兼容所有的offset类型 + // offset type + // TODO: Streaming can only roll forward, so it can only be compatible with next, default, relative (offset greater than 0), absolute (actual position greater than current position) + // Non-streaming uses OB_RA_ROW_STORE to implement, can access any row according to index, compatible with all offset types if (cursor.is_streaming()) { - // 流式结果集需要用到exec_ctx,不能用临时结果代替 + // Streaming result set requires exec_ctx, cannot be replaced by temporary result if (OB_NOT_NULL(cursor.get_cursor_handler()) && OB_NOT_NULL(cursor.get_cursor_handler()->get_result_set())){ exec_ctx = &cursor.get_cursor_handler()->get_result_set()->get_exec_context(); @@ -426,7 +430,7 @@ int ObMPStmtFetch::response_result(pl::ObPLCursorInfo &cursor, break; } case OB_OCI_FETCH_PRIOR: { - // prior协议,无论offset设置为多少,每次都向前滚1行,所以cur需要减1 + // prior protocol, regardless of the offset setting, it always rolls forward by 1 line each time, so cur needs to be decremented by 1 cur = cur - 1; if (cur + fetch_limit > max_count) { need_fetch = false; @@ -450,14 +454,14 @@ int ObMPStmtFetch::response_result(pl::ObPLCursorInfo &cursor, } } if (OB_SUCC(ret) && (cur >= max_count || cur < 0 || max_count <= 0)) { - // fetch过程中,除了OB_ITER_END扫描到结果集末尾的报错被吞掉,其余报错会断开连接 - // oracle中如果扫描超出了范围,不会断开连接,会报OCI_NO_DATA的错误 - // 为了兼容这种表现,超出范围时设置OB_ITER_END错误码,不报错不返回数据,由驱动产生OCI_NO_DATA错误码 + // during the fetch process, except for the OB_ITER_END error indicating the end of the result set which is suppressed, all other errors will disconnect the connection + // in oracle, if the scan exceeds the range, the connection will not be broken, and an OCI_NO_DATA error will be reported + // To be compatible with this behavior, set the OB_ITER_END error code when out of range, do not report an error and do not return data, let the driver generate the OCI_NO_DATA error code need_fetch = false; ret = OB_ITER_END; } if (OB_SUCC(ret)) { - // 只要设置了正确的偏移量,cursor里的指针就要跟着移动 + // As long as the correct offset is set, the pointer in cursor should move accordingly OZ (cursor.set_current_position(cur)); } } @@ -514,7 +518,7 @@ int ObMPStmtFetch::response_result(pl::ObPLCursorInfo &cursor, } if (OB_ITER_END == ret || OB_READ_NOTHING == ret) { ret = OB_SUCCESS; - // need_fetch 为 true 并且 得到了 OB_ITER_END 错误码,说明正常找到了最后一行,要设置last_row + // need_fetch is true and got the OB_ITER_END error code, which means the last row was found normally, need to set last_row if (need_fetch || !cursor.is_scrollable()) { last_row = true; } @@ -616,7 +620,7 @@ int ObMPStmtFetch::process_fetch_stmt(ObSQLSessionInfo &session, bool &need_response_error) { int ret = OB_SUCCESS; - // 执行setup_wb后,所有WARNING都会写入到当前session的WARNING BUFFER中 + // After executing setup_wb, all WARNINGS will be written to the WARNING BUFFER of the current session setup_wb(session); //set session log_level.Must use ObThreadLogLevelUtils::clear() in pair ObThreadLogLevelUtils::init(session.get_log_id_level_map()); @@ -626,7 +630,7 @@ int ObMPStmtFetch::process_fetch_stmt(ObSQLSessionInfo &session, session.get_effective_tenant_id()))) { LOG_WARN("failed to check_and_refresh_schema", K(ret)); } else { - //每次执行不同sql都需要更新 + //Each execution of different SQL requires an update if (OB_FAIL(update_transmission_checksum_flag(session))) { LOG_WARN("update transmisson checksum flag failed", K(ret)); } else { @@ -644,10 +648,10 @@ int ObMPStmtFetch::process_fetch_stmt(ObSQLSessionInfo &session, LOG_WARN("set thread local debug sync actions to session actions failed", K(tmp_ret)); } } - //对于tracelog的处理,不影响正常逻辑,错误码无须赋值给ret + //For the handling of tracelog, it does not affect the normal logic, and the error code does not need to be assigned to ret { int tmp_ret = OB_SUCCESS; - //清空WARNING BUFFER + //Clear WARNING BUFFER tmp_ret = do_after_process(session, false/*no asyn response*/); UNUSED(tmp_ret); } diff --git a/src/observer/mysql/obmp_stmt_fetch.h b/src/observer/mysql/obmp_stmt_fetch.h index e76188770..54369d5e6 100644 --- a/src/observer/mysql/obmp_stmt_fetch.h +++ b/src/observer/mysql/obmp_stmt_fetch.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SRC_OBSERVER_MYSQL_OBMP_STMT_FETCH_H_ @@ -89,7 +93,7 @@ class ObMPStmtFetch : public ObMPBase int response_query_header(sql::ObSQLSessionInfo &session, const ColumnsFieldArray *fields); virtual int before_process(); void record_stat(const sql::stmt::StmtType type, const int64_t end_time) const; - //重载response,在response中不去调用flush_buffer(true);flush_buffer(true)在需要回包时显示调用 + // Overload response, do not call flush_buffer(true) in response; flush_buffer(true) should be explicitly called when a response packet is needed to be sent private: int64_t cursor_id_; int64_t fetch_rows_; diff --git a/src/observer/mysql/obmp_stmt_get_piece_data.cpp b/src/observer/mysql/obmp_stmt_get_piece_data.cpp index 255ae538f..017291ecd 100644 --- a/src/observer/mysql/obmp_stmt_get_piece_data.cpp +++ b/src/observer/mysql/obmp_stmt_get_piece_data.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -80,7 +84,7 @@ int ObMPStmtGetPieceData::process() ObSQLSessionInfo *sess = NULL; bool need_response_error = true; bool need_disconnect = true; - bool async_resp_used = false; // 由事务提交线程异步回复客户端 + bool async_resp_used = false; // Asynchronously reply to the client by the transaction commit thread int64_t query_timeout = 0; ObSMConnection *conn = get_conn(); @@ -181,10 +185,9 @@ int ObMPStmtGetPieceData::process_get_piece_data_stmt(ObSQLSessionInfo &session) ObThreadLogLevelUtils::init(session.get_log_id_level_map()); ret = do_process(session); ObThreadLogLevelUtils::clear(); - - //对于tracelog的处理,不影响正常逻辑,错误码无须赋值给ret + //For the handling of tracelog, it does not affect the normal logic, and the error code does not need to be assigned to ret int tmp_ret = OB_SUCCESS; - //清空WARNING BUFFER + //Clear WARNING BUFFER tmp_ret = do_after_process(session, false); UNUSED(tmp_ret); return ret; @@ -219,7 +222,7 @@ int ObMPStmtGetPieceData::do_process(ObSQLSessionInfo &session) session.sql_sess_record_sql_stat_start_value(sqlstat_record); } int64_t execution_id = 0; - //监控项统计开始 + //Monitoring item statistics start exec_start_timestamp_ = ObTimeUtility::current_time(); if (FALSE_IT(execution_id = gctx_.sql_engine_->get_execution_id())) { //nothing to do @@ -230,8 +233,7 @@ int ObMPStmtGetPieceData::do_process(ObSQLSessionInfo &session) exec_end_timestamp_ = ObTimeUtility::current_time(); } else { session.set_current_execution_id(execution_id); - - //监控项统计结束 + //Monitoring item statistics end exec_end_timestamp_ = ObTimeUtility::current_time(); // some statistics must be recorded for plan stat, even though sql audit disabled @@ -261,14 +263,14 @@ int ObMPStmtGetPieceData::do_process(ObSQLSessionInfo &session) // if diagnostic stmt execute successfully, it dosen't clear the warning message session.update_show_warnings_buf(); } else { - session.set_show_warnings_buf(ret); // TODO: 挪个地方性能会更好,减少部分wb拷贝 + session.set_show_warnings_buf(ret); // TODO: Move this to a better place, reduce some wb copy } //set read_only if (OB_FAIL(ret)) { bool is_partition_hit = session.partition_hit().get_bool(); int err = send_error_packet(ret, NULL, is_partition_hit); - if (OB_SUCCESS != err) { // 发送error包 + if (OB_SUCCESS != err) { // send error packet LOG_WARN("send error packet failed", K(ret), K(err)); } } @@ -340,7 +342,7 @@ int ObMPStmtGetPieceData::response_result(ObSQLSessionInfo &session) ? 0 : piece->get_buffer_array()->count(); if (0 != count && offset_ == count - 1 && ObLastPiece == piece_buf.get_piece_mode()) { - // 证明发送完全部数据 + // Prove that all data has been sent if (OB_FAIL(piece_cache->remove_piece(piece_cache->get_piece_key(stmt_id_, column_id_), session))) { LOG_WARN("remove piece fail", K(stmt_id_), K(column_id_)); diff --git a/src/observer/mysql/obmp_stmt_get_piece_data.h b/src/observer/mysql/obmp_stmt_get_piece_data.h index 28b29f8ac..b08f661d8 100644 --- a/src/observer/mysql/obmp_stmt_get_piece_data.h +++ b/src/observer/mysql/obmp_stmt_get_piece_data.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBMP_STMT_GET_PIECE_DATA_H_ diff --git a/src/observer/mysql/obmp_stmt_prepare.cpp b/src/observer/mysql/obmp_stmt_prepare.cpp index a3e73d644..45b64ad39 100644 --- a/src/observer/mysql/obmp_stmt_prepare.cpp +++ b/src/observer/mysql/obmp_stmt_prepare.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -87,23 +91,23 @@ int ObMPStmtPrepare::multiple_query_check(ObSQLSessionInfo &session, bool parse_fail = false; ObMPParseStat parse_stat; force_sync_resp = true; - /* MySQL处理Multi-Stmt出错时候的行为: - * 遇到首次运行失败(包括解析或执行)的SQL后,停止读取后继数据 - * 例如: + /* MySQL behavior when handling Multi-Stmt errors: + * After encountering the first failed SQL (including parsing or execution), stop reading subsequent data + * For example: * (1) select 1; selct 2; select 3; - * select 1执行成功,selct 2报语法错误,select 3不被执行 + * select 1 executes successfully, selct 2 reports a syntax error, select 3 is not executed * (2) select 1; drop table not_exists_table; select 3; - * select 1执行成功,drop table not_exists_table报表不存在错误,select 3不被执行 + * select 1 executes successfully, drop table not_exists_table reports a table does not exist error, select 3 is not executed * - * 特别注意: - * split_multiple_stmt是根据分号来分割语句,但有可能遇到“语法错误”, - * 这里说的“语法错误”不是说select写成了selct,而是“token”级别的语法错误,例如语句 + * Special note: + * split_multiple_stmt splits statements based on semicolons, but there might be "syntax errors", + * here "syntax error" does not mean select is written as selct, but "token" level syntax errors, for example the statement * select 1;`select 2; select 3; - * 上面`和'都没有形成闭合的字符串token,token parser会报告语法错误 - * 上面的例子中,得到的queries.count() 等于 2,分别为select 1和 `select 2; select 3; + * In the above example, neither ` nor ' form closed string tokens, the token parser will report a syntax error + * In the above example, the queries.count() equals 2, which are select 1 and `select 2; select 3; */ ret = parser.split_multiple_stmt(sql, queries, parse_stat, false, true); - if (OB_SUCC(ret)) { // ret=SUCC,并不意味着parse就一定成功,可能最后一个query是parse失败的 + if (OB_SUCC(ret)) { // ret=SUCC does not necessarily mean that parse was successful, the last query may have failed to parse if (OB_UNLIKELY(queries.count() <= 0)) { LOG_ERROR("emtpy query count. client would have suspended. never be here!", K(sql), K(parse_fail)); @@ -114,17 +118,17 @@ int ObMPStmtPrepare::multiple_query_check(ObSQLSessionInfo &session, } else { if (OB_UNLIKELY(parse_stat.parse_fail_ && (0 == parse_stat.fail_query_idx_) && ObSQLUtils::check_need_disconnect_parser_err(parse_stat.fail_ret_))) { - // 进入本分支,说明在multi_query中的某条query parse失败,如果不是语法错,则进入该分支 - // 如果当前query_count 为1, 则不断连接;如果大于1, - // 则需要在发错误包之后断连接,防止客户端一直在等接下来的回包 - // 这个改动是为了解决 + // Enter this branch, indicating that parsing of a query in multi_query failed, if not due to a syntax error, then enter this branch + // If the current query_count is 1, then keep connecting; if greater than 1, + // then it is necessary to disconnect after sending the error packet to prevent the client from waiting indefinitely for the next response + // This change is to solve ret = parse_stat.fail_ret_; need_response_error = true; } } } else { - // 进入本分支,说明push_back出错,OOM,委托外层代码返回错误码 - // 且进入改分支之后,要断连接 + // Enter this branch, indicating that push_back failed due to OOM, delegate the outer code to return an error code + // and after entering this branch, the connection should be terminated need_response_error = true; LOG_WARN("need response error", K(ret)); } @@ -137,7 +141,7 @@ int ObMPStmtPrepare::process() int ret = OB_SUCCESS; ObSQLSessionInfo *sess = NULL; bool need_response_error = true; - bool async_resp_used = false; // 由事务提交线程异步回复客户端 + bool async_resp_used = false; // Asynchronously reply to the client by the transaction commit thread int64_t query_timeout = 0; ObSMConnection *conn = get_conn(); bool need_disconnect = true; @@ -334,16 +338,15 @@ int ObMPStmtPrepare::process_prepare_stmt(const ObMultiStmtItem &multi_stmt_item } ObThreadLogLevelUtils::clear(); } - - //对于tracelog的处理,不影响正常逻辑,错误码无须赋值给ret + //For the handling of tracelog, it does not affect the normal logic, and the error code does not need to be assigned to ret int tmp_ret = OB_SUCCESS; - //清空WARNING BUFFER + //Clear WARNING BUFFER tmp_ret = do_after_process(session, async_resp_used); tmp_ret = record_flt_trace(session); - // need_response_error这个变量保证仅在 - // do { do_process } while(retry) 之前出错才会 - // 走到send_error_packet逻辑 - // 所以无需考虑当前为sync还是async模式 + // the need_response_error variable ensures that it only occurs in + // do { do_process } while(retry) will only occur if an error happens before + // Walk to the send_error_packet logic + // So there is no need to consider whether the current mode is sync or async if (!OB_SUCC(ret) && need_response_error && is_conn_valid()) { send_error_packet(ret, NULL); } @@ -401,7 +404,7 @@ int ObMPStmtPrepare::do_process(ObSQLSessionInfo &session, ObPsStmtId inner_stmt_id = OB_INVALID_ID; /* !!! - * 注意req_timeinfo_guard一定要放在result前面 + * Note that req_timeinfo_guard must be placed before result * !!! */ ObReqTimeGuard req_timeinfo_guard; @@ -453,11 +456,10 @@ int ObMPStmtPrepare::do_process(ObSQLSessionInfo &session, ret = OB_ERR_UNEXPECTED; LOG_WARN("ps : get inner stmt id fail.", K(ret), K(result.get_statement_id())); } else { - //监控项统计开始 + //Monitoring item statistics start exec_start_timestamp_ = ObTimeUtility::current_time(); - - // 本分支内如果出错,全部会在response_result内部处理妥当 - // 无需再额外处理回复错误包 + // All errors within this branch will be handled properly inside response_result + // No need to handle the error response packet additionally need_response_error = false; is_diagnostics_stmt = ObStmt::is_diagnostic_stmt(result.get_literal_stmt_type()); ctx_.is_show_trace_stmt_ = ObStmt::is_show_trace_stmt(result.get_literal_stmt_type()); @@ -477,7 +479,7 @@ int ObMPStmtPrepare::do_process(ObSQLSessionInfo &session, plan_ctx->get_timeout_timestamp()); } } - //监控项统计结束 + //Monitoring item statistics end exec_end_timestamp_ = ObTimeUtility::current_time(); // some statistics must be recorded for plan stat, even though sql audit disabled @@ -509,12 +511,11 @@ int ObMPStmtPrepare::do_process(ObSQLSessionInfo &session, ctx_.cur_sql_, result.get_physical_plan()); } - - // 重试需要满足一下条件: - // 1. rs.open 执行失败 - // 2. 没有给客户端返回结果,本次执行没有副作用 - // 3. need_retry(result, ret):schema 或 location cache 失效 - // 4. 小于重试次数限制 + // Retry needs to meet the following conditions: + // 1. rs.open execution failed + // 2. No result was returned to the client, this execution has no side effects + // 3. need_retry(result, ret): schema or location cache invalidation + // 4. less than retry count limit if (OB_UNLIKELY(retry_ctrl_.need_retry())) { LOG_WARN("try to execute again", K(ret), @@ -522,8 +523,8 @@ int ObMPStmtPrepare::do_process(ObSQLSessionInfo &session, "retry_type", retry_ctrl_.get_retry_type(), "timeout_remain", THIS_WORKER.get_timeout_remain()); } else { - // 首个plan执行完成后立即freeze partition hit - // partition_hit一旦freeze后,后继的try_set_bool操作都不生效 + // Immediately freeze partition hit after the first plan execution completes + // partition_hit once frozen, subsequent try_set_bool operations are ineffective if (OB_LIKELY(NULL != result.get_physical_plan())) { session.partition_hit().freeze(); } @@ -533,18 +534,18 @@ int ObMPStmtPrepare::do_process(ObSQLSessionInfo &session, // if diagnostic stmt execute successfully, it dosen't clear the warning message session.update_show_warnings_buf(); } else { - session.set_show_warnings_buf(ret); // TODO: 挪个地方性能会更好,减少部分wb拷贝 + session.set_show_warnings_buf(ret); // TODO: Move this to a better place, reduce some wb copy } if (!OB_SUCC(ret) && !async_resp_used && need_response_error && is_conn_valid() && !THIS_WORKER.need_retry()) { LOG_WARN("query failed", K(ret), K(retry_ctrl_.need_retry()), K_(sql)); - // 当need_retry=false时,可能给客户端回过包了,可能还没有回过任何包。 - // 不过,可以确定:这个请求出错了,还没处理完。如果不是已经交给异步EndTrans收尾, - // 则需要在下面回复一个error_packet作为收尾。否则后面没人帮忙发错误包给客户端了, - // 可能会导致客户端挂起等回包。 + // When need_retry=false, a packet may have been sent to the client, or no packets may have been sent at all. + // However, it can be determined: this request has errored, and is not yet complete. If it has not already been handed over to asynchronous EndTrans for finalization, + // then it is necessary to reply with an error_packet below as a conclusion. Otherwise, no one will help send the error packet to the client afterwards, + // May cause the client to hang waiting for a response. bool is_partition_hit = session.get_err_final_partition_hit(ret); int err = send_error_packet(ret, NULL, is_partition_hit); - if (OB_SUCCESS != err) { // 发送error包 + if (OB_SUCCESS != err) { // send error packet LOG_WARN("send error packet failed", K(ret), K(err)); } } diff --git a/src/observer/mysql/obmp_stmt_prepare.h b/src/observer/mysql/obmp_stmt_prepare.h index 19f89ccb4..383fb4ab4 100644 --- a/src/observer/mysql/obmp_stmt_prepare.h +++ b/src/observer/mysql/obmp_stmt_prepare.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBMP_STMT_PREPARE_H_ diff --git a/src/observer/mysql/obmp_stmt_prexecute.cpp b/src/observer/mysql/obmp_stmt_prexecute.cpp index 7a03cac5f..56393cb64 100644 --- a/src/observer/mysql/obmp_stmt_prexecute.cpp +++ b/src/observer/mysql/obmp_stmt_prexecute.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -360,10 +364,10 @@ int ObMPStmtPrexecute::before_process() } } session->set_last_trace_id(ObCurTraceId::get_trace_id()); - //对于tracelog的处理,不影响正常逻辑,错误码无须赋值给ret + //For the handling of tracelog, it does not affect the normal logic, and the error code does not need to be assigned to ret if (session != NULL && OB_FAIL(ret)) { int tmp_ret = OB_SUCCESS; - //清空WARNING BUFFER + //Clear WARNING BUFFER tmp_ret = do_after_process(*session, false/*no asyn response*/); UNUSED(tmp_ret); } @@ -393,12 +397,12 @@ int ObMPStmtPrexecute::clean_ps_stmt(ObSQLSessionInfo &session, if (first_time_ && ((!is_batch && !is_local_retry) || (is_batch && THIS_WORKER.need_retry()))) { - /* 清理 ps stmt 的时机 - * 1. 第一次执行时,也就是在 before_process 中执行 prepare 生成 stmt 时 - * 2. 第一次执行且 非batch 模式, 非 local retry 的报错都需要清理 - * 3. 第一次执行且 batch 模式, 参考 try_batch_multi_stmt_optimization 的实现, - * 只有 THIS_WORKER.need_retry() 的时候队列重试需要清理, - * 其他时候都退化成了 local 重试,不需要清理 + /* Timing for cleaning up ps stmt + * 1. On the first execution, i.e., when prepare generates stmt in before_process + * 2. On the first execution and not in batch mode, all errors that are not local retries need to be cleaned up + * 3. On the first execution and in batch mode, refer to the implementation of try_batch_multi_stmt_optimization, + * cleanup is only needed when THIS_WORKER.need_retry(), + * otherwise, it degrades into a local retry, which does not require cleanup */ get_ctx().cur_sql_ = sql_; get_ctx().raw_sql_ = sql_; @@ -430,7 +434,7 @@ int ObMPStmtPrexecute::execute_response(ObSQLSessionInfo &session, ObDbmsCursorInfo *cursor = NULL; bool use_stream = false; inner_stmt_id = OB_INVALID_ID; - // 1.创建cursor + // 1.create cursor ObPsStmtId inner_stmt_id = OB_INVALID_ID; if (OB_NOT_NULL(session.get_cursor(stmt_id_))) { if (OB_FAIL(session.close_cursor(stmt_id_))) { @@ -454,7 +458,7 @@ int ObMPStmtPrexecute::execute_response(ObSQLSessionInfo &session, OZ (cursor->init_params(params.count())); OZ (cursor->get_exec_params().assign(params)); OZ (gctx_.sql_engine_->init_result_set(ctx, result)); - //监控项统计开始 + //Monitoring item statistics start set_exec_start_timestamp(ObTimeUtility::current_time()); if (OB_SUCC(ret)) { ObPLExecCtx pl_ctx(cursor->get_allocator(), &result.get_exec_context(), NULL/*params*/, @@ -509,7 +513,7 @@ int ObMPStmtPrexecute::execute_response(ObSQLSessionInfo &session, LOG_WARN("get tenant schema guard failed ", K(ret), K(session.get_effective_tenant_id())); } if (-1 == cursor->get_current_position() && iteration_count_ > 0) { - // execute 如果返回数据,需要更新一下cursor的指针位置 + // execute if data is returned, need to update the cursor's pointer position OX (cursor->set_current_position(0)); } while (OB_SUCC(ret) && row_num < iteration_count_ @@ -663,9 +667,9 @@ int ObMPStmtPrexecute::execute_response(ObSQLSessionInfo &session, LOG_WARN("prexecute clean ps stmt fail. ", K(ret), K(tmp_ret)); } } else { - //监控项统计开始 + //Monitoring item statistics start set_exec_start_timestamp(ObTimeUtility::current_time()); - // 本分支内如果出错, 全部会在response_result内部处理妥当, 无需再额外处理回复错误包 + // If an error occurs within this branch, it will be handled properly inside response_result, no need to handle the error response packet again need_response_error = false; is_diagnostics_stmt = ObStmt::is_diagnostic_stmt(result.get_literal_stmt_type()); ctx.is_show_trace_stmt_ = ObStmt::is_show_trace_stmt(result.get_literal_stmt_type()); @@ -748,7 +752,7 @@ int ObMPStmtPrexecute::response_query_header(ObSQLSessionInfo &session, ObResultSet &result, bool need_flush_buffer) { - // TODO: 增加com类型的处理 + // TODO: Add handling for com type int ret = OB_SUCCESS; if (!prepare_packet_sent_) { const ColumnsFieldIArray *fields = result.get_field_columns(); @@ -766,9 +770,9 @@ int ObMPStmtPrexecute::response_query_header(ObSQLSessionInfo &session, // check has arraybinding result if (OB_NOT_NULL(returning_params_field) && is_arraybinding_has_result_type(stmt_type_)) { /* - * 1. arraybinding 带结果集的语句类型 包含了 DML 语句 + 匿名块 + CALL - * 1. returning_params_field 不为空 且语句类型满足 1 的情况,认为 arraybinding 有结果集返回 - * 2. param 的个数包含了 returning 的个数 + * 1. arraybinding statement type with result set includes DML statements + anonymous blocks + CALL + * 1. if returning_params_field is not empty and the statement type satisfies condition 1, it is considered that arraybinding has a result set to return + * 2. the number of params includes the number of returnings */ returning_params_cnt = returning_params_field->count(); params_cnt = params_cnt + returning_params_cnt; @@ -779,11 +783,12 @@ int ObMPStmtPrexecute::response_query_header(ObSQLSessionInfo &session, if (((0 != iteration_count_ || stmt::T_ANONYMOUS_BLOCK == stmt_type_) && fields_count > 0) || (OB_OCI_EXACT_FETCH == exec_mode_ && stmt::T_SELECT == stmt_type_)) { - /* has result 的几种情况: - * 1. 预取且有结果集: iteration_count_ > 0 & fields_count > 0 - * 2. 匿名块且有结果集 : T_ANONYMOUS_BLOCK == stmt_type_ && fields_count > 0. - * 匿名块情况下无论 iteration_count_ 是多少,是否有预取, 都需要设置 has_result - * 3. exact_fetch 模式 : OB_OCI_EXACT_FETCH == exec_mode_ && stmt::T_SELECT == stmt_type_ + /* has result cases: + * 1. Prefetch and has result set: iteration_count_ > 0 & fields_count > 0 + * 2. Anonymous block and has result set: T_ANONYMOUS_BLOCK == stmt_type_ && fields_count > 0. + * In the case of an anonymous block, regardless of the value of iteration_count_, + * whether prefetching is done or not, has_result needs to be set + * 3. exact_fetch mode: OB_OCI_EXACT_FETCH == exec_mode_ && stmt::T_SELECT == stmt_type_ */ has_result = 1; @@ -791,7 +796,7 @@ int ObMPStmtPrexecute::response_query_header(ObSQLSessionInfo &session, // check ps out if ((stmt::T_ANONYMOUS_BLOCK == stmt_type_ || stmt::T_CALL_PROCEDURE == stmt_type_) && has_result) { - // PL 语句 + has_result + // PL statement + has_result ps_out = true; } @@ -804,7 +809,7 @@ int ObMPStmtPrexecute::response_query_header(ObSQLSessionInfo &session, result.get_warning_count(), has_result, has_arraybinding_result, - ps_out && get_arraybounding()))) { // 只有 arraybinding + PL + 有结果集返回, prepare 中的 ps_out 才设置为 true + ps_out && get_arraybounding()))) { // Only arraybinding + PL + result set returned, ps_out in prepare is set to true LOG_WARN("packet send prepare infomation fail", K(ret), K(stmt_id_)); } else if (params_cnt > 0 && OB_FAIL(send_param_field_packet(session, param_fields))) { LOG_WARN("response param packet fail", K(ret)); @@ -832,7 +837,7 @@ int ObMPStmtPrexecute::response_param_query_header(ObSQLSessionInfo &session, int64_t warning_count, bool ps_out) { - // TODO: 增加com类型的处理 + // TODO: Add handling for com type int ret = OB_SUCCESS; if (!prepare_packet_sent_) { uint64_t params_cnt = 0; @@ -928,7 +933,7 @@ int ObMPStmtPrexecute::after_do_process_for_arraybinding(ObSQLSessionInfo &sessi bool ps_out = result.is_pl_stmt(stmt_type_) && result.is_with_rows() ? true : false; if (ret != OB_SUCCESS) { - // 当前执行报错的情况下,如果不再retry,并且是非batch优化才需要回一个eof包 + // In the case of an error during current execution, if no retry is to be performed and it is not a batch optimization, an eof packet needs to be returned if (need_response_pkg_when_error_occur()) { if (OB_SUCCESS != (response_ret = send_eof_packet(session, 0, false, true, ps_out))) { LOG_WARN("send eof field failed", K(response_ret), K(ret)); @@ -937,13 +942,13 @@ int ObMPStmtPrexecute::after_do_process_for_arraybinding(ObSQLSessionInfo &sessi } else { if (ctx_.multi_stmt_item_.is_ab_batch_opt() && ctx_.get_batch_params_count() == arraybinding_size_) { - // 执行成功,全部数据都完成batch优化,直接回eof包 + // Execution successful, all data has been batch optimized, directly return eof packet if (OB_SUCCESS != (response_ret = send_eof_packet(session, 0, false, true, false))) { ret = response_ret; LOG_WARN("send eof field failed", K(response_ret), K(ret)); } } else if (curr_sql_idx_ == (arraybinding_size_ - 1)) { - // 最后一行数据完成执行 + // The last line of data has finished execution if (OB_SUCCESS != (response_ret = send_eof_packet(session, 0, false, true, ps_out))) { ret = response_ret; LOG_WARN("send eof field failed", K(response_ret), K(ret)); @@ -960,7 +965,7 @@ bool ObMPStmtPrexecute::need_response_pkg_when_error_occur() && !THIS_WORKER.need_retry() && get_arraybounding()) { if (ctx_.multi_stmt_item_.is_batched_multi_stmt()) { - // 如果是batch优化,所有失败的场景下都不回包,因为还会做强制重试 + // If it is batch optimization, no response will be sent in all failure scenarios because a forced retry will still be performed bret = false; } else { bret = true; diff --git a/src/observer/mysql/obmp_stmt_prexecute.h b/src/observer/mysql/obmp_stmt_prexecute.h index cd5663fc8..95ec21aef 100644 --- a/src/observer/mysql/obmp_stmt_prexecute.h +++ b/src/observer/mysql/obmp_stmt_prexecute.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBMP_STMT_PREXECUTE_H_ @@ -145,11 +149,11 @@ class ObMPStmtPrexecute : public ObMPStmtExecute common::ObString sql_; uint64_t sql_len_; /* - * iteration_count_ 的含义 - * 1. DML 语句 + iteration_count_ > 1 表示当前是 arraybinding 模式 - * 2. arraybinding 模式下, 此值代表了 array 的大小 - * 3. exact_fetch + select 模式下, 此值代表了返回结果集的大小 - * 4. 其余场景,此值 > 0 表示需要有结果集返回 + * the meaning of iteration_count_ + * 1. DML statement + iteration_count_ > 1 indicates that the current mode is arraybinding mode + * 2. in arraybinding mode, this value represents the size of the array + * 3. in exact_fetch + select mode, this value represents the size of the result set returned + * 4. in other scenarios, this value > 0 indicates that a result set needs to be returned **/ int32_t iteration_count_; uint32_t exec_mode_; diff --git a/src/observer/mysql/obmp_stmt_reset.cpp b/src/observer/mysql/obmp_stmt_reset.cpp index 2d8880033..16ecde583 100644 --- a/src/observer/mysql/obmp_stmt_reset.cpp +++ b/src/observer/mysql/obmp_stmt_reset.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/mysql/obmp_stmt_reset.h b/src/observer/mysql/obmp_stmt_reset.h index 2893c381c..404ddfd95 100644 --- a/src/observer/mysql/obmp_stmt_reset.h +++ b/src/observer/mysql/obmp_stmt_reset.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBMP_STMT_RESET_H_ diff --git a/src/observer/mysql/obmp_stmt_send_long_data.cpp b/src/observer/mysql/obmp_stmt_send_long_data.cpp index 2f6432338..eaff18076 100644 --- a/src/observer/mysql/obmp_stmt_send_long_data.cpp +++ b/src/observer/mysql/obmp_stmt_send_long_data.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -92,7 +96,7 @@ int ObMPStmtSendLongData::process() int ret = OB_SUCCESS; ObSQLSessionInfo *sess = NULL; bool need_response_error = true; - bool async_resp_used = false; // 由事务提交线程异步回复客户端 + bool async_resp_used = false; // Asynchronously reply to the client by the transaction commit thread int64_t query_timeout = 0; ObSMConnection *conn = get_conn(); @@ -216,10 +220,9 @@ int ObMPStmtSendLongData::process_send_long_data_stmt(ObSQLSessionInfo &session) ObThreadLogLevelUtils::init(session.get_log_id_level_map()); ret = do_process(session); ObThreadLogLevelUtils::clear(); - - //对于tracelog的处理,不影响正常逻辑,错误码无须赋值给ret + //For the handling of tracelog, it does not affect the normal logic, and the error code does not need to be assigned to ret int tmp_ret = OB_SUCCESS; - //清空WARNING BUFFER + //Clear WARNING BUFFER tmp_ret = do_after_process(session, false); UNUSED(tmp_ret); return ret; @@ -261,12 +264,11 @@ int ObMPStmtSendLongData::do_process(ObSQLSessionInfo &session) } else if (OB_FAIL(store_piece(session))) { exec_start_timestamp_ = ObTimeUtility::current_time(); } else { - //监控项统计开始 + //Monitoring item statistics start exec_start_timestamp_ = ObTimeUtility::current_time(); session.set_current_execution_id(execution_id); - - //监控项统计结束 + //Monitoring item statistics end exec_end_timestamp_ = ObTimeUtility::current_time(); // some statistics must be recorded for plan stat, even though sql audit disabled @@ -294,7 +296,7 @@ int ObMPStmtSendLongData::do_process(ObSQLSessionInfo &session) // if diagnostic stmt execute successfully, it dosen't clear the warning message session.update_show_warnings_buf(); } else { - session.set_show_warnings_buf(ret); // TODO: 挪个地方性能会更好,减少部分wb拷贝 + session.set_show_warnings_buf(ret); // TODO: Move this to a better place, reduce some wb copy } if (enable_sql_audit) { diff --git a/src/observer/mysql/obmp_stmt_send_long_data.h b/src/observer/mysql/obmp_stmt_send_long_data.h index e1811208c..cdec15a0e 100644 --- a/src/observer/mysql/obmp_stmt_send_long_data.h +++ b/src/observer/mysql/obmp_stmt_send_long_data.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBMP_STMT_SEND_LONG_DATA_H_ diff --git a/src/observer/mysql/obmp_stmt_send_piece_data.cpp b/src/observer/mysql/obmp_stmt_send_piece_data.cpp index bde67f557..0da19abb0 100644 --- a/src/observer/mysql/obmp_stmt_send_piece_data.cpp +++ b/src/observer/mysql/obmp_stmt_send_piece_data.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -110,7 +114,7 @@ int ObMPStmtSendPieceData::process() int ret = OB_SUCCESS; ObSQLSessionInfo *sess = NULL; bool need_response_error = true; - bool async_resp_used = false; // 由事务提交线程异步回复客户端 + bool async_resp_used = false; // Asynchronously reply to the client by the transaction commit thread int64_t query_timeout = 0; ObSMConnection *conn = get_conn(); @@ -207,10 +211,9 @@ int ObMPStmtSendPieceData::process_send_long_data_stmt(ObSQLSessionInfo &session ObThreadLogLevelUtils::init(session.get_log_id_level_map()); ret = do_process(session); ObThreadLogLevelUtils::clear(); - - //对于tracelog的处理,不影响正常逻辑,错误码无须赋值给ret + //For the handling of tracelog, it does not affect the normal logic, and the error code does not need to be assigned to ret int tmp_ret = OB_SUCCESS; - //清空WARNING BUFFER + //Clear WARNING BUFFER tmp_ret = do_after_process(session, false); UNUSED(tmp_ret); return ret; @@ -244,7 +247,7 @@ int ObMPStmtSendPieceData::do_process(ObSQLSessionInfo &session) } int64_t execution_id = 0; ObString sql = "send long data"; - //监控项统计开始 + //Monitoring item statistics start exec_start_timestamp_ = ObTimeUtility::current_time(); if (FALSE_IT(execution_id = gctx_.sql_engine_->get_execution_id())) { //nothing to do @@ -254,7 +257,7 @@ int ObMPStmtSendPieceData::do_process(ObSQLSessionInfo &session) } else if (OB_FAIL(store_piece(session))) { exec_end_timestamp_ = ObTimeUtility::current_time(); } else { - //监控项统计结束 + //Monitoring item statistics end exec_end_timestamp_ = ObTimeUtility::current_time(); session.set_current_execution_id(execution_id); @@ -284,14 +287,14 @@ int ObMPStmtSendPieceData::do_process(ObSQLSessionInfo &session) // if diagnostic stmt execute successfully, it dosen't clear the warning message session.update_show_warnings_buf(); } else { - session.set_show_warnings_buf(ret); // TODO: 挪个地方性能会更好,减少部分wb拷贝 + session.set_show_warnings_buf(ret); // TODO: Move this to a better place, reduce some wb copying } //set read_only if (OB_FAIL(ret)) { bool is_partition_hit = session.partition_hit().get_bool(); int err = send_error_packet(ret, NULL, is_partition_hit); - if (OB_SUCCESS != err) { // 发送error包 + if (OB_SUCCESS != err) { // send error packet LOG_WARN("send error packet failed", K(ret), K(err)); } } @@ -578,11 +581,11 @@ int ObPieceCache::get_piece_buffer(int32_t stmt_id, LOG_WARN("piece is null", K(stmt_id), K(ret)); } else if (NULL == piece->get_buffer_array() || 0 == piece->get_buffer_array()->count()) { - // piecebuffer 空了的话, 就直接摘掉piece + // if piecebuffer is empty, just remove the piece if (OB_FAIL(remove_piece(get_piece_key(stmt_id, param_id), session))) { LOG_WARN("remove piece fail", K(stmt_id), K(param_id)); } else { - // fetch阶段,前一段读到了最后一个数据,但是长度恰好和piecesize相等,所以没有设置last标记 + // fetch stage, the previous segment read the last data, but the length is exactly equal to piecesize, so the last flag was not set piece_buf.set_piece_mode(ObLastPiece); piece_buf.set_piece_buffer(NULL); } @@ -598,7 +601,7 @@ int ObPieceCache::get_piece_buffer(int32_t stmt_id, ObString *buf = old_piece_buf->get_piece_buffer(); char *&pos = old_piece_buf->get_position(); int64_t len = piece_size; - // buf 需要根据piece_size截断 + // buf needs to be truncated according to piece_size if ((buf->length() - (pos - (buf->ptr()))) <= piece_size) { old_piece_buf->set_piece_mode(ObLastPiece); piece_buf.set_piece_mode(ObLastPiece); @@ -711,7 +714,7 @@ int ObPieceCache::make_piece_buffer(ObIAllocator *allocator, ObPieceMode mode, ObString *buf) { - // 这个buf是不是要deep copy一份,外层的生命周期不可控 + // Is this buf supposed to be deep copied, the lifecycle of the outer layer is uncontrollable int ret = OB_SUCCESS; void *piece_mem = NULL; OV (OB_NOT_NULL(piece_mem = allocator->alloc(sizeof(ObPieceBuffer))), @@ -752,10 +755,9 @@ int ObPieceCache::add_piece_buffer(ObPiece *piece, { int ret = OB_SUCCESS; ObPieceBuffer *piece_buffer = NULL; - - // 这里直接push进去了,piece_buffer的生命周期是不是也要考虑 - // 实现应该改一下,不要再传piece_buffer了,传buf和piece_mode - // 内部调用make_piece_buffer分配内存 + // Here it is directly pushed in, should the lifecycle of piece_buffer also be considered? + // The implementation should be changed, do not pass piece_buffer anymore, pass buf and piece_mode + // Internal call to make_piece_buffer to allocate memory if (OB_ISNULL(piece) || OB_ISNULL(piece->get_allocator())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("piece is null.", K(ret)); diff --git a/src/observer/mysql/obmp_stmt_send_piece_data.h b/src/observer/mysql/obmp_stmt_send_piece_data.h index 81df8bc25..fac6ce522 100644 --- a/src/observer/mysql/obmp_stmt_send_piece_data.h +++ b/src/observer/mysql/obmp_stmt_send_piece_data.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_MYSQL_OBMP_STMT_SEND_PIECE_DATA_H_ diff --git a/src/observer/mysql/obmp_utils.cpp b/src/observer/mysql/obmp_utils.cpp index 80fc3c513..d893d0fb6 100644 --- a/src/observer/mysql/obmp_utils.cpp +++ b/src/observer/mysql/obmp_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/mysql/obmp_utils.h b/src/observer/mysql/obmp_utils.h index 70af1a20f..85bc3069c 100644 --- a/src/observer/mysql/obmp_utils.h +++ b/src/observer/mysql/obmp_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OBMP_UTILS_H_ diff --git a/src/observer/mysql/obsm_conn_callback.cpp b/src/observer/mysql/obsm_conn_callback.cpp index b4b439b68..5a1639172 100644 --- a/src/observer/mysql/obsm_conn_callback.cpp +++ b/src/observer/mysql/obsm_conn_callback.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX RPC_OBMYSQL @@ -136,8 +140,7 @@ int ObSMConnectionCallback::init(ObSqlSockSession& sess, ObSMConnection& conn) sess.set_tls_version_option(tls_version_option); LOG_INFO("sm conn init succ", K(conn.sessid_), K(sess.client_addr_)); } - - //如果当前function发生错误,应该在当前function中进行mark_sessid_unused + //If the current function encounters an error, it should mark_sessid_unused within the current function if (OB_SUCCESS == ret && OB_SUCCESS == conn.ret_) { conn.is_need_clear_sessid_ = true; } diff --git a/src/observer/mysql/obsm_conn_callback.h b/src/observer/mysql/obsm_conn_callback.h index 4c3c05887..6c6fb968d 100644 --- a/src/observer/mysql/obsm_conn_callback.h +++ b/src/observer/mysql/obsm_conn_callback.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OBSM_CONN_CALLBACK_H_ diff --git a/src/observer/mysql/obsm_row.cpp b/src/observer/mysql/obsm_row.cpp index 1da93db94..7a2095cbf 100644 --- a/src/observer/mysql/obsm_row.cpp +++ b/src/observer/mysql/obsm_row.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "obsm_row.h" diff --git a/src/observer/mysql/obsm_row.h b/src/observer/mysql/obsm_row.h index 70d0f6024..b456eb1ed 100644 --- a/src/observer/mysql/obsm_row.h +++ b/src/observer/mysql/obsm_row.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_COMMON_OBSM_ROW_H_ diff --git a/src/observer/mysql/obsm_utils.cpp b/src/observer/mysql/obsm_utils.cpp index 376eb2ee9..928febbcc 100644 --- a/src/observer/mysql/obsm_utils.cpp +++ b/src/observer/mysql/obsm_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "obsm_utils.h" @@ -176,8 +180,8 @@ int ObSMUtils::cell_str( case ObRawTC: case ObTextTC: // TODO@hanhui texttc share the stringtc temporarily case ObStringTC: - // lob locator也会按varchar方式进行encode, 客户端往server端传输数据时, - // 也是将lob locator按varchar传输, 先编码LobLocator length, 然后再编码整个lob Locator + // lob locator will also be encoded in a varchar manner, client sends data to the server, + // Also transmit the lob locator as varchar, first encode the LobLocator length, then encode the entire lob Locator case ObLobTC: case ObRoaringBitmapTC: { ret = ObMySQLUtil::varchar_cell_str(buf, len, obj.get_string(), is_oracle_raw, pos); @@ -432,4 +436,4 @@ const char* ObSMUtils::get_extend_type_name(int type) case PL_OPAQUE_TYPE: return "OPAQUE"; default: return "UNKNOW"; } -} \ No newline at end of file +} diff --git a/src/observer/mysql/obsm_utils.h b/src/observer/mysql/obsm_utils.h index 2a5a33fc1..9663229ae 100644 --- a/src/observer/mysql/obsm_utils.h +++ b/src/observer/mysql/obsm_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OBSM_UTILS_H_ @@ -37,15 +41,15 @@ class ObField; class ObSMUtils { public: /** - * 序列化一个cell到buf + pos的位置。 + * Serialize a cell to the position of buf + pos. * - * @param [in] obj 需要序列化的cell - * @param [in] buf 输出的buf - * @param [in] len buf的大小 - * @param [in,out] pos 写入buf的位置 + * @param [in] obj The cell to be serialized + * @param [in] buf The output buffer + * @param [in] len The size of the buffer + * @param [in,out] pos The position in the buffer to write * @param [in] cell index for binary protocol * - * @return 成功返回OB_SUCCESS, 失败返回oceanbase error code + * @return Returns OB_SUCCESS on success, or an oceanbase error code on failure */ static int cell_str( char *buf, const int64_t len, diff --git a/src/observer/net/ob_ingress_bw_alloc_service.cpp b/src/observer/net/ob_ingress_bw_alloc_service.cpp index a1c2053ac..fd1ac012d 100644 --- a/src/observer/net/ob_ingress_bw_alloc_service.cpp +++ b/src/observer/net/ob_ingress_bw_alloc_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_ingress_bw_alloc_service.h" diff --git a/src/observer/net/ob_ingress_bw_alloc_service.h b/src/observer/net/ob_ingress_bw_alloc_service.h index 28684fa23..f276c83f0 100644 --- a/src/observer/net/ob_ingress_bw_alloc_service.h +++ b/src/observer/net/ob_ingress_bw_alloc_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ROOTSERVER_OB_INGRESS_BW_ALLOC_SERVICE_H diff --git a/src/observer/net/ob_net_endpoint_ingress_rpc_proccessor.cpp b/src/observer/net/ob_net_endpoint_ingress_rpc_proccessor.cpp index 1fbabca6e..f8ce3977d 100644 --- a/src/observer/net/ob_net_endpoint_ingress_rpc_proccessor.cpp +++ b/src/observer/net/ob_net_endpoint_ingress_rpc_proccessor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/net/ob_net_endpoint_ingress_rpc_processor.h" @@ -64,4 +68,4 @@ int ObNetEndpointSetIngressP::process() } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/net/ob_net_endpoint_ingress_rpc_processor.h b/src/observer/net/ob_net_endpoint_ingress_rpc_processor.h index 8c0fa307b..a9f703603 100644 --- a/src/observer/net/ob_net_endpoint_ingress_rpc_processor.h +++ b/src/observer/net/ob_net_endpoint_ingress_rpc_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ENDPOINT_INGRESS_RPC_PROCESSOR_H_ @@ -27,4 +31,4 @@ OB_DEFINE_PROCESSOR_S(Srv, OB_SET_INGRESS_BW, ObNetEndpointSetIngressP); } // namespace observer } // namespace oceanbase -#endif /* OCEANBASE_ENDPOINT_INGRESS_RPC_PROCESSOR_H_ */ \ No newline at end of file +#endif /* OCEANBASE_ENDPOINT_INGRESS_RPC_PROCESSOR_H_ */ diff --git a/src/observer/net/ob_net_endpoint_ingress_rpc_proxy.h b/src/observer/net/ob_net_endpoint_ingress_rpc_proxy.h index 93c34926d..8c349ce9b 100644 --- a/src/observer/net/ob_net_endpoint_ingress_rpc_proxy.h +++ b/src/observer/net/ob_net_endpoint_ingress_rpc_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ENDPOINT_INGRESS_RPC_PROXY_H_ @@ -38,4 +42,4 @@ class ObNetEndpointIngressRpcProxy : public obrpc::ObRpcProxy }; } // namespace obrpc } // namespace oceanbase -#endif /* OCEANBASE_ENDPOINT_INGRESS_RPC_PROXY_H_ */ \ No newline at end of file +#endif /* OCEANBASE_ENDPOINT_INGRESS_RPC_PROXY_H_ */ diff --git a/src/observer/net/ob_net_endpoint_ingress_rpc_struct.cpp b/src/observer/net/ob_net_endpoint_ingress_rpc_struct.cpp index bea253653..4f35ccbc7 100644 --- a/src/observer/net/ob_net_endpoint_ingress_rpc_struct.cpp +++ b/src/observer/net/ob_net_endpoint_ingress_rpc_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_net_endpoint_ingress_rpc_struct.h" @@ -53,4 +57,4 @@ int ObNetEndpointSetIngressArg::assign(const ObNetEndpointSetIngressArg &other) OB_SERIALIZE_MEMBER(ObNetEndpointSetIngressRes, res_); } // namespace obrpc -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/net/ob_net_endpoint_ingress_rpc_struct.h b/src/observer/net/ob_net_endpoint_ingress_rpc_struct.h index a62cd6031..71a0743cc 100644 --- a/src/observer/net/ob_net_endpoint_ingress_rpc_struct.h +++ b/src/observer/net/ob_net_endpoint_ingress_rpc_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ENDPOINT_INGRESS_RPC_STRUCT_H_ diff --git a/src/observer/net/ob_net_queue_traver.cpp b/src/observer/net/ob_net_queue_traver.cpp index 55ce6e0dc..252653fa9 100644 --- a/src/observer/net/ob_net_queue_traver.cpp +++ b/src/observer/net/ob_net_queue_traver.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_net_queue_traver.h" #define USING_LOG_PREFIX RS diff --git a/src/observer/net/ob_net_queue_traver.h b/src/observer/net/ob_net_queue_traver.h index 4eab0a61f..494c56211 100644 --- a/src/observer/net/ob_net_queue_traver.h +++ b/src/observer/net/ob_net_queue_traver.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_RPC_OB_NET_QUEUE_TRAVER_H #define OCEANBASE_RPC_OB_NET_QUEUE_TRAVER_H diff --git a/src/observer/net/ob_rpc_reverse_keepalive.cpp b/src/observer/net/ob_rpc_reverse_keepalive.cpp index 8a08f0342..4f6e636c9 100644 --- a/src/observer/net/ob_rpc_reverse_keepalive.cpp +++ b/src/observer/net/ob_rpc_reverse_keepalive.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/net/ob_rpc_reverse_keepalive.h" diff --git a/src/observer/net/ob_rpc_reverse_keepalive.h b/src/observer/net/ob_rpc_reverse_keepalive.h index f3f66d207..94a837821 100644 --- a/src/observer/net/ob_rpc_reverse_keepalive.h +++ b/src/observer/net/ob_rpc_reverse_keepalive.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_RPC_REVERSE_KEEPALIVE_H diff --git a/src/observer/net/ob_shared_storage_net_throt_rpc_proccessor.cpp b/src/observer/net/ob_shared_storage_net_throt_rpc_proccessor.cpp index c3062c3e1..95223e6af 100644 --- a/src/observer/net/ob_shared_storage_net_throt_rpc_proccessor.cpp +++ b/src/observer/net/ob_shared_storage_net_throt_rpc_proccessor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/net/ob_shared_storage_net_throt_rpc_processor.h" @@ -61,4 +65,4 @@ int ObSharedStorageNetThrotSetP::process() } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/net/ob_shared_storage_net_throt_rpc_processor.h b/src/observer/net/ob_shared_storage_net_throt_rpc_processor.h index cae79003c..24e59c7fd 100644 --- a/src/observer/net/ob_shared_storage_net_throt_rpc_processor.h +++ b/src/observer/net/ob_shared_storage_net_throt_rpc_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SHARED_STORAGE_NET_THROT_RPC_PROCESSOR_H_ @@ -26,4 +30,4 @@ OB_DEFINE_PROCESSOR_S(Srv, OB_SHARED_STORAGE_NET_THROT_SET, ObSharedStorageNetTh } // namespace observer } // namespace oceanbase -#endif /* OCEANBASE_SHARED_STORAGE_NET_THROT_RPC_PROCESSOR_H_ */ \ No newline at end of file +#endif /* OCEANBASE_SHARED_STORAGE_NET_THROT_RPC_PROCESSOR_H_ */ diff --git a/src/observer/net/ob_shared_storage_net_throt_rpc_proxy.h b/src/observer/net/ob_shared_storage_net_throt_rpc_proxy.h index a17eceb29..302f279a5 100644 --- a/src/observer/net/ob_shared_storage_net_throt_rpc_proxy.h +++ b/src/observer/net/ob_shared_storage_net_throt_rpc_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_STORAGE_NET_THROT_RPC_PROXY_H_ @@ -36,4 +40,4 @@ class ObSSNTRpcProxy : public obrpc::ObRpcProxy }; } // namespace obrpc } // namespace oceanbase -#endif /* OCEANBASE_STORAGE_NET_THROT_RPC_PROXY_H_ */ \ No newline at end of file +#endif /* OCEANBASE_STORAGE_NET_THROT_RPC_PROXY_H_ */ diff --git a/src/observer/net/ob_shared_storage_net_throt_rpc_struct.cpp b/src/observer/net/ob_shared_storage_net_throt_rpc_struct.cpp index 42d0c9fcc..0e7bc7339 100644 --- a/src/observer/net/ob_shared_storage_net_throt_rpc_struct.cpp +++ b/src/observer/net/ob_shared_storage_net_throt_rpc_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/net/ob_shared_storage_net_throt_rpc_struct.h" @@ -29,4 +33,4 @@ OB_SERIALIZE_MEMBER(ObSSNTResource, ops_, ips_, iops_, obw_, ibw_, iobw_, tag_); OB_SERIALIZE_MEMBER(ObSSNTEndpointArg, addr_, storage_keys_, expire_time_); OB_SERIALIZE_MEMBER(ObSSNTSetRes, res_); } // namespace obrpc -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/net/ob_shared_storage_net_throt_rpc_struct.h b/src/observer/net/ob_shared_storage_net_throt_rpc_struct.h index ffcfdc08d..7fb650958 100644 --- a/src/observer/net/ob_shared_storage_net_throt_rpc_struct.h +++ b/src/observer/net/ob_shared_storage_net_throt_rpc_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SHARED_STORAGE_NET_THROT_RPC_STRUCT_H_ diff --git a/src/observer/net/ob_shared_storage_net_throt_service.cpp b/src/observer/net/ob_shared_storage_net_throt_service.cpp index c80a4641b..516fd894d 100644 --- a/src/observer/net/ob_shared_storage_net_throt_service.cpp +++ b/src/observer/net/ob_shared_storage_net_throt_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_shared_storage_net_throt_service.h" diff --git a/src/observer/net/ob_shared_storage_net_throt_service.h b/src/observer/net/ob_shared_storage_net_throt_service.h index 24e3ffbfd..b1d095341 100644 --- a/src/observer/net/ob_shared_storage_net_throt_service.h +++ b/src/observer/net/ob_shared_storage_net_throt_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_ROOTSERVER_SHARED_STORAGE_NET_THROT_SERVICE_H diff --git a/src/observer/ob_check_params.cpp b/src/observer/ob_check_params.cpp index c777c3703..56130c022 100644 --- a/src/observer/ob_check_params.cpp +++ b/src/observer/ob_check_params.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_check_params.h b/src/observer/ob_check_params.h index d32386a61..0ef4b03e2 100644 --- a/src/observer/ob_check_params.h +++ b/src/observer/ob_check_params.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_CHECK_PARAMS_ diff --git a/src/observer/ob_command_line_parser.cpp b/src/observer/ob_command_line_parser.cpp new file mode 100644 index 000000000..5d52a5ca7 --- /dev/null +++ b/src/observer/ob_command_line_parser.cpp @@ -0,0 +1,363 @@ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ + +#include "observer/ob_command_line_parser.h" + +#include +#include +#include +#include + +#include "lib/oblog/ob_log.h" +#include "lib/utility/ob_print_utils.h" +#include "lib/string/ob_sql_string.h" +#include "lib/file/file_directory_utils.h" +#include "share/ob_version.h" + +#define MPRINT(format, ...) fprintf(stderr, format "\n", ##__VA_ARGS__) + +namespace oceanbase { +namespace observer { + +const char *COPYRIGHT = "Copyright (c) 2011-present OceanBase Inc."; + +/** + * 命令行选项枚举 + * 从1000开始是为了避免与getopt_long的短选项字符冲突 + * 短选项使用ASCII字符值(如'P'=80, 'V'=86, 'h'=104, '6'=54) + * 长选项使用1000以上的数值来区分 + */ +enum ObCommandOption { + COMMAND_OPTION_INITIALIZE = 1000, + COMMAND_OPTION_VARIABLE, + COMMAND_OPTION_NODAEMON, + COMMAND_OPTION_DEVNAME, + COMMAND_OPTION_BASE_DIR, + COMMAND_OPTION_DATA_DIR, + COMMAND_OPTION_REDO_DIR, + COMMAND_OPTION_LOG_LEVEL, + COMMAND_OPTION_PARAMETER, +}; + +// 定义长选项 +static struct option long_options[] = { + {"initialize", no_argument, 0, COMMAND_OPTION_INITIALIZE}, + {"variable", required_argument, 0, COMMAND_OPTION_VARIABLE}, + {"port", required_argument, 0, 'P'}, + {"nodaemon", no_argument, 0, COMMAND_OPTION_NODAEMON}, + {"use-ipv6", no_argument, 0, '6'}, + {"devname", required_argument, 0, COMMAND_OPTION_DEVNAME}, + {"base-dir", required_argument, 0, COMMAND_OPTION_BASE_DIR}, + {"data-dir", required_argument, 0, COMMAND_OPTION_DATA_DIR}, + {"redo-dir", required_argument, 0, COMMAND_OPTION_REDO_DIR}, + {"log-level", required_argument, 0, COMMAND_OPTION_LOG_LEVEL}, + {"parameter", required_argument, 0, COMMAND_OPTION_PARAMETER}, + {"version", no_argument, 0, 'V'}, + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} +}; + +// 定义短选项字符串 +static const char* short_options = "P:Vh6"; + + +/** + * 将字符串按照 '=' 分割成 key 和 value + */ +static int split_key_value(const ObString &str, ObString &key, ObString &value) +{ + int ret = OB_SUCCESS; + value = str; + key = value.split_on('='); + if (key.empty()) { + ret = OB_INVALID_ARGUMENT; + MPRINT("Invalid variable. Variable should be in the format of key=value, but got: '%.*s'", str.length(), str.ptr()); + } + return ret; +} + +static int append_key_value(const char *value, ObServerOptions::KeyValueArray &array) +{ + int ret = OB_SUCCESS; + if (nullptr == value) { + ret = OB_INVALID_ARGUMENT; + MPRINT("Invalid argument, the value should not be empty"); + } else { + ObString value_str(value); + ObString tmp_key, tmp_value; + tmp_value = value_str; + tmp_key = tmp_value.split_on('='); + if (OB_FAIL(split_key_value(value_str, tmp_key, tmp_value))) { + MPRINT("[Maybe Memory Error] split_key_value failed, ret=%d", ret); + } else if (tmp_key.empty()) { + ret = OB_INVALID_ARGUMENT; + MPRINT("[Maybe Memory Error] Invalid argument, should be in the format of key=value, but got '%s'", value); + } else if (OB_FAIL(array.push_back(std::make_pair(tmp_key, tmp_value)))) { + MPRINT("[Maybe Memory Error] push_back to parameters_ failed, ret=%d", ret); + } + } + return ret; +} + +/** + * 将相对路径转换为绝对路径 + * @note 需要确保路径存在 + */ +static int to_absolute_path(ObSqlString &dir) +{ + int ret = OB_SUCCESS; + if (!dir.empty() && dir.ptr()[0] != '\0' && dir.ptr()[0] != '/') { + char real_path[OB_MAX_FILE_NAME_LENGTH] = {0}; + if (NULL == realpath(dir.ptr(), real_path)) { + MPRINT("Failed to get absolute path for %.*s, system error=%s", dir.length(), dir.ptr(), strerror(errno)); + ret = OB_ERR_UNEXPECTED; + } else if (OB_FAIL(dir.assign(real_path))) { + MPRINT("[Maybe Memory Error] Failed to assign absolute path. Please try again."); + } + } + return ret; +} + +int ObCommandLineParser::handle_option(int option, const char* value, ObServerOptions& opts) +{ + int ret = OB_SUCCESS; + + switch (option) { + case COMMAND_OPTION_INITIALIZE: { // initialize + opts.initialize_ = true; + break; + } + case COMMAND_OPTION_VARIABLE: { // variable + ret = append_key_value(value, opts.variables_); + break; + } + case 'P': { // port + if (nullptr == value) { + ret = OB_INVALID_ARGUMENT; + MPRINT("Invalid argument, the value should not be empty of 'port'"); + } else { + // Instead of plain atoi, parse int with complete validation to ensure there are no trailing junk. + char *endptr = nullptr; + long port = strtol(value, &endptr, 10); + // check for conversion errors or trailing non-digit characters + if (nullptr == value || *value == '\0' || endptr == nullptr || *endptr != '\0') { + ret = OB_INVALID_ARGUMENT; + MPRINT("Invalid argument for port: '%s', the value must be an integer within [1, 65535]", value ? value : "(null)"); + } + if (port <= 0 || port > 65535) { + ret = OB_INVALID_ARGUMENT; + MPRINT("Invalid argument, port value out of range [1, 65535], but got %s", value); + } else { + opts.port_ = port; + } + } + break; + } + case COMMAND_OPTION_NODAEMON: { // nodaemon + opts.nodaemon_ = true; + break; + } + case '6': { // use-ipv6 + opts.use_ipv6_ = true; + break; + } + case COMMAND_OPTION_DEVNAME: { // devname + opts.devname_ = value; + break; + } + case COMMAND_OPTION_BASE_DIR: { // base-dir + opts.base_dir_.assign(value); + break; + } + case COMMAND_OPTION_DATA_DIR: { // data-dir + opts.data_dir_.assign(value); + break; + } + case COMMAND_OPTION_REDO_DIR: { // redo-dir + opts.redo_dir_.assign(value); + break; + } + case COMMAND_OPTION_LOG_LEVEL: { // log-level + if (nullptr == value) { + ret = OB_INVALID_ARGUMENT; + MPRINT("Invalid argument, the value should not be empty"); + } else { + if (OB_FAIL(OB_LOGGER.level_str2int(value, opts.log_level_))) { + MPRINT("malformed log level, candicates are: " + " ERROR,USER_ERR,WARN,INFO,TRACE,DEBUG"); + MPRINT("!! Back to INFO log level."); + ret = OB_SUCCESS; + opts.log_level_ = OB_LOG_LEVEL_WARN; + } + } + break; + } + case COMMAND_OPTION_PARAMETER: { // parameter + ret = append_key_value(value, opts.parameters_); + break; + } + case 'V': { // version + version_requested_ = true; + break; + } + case 'h': { // help + help_requested_ = true; + break; + } + default: { + ret = OB_INVALID_ARGUMENT; + MPRINT("Unknown option: %c", option); + break; + } + } + + return ret; +} + +int ObCommandLineParser::parse_args(int argc, char* argv[], ObServerOptions& opts) +{ + int ret = OB_SUCCESS; + + // 重置选项状态 + help_requested_ = false; + version_requested_ = false; + + int option_index = 0; + int c; + + // 使用getopt_long解析参数 + while (OB_SUCC(ret) && (c = getopt_long(argc, argv, short_options, long_options, &option_index)) != -1) { + ret = handle_option(c, optarg, opts); + } + + // 检查是否有非选项参数 + // optind是getopt_long处理完选项参数后,argv中下一个未处理参数的索引 + if (OB_SUCC(ret) && optind < argc) { + ret = OB_INVALID_ARGUMENT; + MPRINT("Invalid argument, unexpected non-option parameter: %s", argv[optind]); + print_help(); + exit(1); + } + + // 处理帮助和版本请求 + if (OB_FAIL(ret)) { + } else if (help_requested_) { + print_help(); + exit(0); + } else if (version_requested_) { + print_version(); + exit(0); + } + + // 设置默认值 + if (OB_FAIL(ret)) { + } else if (opts.base_dir_.empty() && OB_FAIL(opts.base_dir_.assign("."))) { + } else if (!opts.initialize_ && !opts.variables_.empty()) { + opts.variables_.reset(); + MPRINT("Variable is only available in initialize mode, reset it."); + } + + // 设置nodaemon逻辑:初始化模式下,默认不以daemon方式运行 + if (OB_FAIL(ret)) { + } else if (opts.initialize_ && !opts.nodaemon_) { + opts.nodaemon_ = true; + MPRINT("Initialize mode, execute not as a daemon."); + } + + // 初始化时,如果没有指定data_dir和redo_dir,需要设置默认值 + if (OB_FAIL(ret) || !opts.initialize_) { + } else if (opts.data_dir_.empty() && + OB_FAIL(opts.data_dir_.append_fmt("%s/store", opts.base_dir_.ptr()))) { + MPRINT("[Maybe Memory Error] Failed to assign data dir. Please try again."); + } else if (opts.redo_dir_.empty() && + OB_FAIL(opts.redo_dir_.append_fmt("%s/redo", opts.data_dir_.ptr()))) { + MPRINT("[Maybe Memory Error] Failed to assign redo dir. Please try again."); + } + + // 创建base-dir, data-dir, redo-dir + if (OB_FAIL(ret)) { + } else if (OB_FAIL(FileDirectoryUtils::create_full_path(opts.base_dir_.ptr()))) { + MPRINT("Failed to create base-dir: %s. error: %s", opts.base_dir_.ptr(), strerror(errno)); + } else if (!opts.data_dir_.empty() && OB_FAIL(FileDirectoryUtils::create_full_path(opts.data_dir_.ptr()))) { + MPRINT("Failed to create data-dir: %s. error: %s", opts.data_dir_.ptr(), strerror(errno)); + } else if (!opts.redo_dir_.empty() && OB_FAIL(FileDirectoryUtils::create_full_path(opts.redo_dir_.ptr()))) { + MPRINT("Failed to create redo-dir: %s. error: %s", opts.redo_dir_.ptr(), strerror(errno)); + } + + // 如果data_dir_和redo_dir_不是空并且不是绝对路径,需要切换成绝对路径 + if (OB_FAIL(ret)) { + } else if (OB_FAIL(to_absolute_path(opts.base_dir_))) { + } else if (OB_FAIL(to_absolute_path(opts.data_dir_))) { + // error already printed + } else if (OB_FAIL(to_absolute_path(opts.redo_dir_))) { + // error already printed + } else { + MPRINT("Starting OceanBase with:"); + MPRINT(" base-dir=%s", opts.base_dir_.ptr()); + if (!opts.data_dir_.empty()) { + MPRINT(" data-dir=%s", opts.data_dir_.ptr()); + } + if (!opts.redo_dir_.empty()) { + MPRINT(" redo-dir=%s", opts.redo_dir_.ptr()); + } + } + + return ret; +} + +void ObCommandLineParser::print_help() const +{ + MPRINT("%s", COPYRIGHT); + MPRINT(); + MPRINT("Usage: observer [OPTIONS]\n"); + MPRINT("Options:"); + MPRINT(" --initialize whether to perform initialization"); + MPRINT(" --variable system variables, format: key=value. Note: Only available in initialize mode. Can be specified multiple times."); + MPRINT(" --port, -P the port, default is 2881"); + MPRINT(" --nodaemon whether to not run as a daemon"); + MPRINT(" --use-ipv6, -6 whether to use ipv6"); + MPRINT(" --devname The name of network adapter"); + MPRINT(" --base-dir The base directory which oceanbase process will run in. (default: current directory)"); + MPRINT(" --data-dir The data directory which oceanbase will store data in. Default is ${base-dir}/store in initialize mode."); + MPRINT(" --redo-dir The redo log directory which oceanbase will store redo log in. Default is ${data-dir}/redo in initialize mode."); + MPRINT(" --log-level The server log level"); + MPRINT(" --parameter system parameters, format: key=value. Can be specified multiple times."); + MPRINT(" --version, -V show version message and exit"); + MPRINT(" --help, -h show this message and exit"); + MPRINT(); +} + +void ObCommandLineParser::print_version() +{ + // 这里应该调用原有的print_version函数 + // 为了简化,我们直接输出版本信息 +#ifndef ENABLE_SANITY + const char *extra_flags = ""; +#else + const char *extra_flags = "|Sanity"; +#endif + MPRINT("observer (%s %s)\n", "OceanBase_Lite", PACKAGE_VERSION); + MPRINT("REVISION: %s", build_version()); + MPRINT("BUILD_BRANCH: %s", build_branch()); + MPRINT("BUILD_TIME: %s %s", build_date(), build_time()); + MPRINT("BUILD_FLAGS: %s%s", build_flags(), extra_flags); + MPRINT("BUILD_INFO: %s\n", build_info()); + MPRINT("%s", COPYRIGHT); + MPRINT(); +} + +} // namespace observer +} // namespace oceanbase diff --git a/src/observer/ob_command_line_parser.h b/src/observer/ob_command_line_parser.h new file mode 100644 index 000000000..fa5337da3 --- /dev/null +++ b/src/observer/ob_command_line_parser.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ + +#ifndef OCEANBASE_OBSERVER_OB_COMMAND_LINE_PARSER_H_ +#define OCEANBASE_OBSERVER_OB_COMMAND_LINE_PARSER_H_ + +#include "observer/ob_server_options.h" + +namespace oceanbase { +namespace observer { + +/** + * 使用C标准库getopt_long实现的命令行参数解析器 + * 符合OceanBase编码规范 + */ +class ObCommandLineParser final { +public: + ObCommandLineParser() = default; + ~ObCommandLineParser() = default; + + /** + * 解析命令行参数并直接设置到ObServerOptions中 + * @param argc 参数个数 + * @param argv 参数数组 + * @param opts 服务器选项,解析结果会直接设置到这里 + * @return 解析结果,OB_SUCCESS表示成功 + */ + int parse_args(int argc, char* argv[], ObServerOptions& opts); + + /** + * 打印帮助信息 + */ + void print_help() const; + + /** + * 打印版本信息 + */ + static void print_version(); + + +private: + // 处理选项值 + int handle_option(int option, const char* value, ObServerOptions& opts); + // 设置字符串到ObString + int set_ob_string(ObIAllocator& allocator, const char* value, ObString& target); + +private: + // 解析结果状态 + bool help_requested_ = false; + bool version_requested_ = false; +}; + +} // namespace observer +} // namespace oceanbase + +#endif // OCEANBASE_OBSERVER_OB_COMMAND_LINE_PARSER_H_ diff --git a/src/observer/ob_dump_task_generator.cpp b/src/observer/ob_dump_task_generator.cpp index e887e3374..dc1ef75a1 100644 --- a/src/observer/ob_dump_task_generator.cpp +++ b/src/observer/ob_dump_task_generator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_dump_task_generator.h b/src/observer/ob_dump_task_generator.h index 9a02bfa41..f5f952ff6 100644 --- a/src/observer/ob_dump_task_generator.h +++ b/src/observer/ob_dump_task_generator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_DUMP_TASK_GEN_ @@ -22,7 +26,7 @@ namespace observer class ObDumpTaskGenerator { /* - 1. etc/dump.config文件写入相应指令 + 1. Write the corresponding instructions to the etc/dump.config file dump entity all dump entity p_entity='0xffffffffff',slot_idx=1000 dump chunk all @@ -32,7 +36,7 @@ class ObDumpTaskGenerator set option leak_rate = xxx dump memory leak 2. kill -62 pid - 3. 结果见log/memory_meta文件 + 3. See the results in log/memory_meta file */ enum TaskType { diff --git a/src/observer/ob_heartbeat.cpp b/src/observer/ob_heartbeat.cpp index 75294d9a4..1233dec86 100644 --- a/src/observer/ob_heartbeat.cpp +++ b/src/observer/ob_heartbeat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -103,7 +107,6 @@ int ObHeartBeatProcess::init_lease_request(ObLeaseRequest &lease_request) lease_request.zone_ = gctx_.config_->zone.str(); lease_request.server_ = gctx_.self_addr(); lease_request.sql_port_ = gctx_.config_->mysql_port; - OTC_MGR.get_lease_request(lease_request); lease_request.start_service_time_ = gctx_.start_service_time_; lease_request.ssl_key_expired_time_ = gctx_.ssl_key_expired_time_; #ifdef ERRSIM @@ -243,10 +246,6 @@ int ObHeartBeatProcess::do_heartbeat_event(const ObLeaseResponse &lease_response } else if (OB_FAIL(TG_SCHEDULE(lib::TGDefIDs::ObHeartbeat, update_task_, delay, repeat))) { LOG_WARN("schedule update zone lease info task failed", K(delay), K(repeat), KR(ret)); } - // generate the task for refreshing the Tenant-level configuration - if (OB_SUCCESS != (tmp_ret = OTC_MGR.got_versions(lease_response.tenant_config_version_))) { - LOG_WARN("tenant got versions failed", K(tmp_ret)); - } } return ret; } @@ -274,39 +273,6 @@ int ObHeartBeatProcess::update_lease_info() return ret; } -int ObHeartBeatProcess::try_update_infos() -{ - int ret = OB_SUCCESS; - const int64_t config_version = zone_lease_info_.config_version_; - - if (!inited_) { - ret = OB_NOT_INIT; - LOG_WARN("not init", KR(ret)); - } else if (OB_FAIL(try_reload_config(config_version))) { - LOG_WARN("try_reload_config failed", KR(ret), K(config_version)); - } - - return ret; -} - -int ObHeartBeatProcess::try_reload_config(const int64_t config_version) -{ - int ret = OB_SUCCESS; - if (!inited_) { - ret = OB_NOT_INIT; - LOG_WARN("not init", KR(ret)); - } else if (config_version < 0) { - ret = OB_INVALID_ARGUMENT; - LOG_WARN("invalid config_version", K(config_version), KR(ret)); - } else { - ObConfigManager &config_mgr = *gctx_.config_mgr_; - if (OB_FAIL(config_mgr.got_version(config_version, true))) { - LOG_WARN("got_version failed", K(config_version), KR(ret)); - } - } - return ret; -} - ObHeartBeatProcess::ObZoneLeaseInfoUpdateTask::ObZoneLeaseInfoUpdateTask( ObHeartBeatProcess &hb_process) : hb_process_(hb_process) @@ -322,13 +288,6 @@ void ObHeartBeatProcess::ObZoneLeaseInfoUpdateTask::runTimerTask() int ret = OB_SUCCESS; if (OB_FAIL(hb_process_.update_lease_info())) { LOG_WARN("update_lease_info failed", KR(ret)); - } else { - // while rootservice startup, lease_info_version may be set to 0. - if (OB_LIKELY(hb_process_.zone_lease_info_.lease_info_version_ > 0)) { - if (OB_FAIL(hb_process_.try_update_infos())) { - LOG_WARN("try_update_infos failed", KR(ret)); - } - } } } diff --git a/src/observer/ob_heartbeat.h b/src/observer/ob_heartbeat.h index 4d3aa6710..fe461cb83 100644 --- a/src/observer/ob_heartbeat.h +++ b/src/observer/ob_heartbeat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_HEARTBEAT_H_ @@ -42,7 +46,6 @@ class ObHeartBeatProcess: public observer::IHeartBeatProcess virtual int do_heartbeat_event(const share::ObLeaseResponse &lease_response); int update_lease_info(); - int try_update_infos(); private: class ObZoneLeaseInfoUpdateTask : public common::ObTimerTask { @@ -68,7 +71,6 @@ class ObHeartBeatProcess: public observer::IHeartBeatProcess bool is_need_retry_; }; - int try_reload_config(const int64_t config_version); int try_reload_time_zone_info(const int64_t time_zone_info_version); private: void check_and_update_server_id_(const uint64_t server_id); diff --git a/src/observer/ob_inner_sql_connection.cpp b/src/observer/ob_inner_sql_connection.cpp index de5210699..02a47ac73 100644 --- a/src/observer/ob_inner_sql_connection.cpp +++ b/src/observer/ob_inner_sql_connection.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -652,8 +656,7 @@ int ObInnerSQLConnection::process_record(sql::ObResultSet &result_set, ? EXECUTE_PS_EXECUTE : (is_from_pl ? EXECUTE_PL_EXECUTE : EXECUTE_INNER), session, sql_ctx.is_sensitive_); - - // 临时allocator 申请的内存,需要在这里 置 NULL + // memory allocated by temporary allocator needs to be set to NULL here { audit_record.params_value_ = NULL; audit_record.params_value_len_ = 0; @@ -711,7 +714,7 @@ int ObInnerSQLConnection::process_audit_record(sql::ObResultSet &result_set, audit_record.is_executor_rpc_ = false; audit_record.is_inner_sql_ = !is_from_pl; audit_record.is_hit_plan_cache_ = result_set.get_is_from_plan_cache(); - audit_record.is_multi_stmt_ = false; //是否是multi sql + audit_record.is_multi_stmt_ = false; // whether it is multi sql audit_record.is_perf_event_closed_ = !lib::is_diagnose_info_enabled(); ObIArray *table_row_count_list = NULL; @@ -768,7 +771,7 @@ int ObInnerSQLConnection::do_query(sqlclient::ObIExecutor &executor, ObInnerSQLR WITH_CONTEXT(res.mem_context_) { // are there no restrictions on internal SQL such as refresh schema? // MEM_TRACKER_GUARD(CURRENT_CONTEXT); - // restore有自己的inner_sql_connection,sql_modifier不为null + // restore has its own inner_sql_connection, sql_modifier is not null bool is_restore = NULL != sql_modifier_; res.sql_ctx().is_restore_ = is_restore; get_session().set_process_query_time(ObTimeUtility::current_time()); @@ -815,7 +818,7 @@ int ObInnerSQLConnection::query(sqlclient::ObIExecutor &executor, exec_timestamp.exec_type_ = sql::InnerSql; const ObGlobalContext &gctx = ObServer::get_instance().get_gctx(); int64_t start_time = ObTimeUtility::current_time(); - get_session().set_query_start_time(start_time); //FIXME 暂时写成这样 + get_session().set_query_start_time(start_time); //FIXME temporarily written like this get_session().set_trans_type(transaction::ObTxClass::SYS); int64_t abs_timeout_us = 0; int64_t execution_id = 0; @@ -940,11 +943,11 @@ int ObInnerSQLConnection::query(sqlclient::ObIExecutor &executor, LOG_INFO("[OK] inner sql execute success after retry!", K(retry_cnt), K(total_time_cost_us)); } get_session().set_session_in_retry(need_retry, ret_code); - //监控项统计开始 + //Monitoring item statistics start execute_start_timestamp_ = (res.get_execute_start_ts() > 0) ? res.get_execute_start_ts() : ObTimeUtility::current_time(); - //监控项统计结束 + //Monitoring item statistics end execute_end_timestamp_ = (res.get_execute_end_ts() > 0) ? res.get_execute_end_ts() : ObTimeUtility::current_time(); @@ -2153,12 +2156,12 @@ int ObInnerSQLConnection::get_session_variable(const ObString &name, int64_t &va ret = OB_NOT_INIT; LOG_WARN("not init", K(ret)); } else if (0 == name.case_compare("tx_isolation")) { - // 隔离级别是一个varchar值 + // Isolation level is a varchar value ObObj obj; if (OB_FAIL(get_session().get_sys_variable_by_name(name, obj))) { LOG_WARN("get tx_isolation system variable value fail", K(ret), K(name)); } else { - // varchar转换为int + // varchar conversion to int val = transaction::ObTransIsolation::get_level(obj.get_string()); } } else { @@ -2179,7 +2182,7 @@ int ObInnerSQLConnection::set_session_variable(const ObString &name, int64_t val } (void)get_session().set_check_sys_variable(0 != val); } else if (0 == name.case_compare("tx_isolation")) { - // 隔离级别是一个string + // Isolation level is a string ObObj obj; obj.set_varchar(transaction::ObTransIsolation::get_name(val)); obj.set_collation_type(ObCharset::get_system_collation()); diff --git a/src/observer/ob_inner_sql_connection.h b/src/observer/ob_inner_sql_connection.h index b1686dc69..d15a74b17 100644 --- a/src/observer/ob_inner_sql_connection.h +++ b/src/observer/ob_inner_sql_connection.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_INNER_SQL_CONNECTION_H_ diff --git a/src/observer/ob_inner_sql_connection_pool.cpp b/src/observer/ob_inner_sql_connection_pool.cpp index ffc14d5c4..ad5051b98 100644 --- a/src/observer/ob_inner_sql_connection_pool.cpp +++ b/src/observer/ob_inner_sql_connection_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_inner_sql_connection_pool.h b/src/observer/ob_inner_sql_connection_pool.h index 76f8ba195..19cc306e8 100644 --- a/src/observer/ob_inner_sql_connection_pool.h +++ b/src/observer/ob_inner_sql_connection_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_INNER_SQL_CONNECTION_POOL_H_ diff --git a/src/observer/ob_inner_sql_read_context.cpp b/src/observer/ob_inner_sql_read_context.cpp index 4d5169cbe..25c198040 100644 --- a/src/observer/ob_inner_sql_read_context.cpp +++ b/src/observer/ob_inner_sql_read_context.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_inner_sql_read_context.h" diff --git a/src/observer/ob_inner_sql_read_context.h b/src/observer/ob_inner_sql_read_context.h index ddbf2fd58..11ed4f25e 100644 --- a/src/observer/ob_inner_sql_read_context.h +++ b/src/observer/ob_inner_sql_read_context.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_INNER_SQL_READ_CONTEXT_H_ diff --git a/src/observer/ob_inner_sql_result.cpp b/src/observer/ob_inner_sql_result.cpp index 213e3ea4b..58fa55088 100644 --- a/src/observer/ob_inner_sql_result.cpp +++ b/src/observer/ob_inner_sql_result.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_inner_sql_result.h b/src/observer/ob_inner_sql_result.h index c22199ce8..11cdffa36 100644 --- a/src/observer/ob_inner_sql_result.h +++ b/src/observer/ob_inner_sql_result.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_INNER_SQL_RESULT_H_ diff --git a/src/observer/ob_inner_sql_rpc_processor.cpp b/src/observer/ob_inner_sql_rpc_processor.cpp index 98367efd0..d6df08e9f 100644 --- a/src/observer/ob_inner_sql_rpc_processor.cpp +++ b/src/observer/ob_inner_sql_rpc_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_inner_sql_rpc_processor.h b/src/observer/ob_inner_sql_rpc_processor.h index 9327087e6..a32fc3646 100644 --- a/src/observer/ob_inner_sql_rpc_processor.h +++ b/src/observer/ob_inner_sql_rpc_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OBDEV_SRC_OBSERVER_INNER_SQL_RPC_PROCESSOR_H_ diff --git a/src/observer/ob_inner_sql_rpc_proxy.cpp b/src/observer/ob_inner_sql_rpc_proxy.cpp index 3cb3c2865..a8605d6db 100644 --- a/src/observer/ob_inner_sql_rpc_proxy.cpp +++ b/src/observer/ob_inner_sql_rpc_proxy.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/ob_inner_sql_rpc_proxy.h" diff --git a/src/observer/ob_inner_sql_rpc_proxy.h b/src/observer/ob_inner_sql_rpc_proxy.h index ad0723fb1..dd1ed5fab 100644 --- a/src/observer/ob_inner_sql_rpc_proxy.h +++ b/src/observer/ob_inner_sql_rpc_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OBDEV_SRC_OBSERVER_INNER_SQL_RPC_PROXY_H_ diff --git a/src/observer/ob_lease_state_mgr.cpp b/src/observer/ob_lease_state_mgr.cpp index e0ee04d74..55935d384 100644 --- a/src/observer/ob_lease_state_mgr.cpp +++ b/src/observer/ob_lease_state_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_lease_state_mgr.h b/src/observer/ob_lease_state_mgr.h index 06070414d..abb08e311 100644 --- a/src/observer/ob_lease_state_mgr.h +++ b/src/observer/ob_lease_state_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_LEASE_STATE_MGR_H_ diff --git a/src/observer/ob_req_time_service.cpp b/src/observer/ob_req_time_service.cpp index 4ea628604..d5faa92ea 100644 --- a/src/observer/ob_req_time_service.cpp +++ b/src/observer/ob_req_time_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_req_time_service.h" diff --git a/src/observer/ob_req_time_service.h b/src/observer/ob_req_time_service.h index abe1e2960..2b7605e4b 100644 --- a/src/observer/ob_req_time_service.h +++ b/src/observer/ob_req_time_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_REQ_TIME_SERVICE_H_ @@ -39,8 +43,8 @@ struct ObReqTimeInfo: public common::ObDLinkBase void update_start_time() { if (0 == reentrant_cnt_) { - // currrent_monotonic_time只保证时间不会退 - // 并不能保证时间一定递增,所以这里检测逻辑用start_time_ > end_time_ + // currrent_monotonic_time only guarantees that time will not go backwards + // Cannot guarantee that time is always increasing, so the detection logic here uses start_time_ > end_time_ if (OB_UNLIKELY(start_time_ > end_time_)) { SERVER_LOG_RET(ERROR, OB_INVALID_ARGUMENT, "invalid start and end time", K(start_time_), K(end_time_), K(this)); @@ -54,7 +58,7 @@ struct ObReqTimeInfo: public common::ObDLinkBase { --reentrant_cnt_; if (0 == reentrant_cnt_) { - // 原因同上 + // Reason same as above if (OB_UNLIKELY(start_time_ < end_time_)) { SERVER_LOG_RET(ERROR, OB_INVALID_ARGUMENT, "invalid start and end time", K(start_time_), K(end_time_), K(this)); @@ -113,11 +117,10 @@ class ObGlobalReqTimeService } else { int64_t cur_start_time = cur->start_time_; int64_t cur_end_time = cur->end_time_; - - // start_time == end_time 线程可能在执行、也可能已经结束,这种情况取start_time作为安全时间 - // start_time > end_time 线程已经在执行,取start_time作为安全时间 - // start_ime == end_time == 0, 线程都没有执行过,这时候取current_time作为安全时间 - // start_time < end_time,线程已经结束,取current_time作为安全时间 + // start_time == end_time the thread may be executing or may have already ended, in this case, use start_time as the safe time + // start_time > end_time thread is already running, take start_time as the safe time + // start_time == end_time == 0, threads have never been executed, at this time take current_time as the safe time + // start_time < end_time, the thread has already ended, take current_time as the safe time int64_t cur_safe_time = (cur_end_time > cur_start_time || (cur_end_time == cur_start_time && 0 == cur_start_time)) diff --git a/src/observer/ob_resource_inner_sql_connection_pool.cpp b/src/observer/ob_resource_inner_sql_connection_pool.cpp index f0aeb5259..b7ce4bc00 100644 --- a/src/observer/ob_resource_inner_sql_connection_pool.cpp +++ b/src/observer/ob_resource_inner_sql_connection_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_resource_inner_sql_connection_pool.h b/src/observer/ob_resource_inner_sql_connection_pool.h index 1585d17a5..c8e325067 100644 --- a/src/observer/ob_resource_inner_sql_connection_pool.h +++ b/src/observer/ob_resource_inner_sql_connection_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_RESOURCE_INNER_SQL_CONNECTION_POOL_H_ diff --git a/src/observer/ob_restore_ctx.h b/src/observer/ob_restore_ctx.h index f2c3ad3df..b41cc163a 100644 --- a/src/observer/ob_restore_ctx.h +++ b/src/observer/ob_restore_ctx.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_RESTORE_CTX_H_ diff --git a/src/observer/ob_restore_sql_modifier.h b/src/observer/ob_restore_sql_modifier.h index 97aba215d..58a6fd5f8 100644 --- a/src/observer/ob_restore_sql_modifier.h +++ b/src/observer/ob_restore_sql_modifier.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_RS_RESTORE_SQL_MODIFIER_H_ diff --git a/src/observer/ob_root_service_monitor.cpp b/src/observer/ob_root_service_monitor.cpp index c969910bf..442bca1f8 100644 --- a/src/observer/ob_root_service_monitor.cpp +++ b/src/observer/ob_root_service_monitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_root_service_monitor.h b/src/observer/ob_root_service_monitor.h index 41e57c283..bb9494282 100644 --- a/src/observer/ob_root_service_monitor.h +++ b/src/observer/ob_root_service_monitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_ROOT_SERVICE_MONITOR_H_ diff --git a/src/observer/ob_rpc_extra_payload.cpp b/src/observer/ob_rpc_extra_payload.cpp index 90695fb15..47c8691be 100644 --- a/src/observer/ob_rpc_extra_payload.cpp +++ b/src/observer/ob_rpc_extra_payload.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_rpc_extra_payload.h b/src/observer/ob_rpc_extra_payload.h index 09443d7ff..1607d200c 100644 --- a/src/observer/ob_rpc_extra_payload.h +++ b/src/observer/ob_rpc_extra_payload.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_RPC_EXTRA_PAYLOAD_H_ diff --git a/src/observer/ob_rpc_processor_simple.cpp b/src/observer/ob_rpc_processor_simple.cpp index e791a00c7..8c68b2481 100644 --- a/src/observer/ob_rpc_processor_simple.cpp +++ b/src/observer/ob_rpc_processor_simple.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -382,8 +386,8 @@ int ObRpcGetConfigP::process() int ObRpcSetTenantConfigP::process() { LOG_INFO("process set tenant config", K(arg_)); - OTC_MGR.add_extra_config(arg_); - OTC_MGR.notify_tenant_config_changed(arg_.tenant_id_); + GCTX.config_mgr_->add_extra_config(arg_); + GCTX.config_mgr_->notify_tenant_config_changed(arg_.tenant_id_); return OB_SUCCESS; } @@ -948,18 +952,6 @@ int ObRpcWashMemFragmentationP::process() return ret; } -int ObRpcBootstrapP::process() -{ - int ret = OB_SUCCESS; - if (OB_ISNULL(gctx_.ob_service_)) { - ret = OB_INVALID_ARGUMENT; - LOG_ERROR("invalid argument", K(gctx_.ob_service_), K(ret)); - } else { - ret = gctx_.ob_service_->bootstrap(arg_); - } - return ret; -} - int ObRpcCheckServerEmptyWithResultP::process() { int ret = OB_SUCCESS; @@ -3905,10 +3897,6 @@ int ObRpcBroadcastConfigVersionP::process() ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid argument", KR(ret), K_(arg), KP(GCTX.config_mgr_)); // refresh tenant config version in local OMT - } else if (0 < arg_.get_tenant_config_version_map().count() - && OB_FAIL(OTC_MGR.got_versions(arg_.get_tenant_config_version_map()))) { - LOG_WARN("fail to refresh tenant config version map", KR(ret), K_(arg)); - // refresh global config version in global config manager } else if (0 < arg_.get_global_config_version() && OB_FAIL(GCTX.config_mgr_->got_version(arg_.get_global_config_version()))) { LOG_WARN("fail to refresh global config version", KR(ret), K_(arg)); diff --git a/src/observer/ob_rpc_processor_simple.h b/src/observer/ob_rpc_processor_simple.h index 35d96d194..54f7c4917 100644 --- a/src/observer/ob_rpc_processor_simple.h +++ b/src/observer/ob_rpc_processor_simple.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_OBSERVER_OB_RPC_PROCESSOR_SIMPLE_H_ @@ -139,7 +143,6 @@ OB_DEFINE_PROCESSOR_S(Srv, OB_GET_PARTITION_COUNT, ObRpcGetPartitionCountP); OB_DEFINE_PROCESSOR_S(Srv, OB_SWITCH_SCHEMA, ObRpcSwitchSchemaP); OB_DEFINE_PROCESSOR_S(Srv, OB_REFRESH_MEMORY_STAT, ObRpcRefreshMemStatP); OB_DEFINE_PROCESSOR_S(Srv, OB_WASH_MEMORY_FRAGMENTATION, ObRpcWashMemFragmentationP); -OB_DEFINE_PROCESSOR_S(Srv, OB_BOOTSTRAP, ObRpcBootstrapP); OB_DEFINE_PROCESSOR_S(Srv, OB_CHECK_SERVER_EMPTY, ObRpcCheckServerEmptyP); OB_DEFINE_PROCESSOR_S(Srv, OB_CHECK_SERVER_EMPTY_WITH_RESULT, ObRpcCheckServerEmptyWithResultP); OB_DEFINE_PROCESSOR_S(Srv, OB_PREPARE_SERVER_FOR_ADDING_SERVER, ObRpcPrepareServerForAddingServerP); diff --git a/src/observer/ob_server.cpp b/src/observer/ob_server.cpp index 678a19493..491d17297 100644 --- a/src/observer/ob_server.cpp +++ b/src/observer/ob_server.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -20,6 +24,7 @@ #include "lib/task/ob_timer_service.h" // ObTimerService #include "observer/ob_server_utils.h" #include "observer/ob_rpc_extra_payload.h" +#include "observer/ob_server_options.h" #include "observer/omt/ob_tenant_timezone_mgr.h" #include "observer/table/ob_table_rpc_processor.h" #include "share/allocator/ob_tenant_mutil_allocator_mgr.h" @@ -124,7 +129,6 @@ ObServer::ObServer() executor_proxy_(), executor_rpc_(), dbms_job_rpc_proxy_(), dbms_sched_job_rpc_proxy_(), interrupt_proxy_(), config_(ObServerConfig::get_instance()), reload_config_(config_, gctx_), config_mgr_(config_, reload_config_), - tenant_config_mgr_(omt::ObTenantConfigMgr::get_instance()), tenant_timezone_mgr_(omt::ObTenantTimezoneMgr::get_instance()), device_config_mgr_(share::ObDeviceConfigMgr::get_instance()), schema_service_(share::schema::ObMultiVersionSchemaService::get_instance()), @@ -173,58 +177,16 @@ ObServer::~ObServer() destroy(); } -int ObServer::parse_mode() -{ - int ret = OB_SUCCESS; - const char *mode_str = GCONF.ob_startup_mode; - - if (mode_str && strlen(mode_str) > 0) { - if (0 == STRCASECMP(mode_str, NORMAL_MODE_STR)) { - gctx_.startup_mode_ = NORMAL_MODE; - LOG_INFO("set normal mode"); -#ifdef OB_BUILD_ARBITRATION - } else if (0 == STRCASECMP(mode_str, ARBITRATION_MODE_STR)) { - gctx_.startup_mode_ = ARBITRATION_MODE; - LOG_INFO("set arbitration mode"); -#endif -#ifdef OB_BUILD_SHARED_STORAGE - } else if (0 == STRCASECMP(mode_str, SHARED_STORAGE_MODE_STR)) { - gctx_.startup_mode_ = SHARED_STORAGE_MODE; - LOG_INFO("set shared_storage mode"); -#endif - } else if (0 == STRCASECMP(mode_str, FLASHBACK_MODE_STR)) { - gctx_.startup_mode_ = PHY_FLASHBACK_MODE; - LOG_INFO("set physical_flashback mode"); - } else if (0 == STRCASECMP(mode_str, FLASHBACK_VERIFY_MODE_STR)) { - gctx_.startup_mode_ = PHY_FLASHBACK_VERIFY_MODE; - LOG_INFO("set physical_flashback_verify mode"); - } else if (0 == STRCASECMP(mode_str, DISABLED_CLUSTER_MODE_STR)) { - gctx_.startup_mode_ = DISABLED_CLUSTER_MODE; - LOG_INFO("set disabled_cluster mode"); - } else if (0 == STRCASECMP(mode_str, DISABLED_WITH_READONLY_CLUSTER_MODE_STR)) { - gctx_.startup_mode_ = DISABLED_WITH_READONLY_CLUSTER_MODE; - LOG_INFO("set disabled_with_readonly_cluster mode"); - } else { - LOG_INFO("invalid mode value", "startup_mode_", mode_str); - } - } else { - gctx_.startup_mode_ = NORMAL_MODE; - LOG_INFO("set normal mode"); - } - return ret; -} - int ObServer::init(const ObServerOptions &opts, const ObPLogWriterCfg &log_cfg) { FLOG_INFO("[OBSERVER_NOTICE] start to init observer"); DBA_STEP_RESET(server_start); int ret = OB_SUCCESS; - opts_ = opts; init_arches(); scramble_rand_.init(static_cast(start_time_), static_cast(start_time_ / 2)); // server parameters be inited here. - if (OB_FAIL(init_config())) { + if (OB_SUCC(ret) && OB_FAIL(init_config(opts))) { LOG_ERROR("init config failed", KR(ret)); } // set alert log level earlier @@ -296,7 +258,7 @@ int ObServer::init(const ObServerOptions &opts, const ObPLogWriterCfg &log_cfg) LOG_ERROR("init sql executor singletons !", KR(ret)); } else if (OB_FAIL(sql::init_sql_expr_static_var())) { LOG_ERROR("init sql expr static var !", KR(ret)); - } else if (OB_FAIL(ObPreProcessSysVars::init_sys_var())) { + } else if (OB_FAIL(ObPreProcessSysVars::init_sys_var(opts.variables_))) { LOG_ERROR("init PreProcessing system variable failed !", KR(ret)); } else if (OB_FAIL(ObBasicSessionInfo::init_sys_vars_cache_base_values())) { LOG_ERROR("init session base values failed", KR(ret)); @@ -358,7 +320,7 @@ int ObServer::init(const ObServerOptions &opts, const ObPLogWriterCfg &log_cfg) LOG_ERROR("init rs_mgr_ failed", KR(ret)); } else if (OB_FAIL(server_tracer_.init(rs_rpc_proxy_, sql_proxy_))) { LOG_ERROR("init server tracer failed", KR(ret)); - } else if (OB_FAIL(init_ob_service())) { + } else if (OB_FAIL(init_ob_service(opts.initialize_))) { LOG_ERROR("init ob service failed", KR(ret)); } else if (OB_FAIL(init_root_service())) { LOG_ERROR("init root service failed", KR(ret)); @@ -532,7 +494,6 @@ int ObServer::init(const ObServerOptions &opts, const ObPLogWriterCfg &log_cfg) DBA_STEP_INC_INFO(server_start), "observer init fail. " "you may find solutions in previous error logs or seek help from official technicians."); - raise(SIGKILL); set_stop(); destroy(); } else { @@ -872,7 +833,7 @@ void ObServer::destroy() } } -int ObServer::start() +int ObServer::start(bool embed_mode) { int ret = OB_SUCCESS; gctx_.status_ = SS_STARTING; @@ -916,7 +877,7 @@ int ObServer::start() FLOG_INFO("success to start ts mgr"); } - if (opts_.embed_mode_) { + if (embed_mode) { } else if (FAILEDx(net_frame_.start())) { LOG_ERROR("fail to start net frame", KR(ret)); } else { @@ -1198,7 +1159,7 @@ int ObServer::start() DBA_STEP_INC_INFO(server_start), "observer start fail, the stop status is ", stop_, ". " "you may find solutions in previous error logs or seek help from official technicians."); - raise(SIGKILL); + set_stop(); wait(); } else if (!stop_) { @@ -1250,7 +1211,7 @@ int ObServer::check_if_multi_tenant_synced() while (OB_SUCC(ret) && !stop_ && !synced) { synced = multi_tenant_.has_synced(); if (!synced) { - SLEEP(1); + ob_usleep(10 * 1000); } } FLOG_INFO("check if multi tenant synced", KR(ret), K(stop_), K(synced)); @@ -1306,7 +1267,7 @@ int ObServer::check_if_timezone_usable() while (OB_SUCC(ret) && !stop_ && !timezone_usable) { timezone_usable = tenant_timezone_mgr_.is_usable(); if (!timezone_usable) { - SLEEP(1); + ob_usleep(10 * 1000); } } FLOG_INFO("check if timezone usable", KR(ret), K(stop_), K(timezone_usable)); @@ -1894,7 +1855,7 @@ int ObServer::init_tz_info_mgr() return ret; } -int ObServer::init_config() +int ObServer::init_config(const ObServerOptions &opts) { int ret = OB_SUCCESS; bool has_config_file = true; @@ -1906,17 +1867,36 @@ int ObServer::init_config() } else { // set dump path const char *dump_path = "etc/observer.config.bin"; - config_mgr_.set_dump_path(dump_path); - if (OB_FILE_NOT_EXIST == (ret = config_mgr_.load_config())) { - has_config_file = false; - ret = OB_SUCCESS; - } else if (OB_FAIL(ret)) { - LOG_ERROR("load config from file failed", KR(ret)); + char buffer[PATH_MAX]; + ObSqlString abs_dump_path; + if (getcwd(buffer, sizeof(buffer)) == nullptr) { + ret = OB_ERR_SYS; + LOG_ERROR("failed to getcwd", K(ret), K(errno), K(strerror(errno))); + } else if (OB_FAIL(abs_dump_path.append_fmt("%s/%s", buffer, dump_path))) { + LOG_ERROR("failed to append", K(ret)); + } else { + config_mgr_.set_dump_path(abs_dump_path.ptr()); + if (OB_FILE_NOT_EXIST == (ret = config_mgr_.load_config())) { + has_config_file = false; + ret = OB_SUCCESS; + } else if (OB_FAIL(ret)) { + LOG_ERROR("load config from file failed", KR(ret)); + } + } + } + + ObSqlString optstr; + for (int64_t i = 0; OB_SUCC(ret) &&i < opts.parameters_.count(); ++i) { + const char *format = i == 0 ? "%.*s=%.*s" : ",%.*s=%.*s"; + if (OB_FAIL(optstr.append_fmt(format, + opts.parameters_.at(i).first.length(), opts.parameters_.at(i).first.ptr(), + opts.parameters_.at(i).second.length(), opts.parameters_.at(i).second.ptr()))) { + LOG_ERROR("append optstr fmt failed", KR(ret)); } } if (OB_FAIL(ret)) { - } else if (OB_FAIL(init_opts_config(has_config_file))) { + } else if (OB_FAIL(init_opts_config(has_config_file, opts, optstr.ptr()))) { LOG_ERROR("init opts config failed", KR(ret)); } else { config_.print(); @@ -1940,7 +1920,7 @@ int ObServer::init_config() } else { LOG_INFO("config_mgr_ dump2file success", KR(ret)); } - } else if (OB_FAIL(init_config_module())) { + } else if (OB_FAIL(init_config_module(optstr.ptr()))) { LOG_ERROR("init config module failed", KR(ret)); } else { lib::g_runtime_enabled = true; @@ -1949,27 +1929,17 @@ int ObServer::init_config() return ret; } -int ObServer::init_opts_config(bool has_config_file) +int ObServer::init_opts_config(bool has_config_file, const ObServerOptions &opts, const char *optstr) { int ret = OB_SUCCESS; - if (opts_.rpc_port_) { - config_.rpc_port = opts_.rpc_port_; - config_.rpc_port.set_version(start_time_); - } - - if (opts_.mysql_port_) { - config_.mysql_port = opts_.mysql_port_; + if (opts.port_ != 0) { + config_.mysql_port = opts.port_; config_.mysql_port.set_version(start_time_); } - if (opts_.local_ip_ && strlen(opts_.local_ip_) > 0) { - config_.local_ip.set_value(opts_.local_ip_); - config_.local_ip.set_version(start_time_); - } - - if (opts_.devname_ && strlen(opts_.devname_) > 0) { - config_.devname.set_value(opts_.devname_); + if (nullptr != opts.devname_) { + config_.devname.set_value(opts.devname_); config_.devname.set_version(start_time_); } else { if (!has_config_file) { @@ -1984,56 +1954,23 @@ int ObServer::init_opts_config(bool has_config_file) } } - if (opts_.zone_ && strlen(opts_.zone_) > 0) { - config_.zone.set_value(opts_.zone_); - config_.zone.set_version(start_time_); - } - - if (opts_.rs_list_ && strlen(opts_.rs_list_) > 0) { - config_.rootservice_list.set_value(opts_.rs_list_); - config_.rootservice_list.set_version(start_time_); - } - - if (opts_.startup_mode_) { - config_.ob_startup_mode.set_value(opts_.startup_mode_); - config_.ob_startup_mode.set_version(start_time_); - LOG_INFO("mode is not null", "mode", opts_.startup_mode_); - } - // update gctx_.startup_mode_ - if (FAILEDx(parse_mode())) { - LOG_ERROR("parse_mode failed", KR(ret)); - } - + gctx_.startup_mode_ = NORMAL_MODE; config_.syslog_level.set_value(OB_LOGGER.get_level_str()); - if (opts_.optstr_ && strlen(opts_.optstr_) > 0) { - if (FAILEDx(config_.add_extra_config(opts_.optstr_, start_time_))) { - LOG_ERROR("invalid config from cmdline options", K(opts_.optstr_), KR(ret)); - } - } - - if (opts_.appname_ && strlen(opts_.appname_) > 0) { - config_.cluster.set_value(opts_.appname_); - config_.cluster.set_version(start_time_); - if (FAILEDx(set_cluster_name_hash(ObString::make_string(opts_.appname_)))) { - LOG_WARN("failed to set_cluster_name_hash", KR(ret), "cluster_name", opts_.appname_, - "cluster_name_len", strlen(opts_.appname_)); + if (nullptr != optstr) { + if (FAILEDx(config_.add_extra_config(optstr, start_time_))) { + LOG_ERROR("invalid config from cmdline options", KCSTRING(optstr), KR(ret)); } } - if (opts_.cluster_id_ >= 0) { - // Strictly here, everything that is less than zero is ignored, not when it is equal to -1. - config_.cluster_id = opts_.cluster_id_; - config_.cluster_id.set_version(start_time_); - } - if (config_.cluster_id.get_value() > 0) { - obrpc::ObRpcNetHandler::CLUSTER_ID = config_.cluster_id.get_value(); - LOG_INFO("set CLUSTER_ID for rpc", "cluster_id", config_.cluster_id.get_value()); + if (!opts.data_dir_.empty()) { + config_.data_dir.set_value(opts.data_dir_.ptr()); + config_.data_dir.set_version(start_time_); } - if (opts_.data_dir_ && strlen(opts_.data_dir_) > 0) { - config_.data_dir.set_value(opts_.data_dir_); - config_.data_dir.set_version(start_time_); + if (!opts.redo_dir_.empty()) { + config_.redo_dir.set_value(opts.redo_dir_.ptr()); + config_.redo_dir.set_version(start_time_); } #ifdef OB_BUILD_SHARED_STORAGE @@ -2047,16 +1984,11 @@ int ObServer::init_opts_config(bool has_config_file) #endif // The command line is specified, subject to the command line - if (opts_.use_ipv6_) { - config_.use_ipv6 = opts_.use_ipv6_; + if (opts.use_ipv6_) { + config_.use_ipv6 = opts.use_ipv6_; config_.use_ipv6.set_version(start_time_); } - if (opts_.plugins_load_) { - config_.plugins_load.set_value(opts_.plugins_load_); - config_.plugins_load.set_version(start_time_); - } - return ret; } @@ -2161,11 +2093,11 @@ int ObServer::init_self_addr() return ret; } -int ObServer::init_config_module() +int ObServer::init_config_module(const char *optstr) { int ret = OB_SUCCESS; - omt::UpdateTenantConfigCb update_tenant_config_cb = + UpdateTenantConfigCb update_tenant_config_cb = [&](uint64_t tenant_id)-> void { multi_tenant_.update_tenant_config(tenant_id); @@ -2191,13 +2123,8 @@ int ObServer::init_config_module() LOG_ERROR("fail to init ctas clean up timer", KR(ret)); } else if (OB_FAIL(config_mgr_.base_init())) { LOG_ERROR("config_mgr_ base_init failed", KR(ret)); - } else if (OB_FAIL(config_mgr_.init(sql_proxy_, self_addr_))) { + } else if (OB_FAIL(config_mgr_.init(sql_proxy_, self_addr_, update_tenant_config_cb))) { LOG_ERROR("config_mgr_ init failed", K_(self_addr), KR(ret)); - } else if (OB_FAIL(tenant_config_mgr_.init(sql_proxy_, self_addr_, - &config_mgr_, update_tenant_config_cb))) { - LOG_ERROR("tenant_config_mgr_ init failed", K_(self_addr), KR(ret)); - } else if (OB_FAIL(tenant_config_mgr_.add_config_to_existing_tenant(opts_.optstr_))) { - LOG_ERROR("tenant_config_mgr_ add_config_to_existing_tenant failed", KR(ret)); } return ret; @@ -2236,23 +2163,18 @@ int ObServer::init_pre_setting() // oblog configuration if (OB_SUCC(ret)) { const int max_log_cnt = static_cast(config_.max_syslog_file_count); - const bool record_old_log_file = config_.enable_syslog_recycle; - const bool log_warn = config_.enable_syslog_wf; const bool enable_async_syslog = config_.enable_async_syslog; const int64_t max_disk_size = config_.syslog_disk_size; const int64_t min_uncompressed_count = config_.syslog_file_uncompressed_count; const char *compress_func_ptr = config_.syslog_compress_func.str(); OB_LOGGER.set_max_file_index(max_log_cnt); - OB_LOGGER.set_record_old_log_file(record_old_log_file); - LOG_INFO("Whether record old log file", K(record_old_log_file)); - OB_LOGGER.set_log_warn(log_warn); - LOG_INFO("Whether log warn", K(log_warn)); + OB_LOGGER.set_record_old_log_file(); OB_LOGGER.set_enable_async_log(enable_async_syslog); OB_LOG_COMPRESSOR.set_max_disk_size(max_disk_size); LOG_INFO("Whether compress syslog file", K(compress_func_ptr)); OB_LOG_COMPRESSOR.set_compress_func(compress_func_ptr); OB_LOG_COMPRESSOR.set_min_uncompressed_count(min_uncompressed_count); - LOG_INFO("init log config", K(record_old_log_file), K(log_warn), K(enable_async_syslog), + LOG_INFO("init log config", K(enable_async_syslog), K(max_disk_size), K(compress_func_ptr), K(min_uncompressed_count)); if (0 == max_log_cnt) { LOG_INFO("won't recycle log file"); @@ -2277,7 +2199,6 @@ int ObServer::init_pre_setting() const int64_t limit_memory = GMEMCONF.get_server_memory_limit(); const int64_t reserved_memory = std::min(config_.cache_wash_threshold.get_value(), static_cast(static_cast(limit_memory) * KVCACHE_FACTOR)); - const int64_t reserved_urgent_memory = config_.memory_reserved; if (LEAST_MEMORY_SIZE > limit_memory) { ret = OB_INVALID_CONFIG; LOG_ERROR("memory limit for oceanbase isn't sufficient", @@ -2285,15 +2206,12 @@ int ObServer::init_pre_setting() "limit to", limit_memory, "sys mem", get_phy_mem_size(), K(reserved_memory), - K(reserved_urgent_memory), KR(ret)); } else { LOG_INFO("set limit memory", K(limit_memory)); set_memory_limit(limit_memory); LOG_INFO("set reserved memory", K(reserved_memory)); ob_set_reserved_memory(reserved_memory); - LOG_INFO("set urgent memory", K(reserved_urgent_memory)); - ob_set_urgent_memory(reserved_urgent_memory); } } if (OB_SUCC(ret)) { @@ -2340,7 +2258,7 @@ int ObServer::init_io() { int ret = OB_SUCCESS; - if (OB_FAIL(OB_FILE_SYSTEM_ROUTER.init(GCONF.data_dir))) { + if (OB_FAIL(OB_FILE_SYSTEM_ROUTER.init(GCONF.data_dir, GCONF.redo_dir))) { LOG_ERROR("init OB_FILE_SYSTEM_ROUTER fail", KR(ret)); } @@ -2692,10 +2610,10 @@ int ObServer::init_global_kvcache() return ret; } -int ObServer::init_ob_service() +int ObServer::init_ob_service(bool need_bootstrap) { int ret = OB_SUCCESS; - if (OB_FAIL(ob_service_.init(sql_proxy_, server_tracer_))) { + if (OB_FAIL(ob_service_.init(sql_proxy_, server_tracer_, need_bootstrap))) { LOG_ERROR("oceanbase service init failed", KR(ret)); } return ret; @@ -2883,28 +2801,19 @@ int ObServer::init_global_context() gctx_.wr_service_ = &wr_service_; gctx_.startup_accel_handler_ = &startup_accel_handler_; - gctx_.flashback_scn_ = opts_.flashback_scn_; (void) gctx_.set_server_id(config_.observer_id); if (is_valid_server_id(gctx_.get_server_id())) { LOG_INFO("this observer has had a valid server_id", K(gctx_.get_server_id())); } gctx_.in_bootstrap_ = false; - if ((PHY_FLASHBACK_MODE == gctx_.startup_mode_ || PHY_FLASHBACK_VERIFY_MODE == gctx_.startup_mode_) - && 0 >= gctx_.flashback_scn_) { - ret = OB_INVALID_ARGUMENT; - LOG_ERROR("invalid flashback scn in flashback mode", KR(ret), - "server_mode", gctx_.startup_mode_, - "flashback_scn", gctx_.flashback_scn_); - } else { - gctx_.inited_ = true; - } + gctx_.inited_ = true; return ret; } int ObServer::init_version() { - return ObClusterVersion::get_instance().init(&config_, &tenant_config_mgr_); + return ObClusterVersion::get_instance().init(&config_); } int ObServer::init_ts_mgr() @@ -3319,7 +3228,7 @@ void ObServer::check_log_replay_over(const ObIArray &tenant_ids, const weak_read_service_.check_tenant_can_start_service(tenant_id, can_start_service, min_version); // check wait and retry if (!can_start_service) { - ob_usleep(1000 * 1000); + ob_usleep(10 * 1000); // check success } else if (i == tenant_ids.count() -1) { FLOG_INFO("[OBSERVER_NOTICE] all tenant replay log finished, start to service ", K(tenant_ids)); @@ -4191,11 +4100,7 @@ int ObServer::destroy_server_in_arb_mode() bool ObServer::is_arbitration_mode() const { -#ifdef OB_BUILD_ARBITRATION - return (ARBITRATION_MODE == gctx_.startup_mode_) ? true : false; -#else return false; -#endif } diff --git a/src/observer/ob_server.h b/src/observer/ob_server.h index 64087e05f..b3422b666 100644 --- a/src/observer/ob_server.h +++ b/src/observer/ob_server.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_OBSERVER_OB_SERVER_H_ @@ -96,6 +100,9 @@ class ObAliveServerTracer; } namespace observer { + +class ObServerOptions; + // This the class definition of ObAddr which responds the server // itself. It's designed as a singleton in program. This class is // structure aggregated but not logical processing. Please don't put @@ -121,7 +128,7 @@ class ObServer // Start OceanBase server, this function is blocked after invoking // until the server itself stops it. - int start(); + int start(bool embed_mode); int wait(); void prepare_stop(); bool is_prepare_stopped(); @@ -262,11 +269,11 @@ class ObServer ObServer(); ~ObServer(); - int init_config(); - int init_opts_config(bool has_config_file); // init configs from command line + int init_config(const ObServerOptions &opts); + int init_opts_config(bool has_config_file, const ObServerOptions &opts, const char *optstr); // init configs from command line int init_local_ip_and_devname(); int init_self_addr(); - int init_config_module(); + int init_config_module(const char *optstr); int init_tz_info_mgr(); int init_pre_setting(); int init_network(); @@ -283,7 +290,7 @@ class ObServer int init_tablet_autoincrement_service(); int init_global_kvcache(); int init_global_session_info(); - int init_ob_service(); + int init_ob_service(bool need_bootstrap); int init_root_service(); int init_sql(); int init_sql_runner(); @@ -363,7 +370,6 @@ class ObServer bool stop_; volatile bool has_stopped_; bool has_destroy_; - ObServerOptions opts_; // The network framework in OceanBase is all defined at ObServerNetworkFrame. ObSrvNetworkFrame net_frame_; obrpc::ObBatchRpc batch_rpc_; @@ -396,7 +402,6 @@ class ObServer common::ObServerConfig &config_; ObServerReloadConfig reload_config_; common::ObConfigManager config_mgr_; - omt::ObTenantConfigMgr &tenant_config_mgr_; omt::ObTenantTimezoneMgr &tenant_timezone_mgr_; share::ObDeviceConfigMgr &device_config_mgr_; diff --git a/src/observer/ob_server_event_history_table_operator.cpp b/src/observer/ob_server_event_history_table_operator.cpp index d4e3b5100..5b7e3ae12 100644 --- a/src/observer/ob_server_event_history_table_operator.cpp +++ b/src/observer/ob_server_event_history_table_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_server_event_history_table_operator.h" diff --git a/src/observer/ob_server_event_history_table_operator.h b/src/observer/ob_server_event_history_table_operator.h index 701d6d937..33b4364e1 100644 --- a/src/observer/ob_server_event_history_table_operator.h +++ b/src/observer/ob_server_event_history_table_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_SERVER_EVENT_HISTORY_TABLE_OPERATOR_H diff --git a/src/observer/ob_server_options.h b/src/observer/ob_server_options.h new file mode 100644 index 000000000..7396c3fc6 --- /dev/null +++ b/src/observer/ob_server_options.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ + +#pragma once + +#include "lib/string/ob_string.h" +#include "lib/string/ob_sql_string.h" +#include "lib/container/ob_array.h" +#include "lib/allocator/ob_malloc.h" + +namespace oceanbase { +namespace observer { + +/** + * 记录命令行参数 + */ +class ObServerOptions final +{ +public: + ObServerOptions() {} + ~ObServerOptions() {} + +public: + using KeyValuePair = std::pair; + using KeyValueArray = common::ObArray; + +public: + int port_ = 0; + int8_t log_level_ = 0; + bool nodaemon_ = false; + bool use_ipv6_ = false; + bool initialize_ = false; + bool embed_mode_ = false; + + common::ObSqlString base_dir_; + common::ObSqlString data_dir_; + common::ObSqlString redo_dir_; + KeyValueArray parameters_; + KeyValueArray variables_; + const char * devname_ = nullptr; + +private: + DISALLOW_COPY_AND_ASSIGN(ObServerOptions); +}; + +} // end of namespace observer +} // end of namespace oceanbase diff --git a/src/observer/ob_server_reload_config.cpp b/src/observer/ob_server_reload_config.cpp index fd03a0eed..2433c4e45 100644 --- a/src/observer/ob_server_reload_config.cpp +++ b/src/observer/ob_server_reload_config.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -145,13 +149,10 @@ int ObServerReloadConfig::operator()() LOG_WARN("ObReloadConfig operator() failed", K(tmp_ret)); } const int64_t reserved_memory = GCONF.cache_wash_threshold; - const int64_t reserved_urgent_memory = GCONF.memory_reserved; LOG_INFO("set limit memory", K(limit_memory)); set_memory_limit(limit_memory); LOG_INFO("set reserved memory", K(reserved_memory)); ob_set_reserved_memory(reserved_memory); - LOG_INFO("set urgent memory", K(reserved_urgent_memory)); - ob_set_urgent_memory(reserved_urgent_memory); #ifdef OB_USE_ASAN __MemoryContext__::set_enable_asan_allocator(GCONF.enable_asan_for_memory_context); #endif @@ -202,12 +203,7 @@ int ObServerReloadConfig::operator()() lib::AChunkMgr::instance().set_max_chunk_cache_size(cache_size, use_large_chunk_cache); if (!is_arbitration_mode) { - // Refresh cluster_id, cluster_name_hash for non arbitration mode - if (GCONF.cluster_id.get_value() > 0) { - obrpc::ObRpcNetHandler::CLUSTER_ID = GCONF.cluster_id.get_value(); - LOG_INFO("set CLUSTER_ID for rpc", "cluster_id", GCONF.cluster_id.get_value()); - } - + // Refresh cluster_name_hash for non arbitration mode if (FAILEDx(set_cluster_name_hash(GCONF.cluster.str()))) { LOG_WARN("failed to set_cluster_name_hash", KR(ret), "cluster_name", GCONF.cluster.str(), "cluster_name_len", strlen(GCONF.cluster.str())); diff --git a/src/observer/ob_server_reload_config.h b/src/observer/ob_server_reload_config.h index 74fca4129..7cc9f0c55 100644 --- a/src/observer/ob_server_reload_config.h +++ b/src/observer/ob_server_reload_config.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_SERVER_RELOAD_CONFIG_H_ diff --git a/src/observer/ob_server_schema_updater.cpp b/src/observer/ob_server_schema_updater.cpp index e2fe987be..247840d10 100644 --- a/src/observer/ob_server_schema_updater.cpp +++ b/src/observer/ob_server_schema_updater.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_server_schema_updater.h b/src/observer/ob_server_schema_updater.h index 1cfb76425..4c7bc9f01 100644 --- a/src/observer/ob_server_schema_updater.h +++ b/src/observer/ob_server_schema_updater.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_SERVER_SCHEMA_UPDATER_H diff --git a/src/observer/ob_server_struct.h b/src/observer/ob_server_struct.h index 098ea01c2..8bd835b9f 100644 --- a/src/observer/ob_server_struct.h +++ b/src/observer/ob_server_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEANBASE_OBSERVER_OB_SERVER_STRUCT_H_ diff --git a/src/observer/ob_server_utils.cpp b/src/observer/ob_server_utils.cpp index f1a703fd2..2c6ff44fc 100644 --- a/src/observer/ob_server_utils.cpp +++ b/src/observer/ob_server_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_server_utils.h b/src/observer/ob_server_utils.h index e92dd498f..a4a8d1d30 100644 --- a/src/observer/ob_server_utils.h +++ b/src/observer/ob_server_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_SERVER_UTILS_ diff --git a/src/observer/ob_service.cpp b/src/observer/ob_service.cpp index 7199b0252..092fbc98f 100644 --- a/src/observer/ob_service.cpp +++ b/src/observer/ob_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -155,7 +159,8 @@ ObService::ObService(const ObGlobalContext &gctx) lease_state_mgr_(), heartbeat_process_(gctx, schema_updater_, lease_state_mgr_), gctx_(gctx), server_trace_task_(), schema_release_task_(), schema_status_task_(), remote_master_rs_update_task_(gctx), ls_table_updater_(), - meta_table_checker_() + meta_table_checker_(), + need_bootstrap_(false) { } @@ -164,7 +169,8 @@ ObService::~ObService() } int ObService::init(common::ObMySQLProxy &sql_proxy, - share::ObIAliveServerTracer &server_tracer) + share::ObIAliveServerTracer &server_tracer, + bool need_bootstrap) { int ret = OB_SUCCESS; FLOG_INFO("[OBSERVICE_NOTICE] init ob_service begin"); @@ -205,9 +211,10 @@ int ObService::init(common::ObMySQLProxy &sql_proxy, gctx_.schema_service_))) { FLOG_WARN("init meta table checker failed", KR(ret)); } else { + need_bootstrap_ = need_bootstrap; inited_ = true; } - FLOG_INFO("[OBSERVICE_NOTICE] init ob_service finish", KR(ret), K_(inited)); + FLOG_INFO("[OBSERVICE_NOTICE] init ob_service finish", KR(ret), K_(inited), K_(need_bootstrap)); if (OB_FAIL(ret)) { LOG_DBA_ERROR(OB_ERR_OBSERVICE_START, "msg", "observice init() has failure", KR(ret)); } @@ -245,6 +252,13 @@ int ObService::start() if (!inited_) { ret = OB_NOT_INIT; FLOG_WARN("ob_service is not inited", KR(ret), K_(inited)); + } else if (need_bootstrap_) { + if (OB_FAIL(bootstrap())) { + LOG_ERROR("bootstrap failed", KR(ret)); + } + need_bootstrap_ = false; + } + if (OB_FAIL(ret)) { } else if (OB_FAIL(lease_state_mgr_.init(gctx_.rs_rpc_proxy_, gctx_.rs_mgr_, &heartbeat_process_, @@ -1492,33 +1506,31 @@ int ObService::broadcast_consensus_version( return OB_SUCCESS; } -int ObService::bootstrap(const obrpc::ObBootstrapArg &arg) +int ObService::bootstrap() { int ret = OB_SUCCESS; - const int64_t timeout = 600 * 1000 * 1000LL; // 10 minutes - const obrpc::ObServerInfoList &rs_list = arg.server_list_; - const ObString &shared_storage_info = arg.shared_storage_info_; - LOG_INFO("bootstrap timeout", K(timeout), "worker_timeout_ts", THIS_WORKER.get_timeout_ts()); - if (!inited_) { + + obrpc::ObBootstrapArg bootstrap_arg; + if (OB_FAIL(ret)) { + } else if (!inited_) { ret = OB_NOT_INIT; BOOTSTRAP_LOG(WARN, "not init", K(ret)); - } else if (rs_list.count() <= 0) { + } else if (!need_bootstrap_) { + ret = OB_ERR_UNEXPECTED; + BOOTSTRAP_LOG(INFO, "no need to bootstrap", K(ret)); + } else if (OB_ISNULL(gctx_.root_service_)) { ret = OB_INVALID_ARGUMENT; - BOOTSTRAP_LOG(WARN, "rs_list is empty", K(rs_list), K(ret)); - } else if (GCTX.is_shared_storage_mode() && shared_storage_info.empty()) { - ret = OB_MISS_ARGUMENT; - BOOTSTRAP_LOG(WARN, "cluster boostrap in shared_storage mode, but shared_storage_info is empty", KR(ret), K(arg)); - LOG_USER_ERROR(OB_MISS_ARGUMENT, "SHARED_STORAGE_INFO"); - } else if (!GCTX.is_shared_storage_mode() && !shared_storage_info.empty()) { - ret = OB_NOT_SUPPORTED; - BOOTSTRAP_LOG(WARN, "cluster boostrap in shared_nothing mode, but shared_storage_info is not empty", KR(ret), K(arg)); - LOG_USER_ERROR(OB_NOT_SUPPORTED, "shared_storage_info in shared-nothing mode"); + LOG_WARN("root service is null", K(ret)); + } else if (OB_FAIL(bootstrap_arg.init_default())) { + LOG_WARN("failed to init bootstrap arg", K(ret)); } else { + BOOTSTRAP_LOG(INFO, "begin bootstrap"); + const obrpc::ObServerInfoList &rs_list = bootstrap_arg.server_list_; ObPreBootstrap pre_bootstrap(*gctx_.srv_rpc_proxy_, rs_list, *gctx_.lst_operator_, *gctx_.config_, - arg, + bootstrap_arg, *gctx_.rs_rpc_proxy_); ObAddr master_rs; bool server_empty = false; @@ -1530,33 +1542,17 @@ int ObService::bootstrap(const obrpc::ObBootstrapArg &arg) } else if (OB_FAIL(pre_bootstrap.prepare_bootstrap(master_rs))) { BOOTSTRAP_LOG(ERROR, "failed to prepare boot strap", K(rs_list), K(ret)); } else { - const ObCommonRpcProxy &rpc_proxy = *gctx_.rs_rpc_proxy_; - bool boot_done = false; - const int64_t MAX_RETRY_COUNT = 30; - for (int i = 0; !boot_done && i < MAX_RETRY_COUNT; i++) { - ret = OB_SUCCESS; - int64_t rpc_timeout = timeout; - if (INT64_MAX != THIS_WORKER.get_timeout_ts()) { - rpc_timeout = max(rpc_timeout, THIS_WORKER.get_timeout_remain()); - } - if (OB_FAIL(rpc_proxy.to_addr(master_rs).timeout(rpc_timeout) - .execute_bootstrap(arg))) { - if (OB_RS_NOT_MASTER == ret) { - BOOTSTRAP_LOG(INFO, "master root service not ready", - K(master_rs), "retry_count", i, K(rpc_timeout), K(ret)); - ob_throttle_usleep(200 * 1000, OB_RS_NOT_MASTER); - } else { - const ObAddr rpc_svr = rpc_proxy.get_server(); - BOOTSTRAP_LOG(ERROR, "execute bootstrap fail", KR(ret), K(rpc_svr), K(master_rs), K(rpc_timeout)); - break; - } - } else { - boot_done = true; - } - } - if (boot_done) { - BOOTSTRAP_LOG(INFO, "succeed to do_boot_strap", K(rs_list), K(master_rs)); + BOOTSTRAP_LOG(INFO, "waiting for root service to be in service"); + while (OB_SUCC(ret) && !gctx_.root_service_->in_service()) { + ob_throttle_usleep(200 * 1000, OB_RS_NOT_MASTER); } + BOOTSTRAP_LOG(INFO, "root service is in service"); + } + if (OB_FAIL(ret)) { + } else if (OB_FAIL(gctx_.root_service_->execute_bootstrap(bootstrap_arg))) { + BOOTSTRAP_LOG(ERROR, "failed to execute bootstrap", K(rs_list), K(ret)); + } else { + BOOTSTRAP_LOG(INFO, "succeed to do_boot_strap", K(rs_list), K(master_rs)); } } @@ -3463,7 +3459,7 @@ int ObService::init_tenant_config( } else { for (int64_t i = 0; OB_SUCC(ret) && i < arg.get_tenant_configs().count(); i++) { const ObTenantConfigArg &config = arg.get_tenant_configs().at(i); - if (OB_FAIL(OTC_MGR.init_tenant_config(config))) { + if (OB_FAIL(GCTX.config_mgr_->init_tenant_config(config))) { LOG_WARN("fail to init tenant config", KR(ret), K(config)); } } // end for diff --git a/src/observer/ob_service.h b/src/observer/ob_service.h index bd16d735f..de18ed399 100644 --- a/src/observer/ob_service.h +++ b/src/observer/ob_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_SERVICE_H_ @@ -81,7 +85,8 @@ class ObService : public ObIMetaReport virtual ~ObService(); int init(common::ObMySQLProxy &sql_proxy, - share::ObIAliveServerTracer &server_tracer); + share::ObIAliveServerTracer &server_tracer, + bool need_bootstrap); int start(); void set_stop(); void stop(); @@ -211,8 +216,7 @@ class ObService : public ObIMetaReport int get_partition_count(obrpc::ObGetPartitionCountResult &result); //////////////////////////////////////////////////////////////// - // ObRpcBootstrapP @RS bootstrap - int bootstrap(const obrpc::ObBootstrapArg &arg); + // ObRpcPrepareServerForAddingServerP @RS add server int prepare_server_for_adding_server( const obrpc::ObPrepareServerForAddingServerArg &arg, @@ -286,6 +290,7 @@ class ObService : public ObIMetaReport int change_external_storage_dest(obrpc::ObAdminSetConfigArg &arg); private: + int bootstrap(); int inner_fill_tablet_info_( const int64_t tenant_id, const ObTabletID &tablet_id, @@ -326,6 +331,8 @@ class ObService : public ObIMetaReport // report ObLSTableUpdater ls_table_updater_; ObServerMetaTableChecker meta_table_checker_; + + bool need_bootstrap_; }; }//end namespace observer diff --git a/src/observer/ob_signal_handle.cpp b/src/observer/ob_signal_handle.cpp index 4389df60c..32d7c8d4e 100644 --- a/src/observer/ob_signal_handle.cpp +++ b/src/observer/ob_signal_handle.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_signal_handle.h b/src/observer/ob_signal_handle.h index 8ba8f23fe..771e96bfd 100644 --- a/src/observer/ob_signal_handle.h +++ b/src/observer/ob_signal_handle.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_SIGNAL_HANDLE_ diff --git a/src/observer/ob_sql_client_decorator.cpp b/src/observer/ob_sql_client_decorator.cpp index 2b6c21e13..baff9f8ad 100644 --- a/src/observer/ob_sql_client_decorator.cpp +++ b/src/observer/ob_sql_client_decorator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX COMMON_MYSQLP diff --git a/src/observer/ob_sql_client_decorator.h b/src/observer/ob_sql_client_decorator.h index dbaab24d8..72cddc045 100644 --- a/src/observer/ob_sql_client_decorator.h +++ b/src/observer/ob_sql_client_decorator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_SQL_CLIENT_DECORATOR_H diff --git a/src/observer/ob_srv_deliver.cpp b/src/observer/ob_srv_deliver.cpp index 536be5328..5f44236f7 100644 --- a/src/observer/ob_srv_deliver.cpp +++ b/src/observer/ob_srv_deliver.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_srv_deliver.h b/src/observer/ob_srv_deliver.h index 0c4b1c6cc..04791c966 100644 --- a/src/observer/ob_srv_deliver.h +++ b/src/observer/ob_srv_deliver.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_OBSERVER_OB_SRV_DELIVER_H_ diff --git a/src/observer/ob_srv_network_frame.cpp b/src/observer/ob_srv_network_frame.cpp index 2e2449014..ae980fbbd 100644 --- a/src/observer/ob_srv_network_frame.cpp +++ b/src/observer/ob_srv_network_frame.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_srv_network_frame.h b/src/observer/ob_srv_network_frame.h index 542a5496c..483aa276b 100644 --- a/src/observer/ob_srv_network_frame.h +++ b/src/observer/ob_srv_network_frame.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_OBSERVER_OB_SRV_NETWORK_FRAME_H_ diff --git a/src/observer/ob_srv_task.h b/src/observer/ob_srv_task.h index 7e39aea8f..c60f4a06a 100644 --- a/src/observer/ob_srv_task.h +++ b/src/observer/ob_srv_task.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_OBSERVER_OB_SRV_TASK_H_ diff --git a/src/observer/ob_srv_xlator.cpp b/src/observer/ob_srv_xlator.cpp index 1001d5774..0b7ab4cae 100644 --- a/src/observer/ob_srv_xlator.cpp +++ b/src/observer/ob_srv_xlator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -269,13 +273,13 @@ int ObSrvMySQLXlator::translate(rpc::ObRequest &req, ObReqProcessor *&processor) break; } case obmysql::COM_FIELD_LIST: { - /*为了和proxy进行适配,对于COM_FIELD_LIST命令的支持,按照以下原则支持: - * 1. 如果是非Proxy模式,返回正常的查询结果包 - * 2. 如果是Proxy模式: - * 2.1. 如果有版本号:1.7.6 以下返回不支持错误包; - * 1.7.6 及以上返回正常额查询结果; - * 无效版本号返回不支持错误包 - * 2.2. 如果没有版本号,返回不支持错误包; + /*To adapt with proxy, for the support of COM_FIELD_LIST command, follow these principles: + * 1. If it is not in Proxy mode, return a normal query result packet + * 2. If it is in Proxy mode: + * 2.1. If there is a version number: return an unsupported error packet for versions below 1.7.6; + * return a normal query result for versions 1.7.6 and above; + * return an unsupported error packet for invalid version numbers + * 2.2. If there is no version number, return an unsupported error packet; */ ObSMConnection *conn = reinterpret_cast( SQL_REQ_OP.get_sql_session(&req)); diff --git a/src/observer/ob_srv_xlator.h b/src/observer/ob_srv_xlator.h index 2b708aa85..b8bea9807 100644 --- a/src/observer/ob_srv_xlator.h +++ b/src/observer/ob_srv_xlator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_OBSERVER_OB_SRV_XLATOR_H_ diff --git a/src/observer/ob_srv_xlator_partition.cpp b/src/observer/ob_srv_xlator_partition.cpp index 2df6a81ab..75dca6d37 100644 --- a/src/observer/ob_srv_xlator_partition.cpp +++ b/src/observer/ob_srv_xlator_partition.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_srv_xlator_primary.cpp b/src/observer/ob_srv_xlator_primary.cpp index dfa00d017..9884e9507 100644 --- a/src/observer/ob_srv_xlator_primary.cpp +++ b/src/observer/ob_srv_xlator_primary.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_srv_xlator_rootserver.cpp b/src/observer/ob_srv_xlator_rootserver.cpp index 74ab77bd9..3a2ec1745 100644 --- a/src/observer/ob_srv_xlator_rootserver.cpp +++ b/src/observer/ob_srv_xlator_rootserver.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -251,4 +255,6 @@ void oceanbase::observer::init_srv_xlator_for_rootserver(ObSrvRpcXlator *xlator) // sensitive rule RPC_PROCESSOR(rootserver::ObForceDropLonelyLobAuxTableP, *gctx_.root_service_); + RPC_PROCESSOR(rootserver::ObRpcCreateAiModelP, *gctx_.root_service_); + RPC_PROCESSOR(rootserver::ObRpcDropAiModelP, *gctx_.root_service_); } diff --git a/src/observer/ob_srv_xlator_storage.cpp b/src/observer/ob_srv_xlator_storage.cpp index 68ef638df..9b5e05822 100644 --- a/src/observer/ob_srv_xlator_storage.cpp +++ b/src/observer/ob_srv_xlator_storage.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -45,7 +49,6 @@ void oceanbase::observer::init_srv_xlator_for_storage(ObSrvRpcXlator *xlator) { RPC_PROCESSOR(ObRpcSwitchSchemaP, gctx_); RPC_PROCESSOR(ObRpcRefreshMemStatP, gctx_); RPC_PROCESSOR(ObRpcWashMemFragmentationP, gctx_); - RPC_PROCESSOR(ObRpcBootstrapP, gctx_); RPC_PROCESSOR(ObRpcCheckServerEmptyP, gctx_); RPC_PROCESSOR(ObRpcCheckServerEmptyWithResultP, gctx_); RPC_PROCESSOR(ObRpcPrepareServerForAddingServerP, gctx_); diff --git a/src/observer/ob_startup_accel_task_handler.cpp b/src/observer/ob_startup_accel_task_handler.cpp index b1b462ae9..84fed9425 100644 --- a/src/observer/ob_startup_accel_task_handler.cpp +++ b/src/observer/ob_startup_accel_task_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_startup_accel_task_handler.h b/src/observer/ob_startup_accel_task_handler.h index d1fae640b..8ea72f660 100644 --- a/src/observer/ob_startup_accel_task_handler.h +++ b/src/observer/ob_startup_accel_task_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEABASE_SERVER_OB_STARTUP_ACCEL_TASK_HANDLER_H_ diff --git a/src/observer/ob_tenant_duty_task.cpp b/src/observer/ob_tenant_duty_task.cpp index c2ae04e4e..2df55d9fe 100644 --- a/src/observer/ob_tenant_duty_task.cpp +++ b/src/observer/ob_tenant_duty_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/ob_tenant_duty_task.h b/src/observer/ob_tenant_duty_task.h index 41e5ad745..cf1fc5eb6 100644 --- a/src/observer/ob_tenant_duty_task.h +++ b/src/observer/ob_tenant_duty_task.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_TENANT_DUTY_TASK_H diff --git a/src/observer/ob_uniq_task_queue.cpp b/src/observer/ob_uniq_task_queue.cpp index a573e075e..e21212688 100644 --- a/src/observer/ob_uniq_task_queue.cpp +++ b/src/observer/ob_uniq_task_queue.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_uniq_task_queue.h" diff --git a/src/observer/ob_uniq_task_queue.h b/src/observer/ob_uniq_task_queue.h index b1bd6ac12..2e0426320 100644 --- a/src/observer/ob_uniq_task_queue.h +++ b/src/observer/ob_uniq_task_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_UNIQ_TASK_QUEUE_H_ @@ -402,7 +406,7 @@ void ObUniqTaskQueue::run1() if (OB_SUCC(tasks.reserve(batch_exec_cnt))) { group = NULL; common::ObThreadCondGuard guard(cond_); - if (task_count_ > 0) { + if (task_count() > 0) { if (OB_FAIL(get_next_group(group))) { SERVER_LOG(WARN, "get_next_next failed", K(ret)); } else if (NULL == group || group->list_.get_size() <= 0) { diff --git a/src/observer/omt/ob_multi_level_queue.cpp b/src/observer/omt/ob_multi_level_queue.cpp index 970799f3e..929fa6fe5 100644 --- a/src/observer/omt/ob_multi_level_queue.cpp +++ b/src/observer/omt/ob_multi_level_queue.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER_OMT diff --git a/src/observer/omt/ob_multi_level_queue.h b/src/observer/omt/ob_multi_level_queue.h index 86cba23c3..86358f438 100644 --- a/src/observer/omt/ob_multi_level_queue.h +++ b/src/observer/omt/ob_multi_level_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_MULTI_LEVEL_QUEUE_H diff --git a/src/observer/omt/ob_multi_tenant.cpp b/src/observer/omt/ob_multi_tenant.cpp index 10c300bb5..c013f52d8 100644 --- a/src/observer/omt/ob_multi_tenant.cpp +++ b/src/observer/omt/ob_multi_tenant.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER_OMT @@ -99,6 +103,7 @@ #include "observer/table/ob_htable_rowkey_mgr.h" #include "sql/ob_sql_ccl_rule_manager.h" #include "sql/dtl/ob_dtl_interm_result_manager.h" +#include "observer/omt/ob_tenant_ai_service.h" using namespace oceanbase; using namespace oceanbase::lib; @@ -452,6 +457,7 @@ int ObMultiTenant::init(ObAddr myaddr, MTL_BIND2(mtl_new_default, rootserver::ObDDLServiceLauncher::mtl_init, nullptr, nullptr, nullptr, mtl_destroy_default); MTL_BIND2(mtl_new_default, rootserver::ObDDLScheduler::mtl_init, nullptr, rootserver::ObDDLScheduler::mtl_stop, rootserver::ObDDLScheduler::mtl_wait, mtl_destroy_default); MTL_BIND2(ObSQLCCLRuleManager::mtl_new, ObSQLCCLRuleManager::mtl_init, nullptr, nullptr, nullptr, ObSQLCCLRuleManager::mtl_destroy); + MTL_BIND2(mtl_new_default, ObTenantAiService::mtl_init, mtl_start_default, mtl_stop_default, mtl_wait_default, mtl_destroy_default); } if (OB_SUCC(ret)) { @@ -772,8 +778,6 @@ int ObMultiTenant::create_tenant(const ObTenantMeta &meta, bool write_slog, cons } else if (FALSE_IT(create_step = ObTenantCreateStep::STEP_TENANT_NEWED)) { //step5 } else if (OB_FAIL(tenant_->init_ctx())) { LOG_WARN("init ctx fail", K(tenant_id), K(ret)); - } else if (OB_FAIL(OTC_MGR.add_tenant_config(tenant_id))) { - LOG_ERROR("add tenant config fail", K(tenant_id), K(ret)); } else { CREATE_WITH_TEMP_ENTITY(RESOURCE_OWNER, tenant_->id()) { WITH_ENTITY(&tenant_->ctx()) { @@ -786,10 +790,6 @@ int ObMultiTenant::create_tenant(const ObTenantMeta &meta, bool write_slog, cons if (OB_FAIL(ret)) { // do nothing -#ifdef OMT_UNITTEST - } else if (OB_FAIL(OTC_MGR.got_version(tenant_id, common::ObSystemConfig::INIT_VERSION))) { - LOG_ERROR("failed to got version", K(tenant_id), K(ret)); -#endif } else { ObTenantSwitchGuard guard(tenant_); if (OB_FAIL(MTL(ObTenantFreezer *)->set_tenant_mem_limit(meta.unit_.config_.memory_size(), allowed_mem_limit))) { @@ -809,8 +809,7 @@ int ObMultiTenant::create_tenant(const ObTenantMeta &meta, bool write_slog, cons SpinRLockGuard guard(lock_); tenant_active_ = true; } - - // TODO: @lingyang 预期不能失败 + // TODO: @lingyang Expected not to fail if (OB_TMP_FAIL(update_tenant_config(tenant_id))) { LOG_WARN("update tenant config fail", K(tenant_id), K(tmp_ret)); } @@ -1522,8 +1521,8 @@ int ObMultiTenant::mark_del_tenant(const uint64_t tenant_id) } ERRSIM_POINT_DEF(ERRSIM_REMOVE_TENANT_LOCK_ERROR); -// 确保remove_tenant函数可以重复调用, 因为在删除租户时失败会不断重试, -// 这里只是删除内存结构,持久化的数据还在。 +// Ensure the remove_tenant function can be called repeatedly, because deleting a tenant may fail and require multiple retries, +// Here we only delete the memory structure, the persisted data is still there. void ObMultiTenant::remove_tenant() { int ret = OB_SUCCESS; diff --git a/src/observer/omt/ob_multi_tenant.h b/src/observer/omt/ob_multi_tenant.h index 886e91bd7..60d3ad328 100644 --- a/src/observer/omt/ob_multi_tenant.h +++ b/src/observer/omt/ob_multi_tenant.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_OBSERVER_OMT_OB_MULTI_TENANT_H_ @@ -40,7 +44,6 @@ class ObRequest; } namespace omt { -class ObTenantConfig; struct ObCtxMemConfig { diff --git a/src/observer/omt/ob_multi_tenant_operator.cpp b/src/observer/omt/ob_multi_tenant_operator.cpp index b5bc6133a..db0ab3b5c 100644 --- a/src/observer/omt/ob_multi_tenant_operator.cpp +++ b/src/observer/omt/ob_multi_tenant_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER_OMT @@ -33,7 +37,7 @@ ObMultiTenantOperator::~ObMultiTenantOperator() void ObMultiTenantOperator::reset() { if (inited_) { - // 如果迭代未结束,释放残留的资源 + // If the iteration is not finished, release the remaining resources int ret = OB_SUCCESS; if (tenant_ != nullptr) { { @@ -43,7 +47,7 @@ void ObMultiTenantOperator::reset() tenant_->unlock(); } if (OB_FAIL(ret)) { - // 无法处理资源释放不了的问题 + // Unable to handle the issue of resource release failure abort(); } else { tenant_ = nullptr; diff --git a/src/observer/omt/ob_multi_tenant_operator.h b/src/observer/omt/ob_multi_tenant_operator.h index 0f5fdddc4..c07ac0fbb 100644 --- a/src/observer/omt/ob_multi_tenant_operator.h +++ b/src/observer/omt/ob_multi_tenant_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_OBSERVER_OMT_OB_MULTI_TENANT_OPERATOR_H_ @@ -29,14 +33,14 @@ class ObMultiTenantOperator virtual ~ObMultiTenantOperator(); int init(); - // 处理当前租户 + // Process the current tenant virtual int process_curr_tenant(common::ObNewRow *&row) = 0; - // 释放上一个租户的资源 + // Release the resources of the previous tenant virtual void release_last_tenant() = 0; - // 过滤租户 + // Filter tenant virtual bool is_need_process(uint64_t tenant_id) { return true; } - // 释放资源, 注意继承ObMultiTenantOperator的子类在销毁时必须首先调用ObMultiTenantOperator::reset() - // 由ObMultiTenantOperator维护的租户状态释放子类上的租户对象 + // Release resources, note that subclasses inheriting from ObMultiTenantOperator must first call ObMultiTenantOperator::reset() when destroyed + // Tenant object release on subclasses maintained by ObMultiTenantOperator void reset(); int execute(common::ObNewRow *&row); diff --git a/src/observer/omt/ob_retry_queue.cpp b/src/observer/omt/ob_retry_queue.cpp index 9575831d1..3a5adf1d3 100644 --- a/src/observer/omt/ob_retry_queue.cpp +++ b/src/observer/omt/ob_retry_queue.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER_OMT diff --git a/src/observer/omt/ob_retry_queue.h b/src/observer/omt/ob_retry_queue.h index 9739f1d91..75cf3673d 100644 --- a/src/observer/omt/ob_retry_queue.h +++ b/src/observer/omt/ob_retry_queue.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_RETRY_QUEUE_H @@ -42,4 +46,4 @@ class ObRetryQueue { } // oceanbase -#endif \ No newline at end of file +#endif diff --git a/src/observer/omt/ob_tenant.cpp b/src/observer/omt/ob_tenant.cpp index 7321577cd..ede950efd 100644 --- a/src/observer/omt/ob_tenant.cpp +++ b/src/observer/omt/ob_tenant.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER_OMT @@ -917,7 +921,7 @@ void ObTenant::mark_tenant_is_removed() } ERRSIM_POINT_DEF(CREATE_MTL_MODULE_FAIL) -// 初始化租户各子模块,保证初始化同步执行,因为依赖线程局部变量和栈上变量 +// Initialize tenant sub-modules, ensuring synchronous execution during initialization, because it depends on thread-local variables and stack variables int ObTenant::create_tenant_module() { int ret = OB_SUCCESS; @@ -936,9 +940,9 @@ int ObTenant::create_tenant_module() LOG_ERROR("create_tenant_module failed because of tracepoint CREATE_MTL_MODULE_FAIL", K(tenant_id), K(ret)); } else if (FALSE_IT(ObTenantEnv::set_tenant(this))) { - // 上面通过ObTenantSwitchGuard中会创建一个新的TenantBase线程局部变量,而不是存TenantBase的指针, - // 目的是通过MTL()访问时减少一次内存跳转,但是设置的时mtl模块的指针还是nullptr, 所以在mtl创建完成时 - // 还需要设置一次。 + // Above, a new TenantBase thread-local variable is created through ObTenantSwitchGuard, rather than storing a pointer to TenantBase, + // The purpose is to reduce one memory jump when accessing via MTL(), but the pointer set for the mtl module is still nullptr, so when the mtl creation is completed + // Still needs to be set once. } else if (FALSE_IT(mtl_init = true)) { } else if (OB_FAIL(ObTenantBase::init_mtl_module())) { LOG_ERROR("init mtl module failed", K(tenant_id), K(ret)); diff --git a/src/observer/omt/ob_tenant.h b/src/observer/omt/ob_tenant.h index d40ec693d..fbc43d86d 100644 --- a/src/observer/omt/ob_tenant.h +++ b/src/observer/omt/ob_tenant.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_OBSERVER_OMT_OB_TENANT_H_ diff --git a/src/observer/omt/ob_tenant_ai_service.cpp b/src/observer/omt/ob_tenant_ai_service.cpp new file mode 100644 index 000000000..60a4987e0 --- /dev/null +++ b/src/observer/omt/ob_tenant_ai_service.cpp @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ + +#define USING_LOG_PREFIX SERVER_OMT +#include "ob_tenant_ai_service.h" +#include "share/ai_service/ob_ai_service_executor.h" +#include "sql/privilege_check/ob_ai_model_priv_util.h" +#include "sql/session/ob_sql_session_info.h" +#include "sql/engine/ob_exec_context.h" + +using namespace oceanbase::share; +using namespace oceanbase::common; + +namespace oceanbase +{ +namespace omt +{ + +ObTenantAiService::ObTenantAiService() + : is_inited_(false) +{ +} + +ObTenantAiService::~ObTenantAiService() +{ + destroy(); +} + +int ObTenantAiService::mtl_init(ObTenantAiService* &tenant_ai_service) +{ + int ret = OB_SUCCESS; + if (OB_ISNULL(tenant_ai_service)) { + ret = OB_INVALID_ARGUMENT; + LOG_WARN("tenant ai service is null", KR(ret)); + } else if (OB_FAIL(tenant_ai_service->init())) { + LOG_WARN("Failed to init ObTenantAiService", KR(ret)); + } + return ret; +} + +int ObTenantAiService::init() +{ + int ret = OB_SUCCESS; + if (IS_INIT) { + ret = OB_INIT_TWICE; + LOG_WARN("ObTenantAiService already initialized", K(ret)); + } else { + is_inited_ = true; + } + return ret; +} + +void ObTenantAiService::destroy() +{ + is_inited_ = false; +} + +int ObTenantAiService::get_ai_service_guard(ObAiServiceGuard &ai_service_guard) +{ + // TODO: implement after cache support + int ret = OB_SUCCESS; + return ret; +} + +ObAiServiceGuard::ObAiServiceGuard() + : local_allocator_(ObMemAttr(MTL_ID(), "AiServiceGuard", ObCtxIds::DEFAULT_CTX_ID)) +{ +} + +ObAiServiceGuard::~ObAiServiceGuard() +{ +} + +int ObAiServiceGuard::check_access_privilege() +{ + int ret = OB_SUCCESS; + bool has_priv = false; + + ObSQLSessionInfo *session = nullptr; + if (OB_ISNULL(session = THIS_WORKER.get_session())) { + // system background task thread do not have session, skip check + } else { + ObArenaAllocator tmp_allocator; + share::schema::ObSchemaGetterGuard *schema_guard = session->get_cur_exec_ctx()->get_sql_ctx()->schema_guard_; + if (OB_ISNULL(schema_guard)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("schema guard is null", K(ret)); + } else { + sql::ObAIServiceEndpointPrivUtil priv_util(*schema_guard); + share::schema::ObSessionPrivInfo session_priv; + uint64_t user_id = session->get_priv_user_id(); + if (user_id == OB_INVALID_ID && session->get_priv_tenant_id() == OB_SYS_TENANT_ID) { + user_id = OB_SYS_USER_ID; + } + if (OB_FAIL(schema_guard->get_session_priv_info(session->get_priv_tenant_id(), + user_id, + session->get_database_name(), + session_priv))) { + LOG_WARN("failed to get session priv info", K(ret)); + } else if (OB_FAIL(priv_util.check_access_ai_model_priv(tmp_allocator, session_priv, has_priv))) { + LOG_WARN("failed to check access ai model privilege", K(ret)); + } else if (!has_priv) { + ret = OB_ERR_NO_PRIVILEGE; + LOG_WARN("no privilege for ai model access", K(ret)); + LOG_USER_ERROR(OB_ERR_NO_PRIVILEGE, "access ai model"); + } + } + } + + return ret; +} + +int ObAiServiceGuard::get_ai_endpoint(const common::ObString &name, share::ObAiModelEndpointInfo *&endpoint_info) +{ + int ret = OB_SUCCESS; + ObAiModelEndpointInfo *tmp_endpoint_info = nullptr; + + if (OB_FAIL(check_access_privilege())) { + LOG_WARN("failed to check access privilege", K(ret)); + } else if (OB_ISNULL(tmp_endpoint_info = OB_NEWx(ObAiModelEndpointInfo, &local_allocator_))) { + ret = OB_ALLOCATE_MEMORY_FAILED; + LOG_WARN("failed to alloc endpoint info", KR(ret)); + } else if (OB_FAIL(ObAiServiceExecutor::read_ai_endpoint(local_allocator_, name, *tmp_endpoint_info))) { + LOG_WARN("failed to select ai endpoint", KR(ret), K(name)); + } else { + endpoint_info = tmp_endpoint_info; + } + return ret; +} + +int ObAiServiceGuard::get_ai_endpoint_by_ai_model_name(const common::ObString &ai_model_name, share::ObAiModelEndpointInfo *&endpoint_info, bool need_check) +{ + int ret = OB_SUCCESS; + ObAiModelEndpointInfo *tmp_endpoint_info = nullptr; + + if (need_check && OB_FAIL(check_access_privilege())) { + LOG_WARN("failed to check access privilege", K(ret)); + } else if (OB_ISNULL(tmp_endpoint_info = OB_NEWx(ObAiModelEndpointInfo, &local_allocator_))) { + ret = OB_ALLOCATE_MEMORY_FAILED; + LOG_WARN("failed to alloc endpoint info", KR(ret)); + } else if (OB_FAIL(ObAiServiceExecutor::read_ai_endpoint_by_ai_model_name(local_allocator_, ai_model_name, *tmp_endpoint_info))) { + LOG_WARN("failed to select ai endpoint by ai model name", KR(ret), K(ai_model_name)); + } else { + endpoint_info = tmp_endpoint_info; + } + return ret; +} + +} // namespace omt +} // namespace oceanbase diff --git a/src/observer/omt/ob_tenant_ai_service.h b/src/observer/omt/ob_tenant_ai_service.h new file mode 100644 index 000000000..78cdad66c --- /dev/null +++ b/src/observer/omt/ob_tenant_ai_service.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ + +#ifndef OCEANBASE_OBSERVER_OMT_OB_TENANT_AI_SERVICE_H_ +#define OCEANBASE_OBSERVER_OMT_OB_TENANT_AI_SERVICE_H_ + +#include "share/ai_service/ob_ai_service_struct.h" +#include "share/rc/ob_tenant_base.h" +#include "lib/lock/ob_tc_rwlock.h" +#include "lib/container/ob_se_array.h" +#include "sql/privilege_check/ob_ai_model_priv_util.h" +#include "share/ob_server_struct.h" +#include "deps/oblib/src/lib/worker.h" + +namespace oceanbase +{ +namespace omt +{ + +class ObAiServiceGuard +{ +public: + ObAiServiceGuard(); + ~ObAiServiceGuard(); + int get_ai_endpoint(const common::ObString &name, share::ObAiModelEndpointInfo *&endpoint_info); + int get_ai_endpoint_by_ai_model_name(const common::ObString &ai_model_name, share::ObAiModelEndpointInfo *&endpoint_info, bool need_check = true); +private: + int check_access_privilege(); + ObArenaAllocator local_allocator_; + DISALLOW_COPY_AND_ASSIGN(ObAiServiceGuard); +}; + +class ObTenantAiService +{ +public: + ObTenantAiService(); + virtual ~ObTenantAiService(); + static int mtl_init(ObTenantAiService* &tenant_ai_service); + int init(); + int start() { return OB_SUCCESS; } + void stop() {}; + void wait() {}; + void destroy(); +public: + int get_ai_service_guard(ObAiServiceGuard &ai_service_guard); +private: + bool is_inited_; + DISALLOW_COPY_AND_ASSIGN(ObTenantAiService); +}; + +} // namespace omt +} // namespace oceanbase + +#endif // OCEANBASE_OBSERVER_OMT_OB_TENANT_AI_SERVICE_H_ diff --git a/src/observer/omt/ob_tenant_config.cpp b/src/observer/omt/ob_tenant_config.cpp deleted file mode 100644 index dce3d1947..000000000 --- a/src/observer/omt/ob_tenant_config.cpp +++ /dev/null @@ -1,610 +0,0 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ - -#define USING_LOG_PREFIX SERVER_OMT - -#include "ob_tenant_config.h" -#include "sql/monitor/flt/ob_flt_control_info_mgr.h" -#include "share/errsim_module/ob_errsim_module_interface_imp.h" - -using namespace oceanbase::common; - -namespace oceanbase { -namespace omt { - -ObTenantConfig::ObTenantConfig() : ObTenantConfig(OB_INVALID_TENANT_ID) -{ -} - -ObTenantConfig::ObTenantConfig(uint64_t tenant_id) - : tenant_id_(tenant_id), current_version_(INITIAL_TENANT_CONF_VERSION), - mutex_(), - update_task_(), system_config_(), config_mgr_(nullptr), - ref_(0L), is_deleting_(false), create_timestamp_(0L) -{ -} - -int ObTenantConfig::init(ObTenantConfigMgr *config_mgr) -{ - int ret = OB_SUCCESS; - config_mgr_ = config_mgr; - create_timestamp_ = ObTimeUtility::current_time(); - if (OB_FAIL(system_config_.init())) { - LOG_ERROR("init system config failed", K(ret)); - } else if (OB_FAIL(update_task_.init(config_mgr, this))) { - LOG_ERROR("init tenant config updata task failed", K_(tenant_id), K(ret)); - } - return ret; -} - -void ObTenantConfig::print() const -{ - OB_LOG(INFO, "===================== * begin tenant config report * =====================", K(tenant_id_)); - ObConfigContainer::const_iterator it = container_.begin(); - for (; it != container_.end(); ++it) { - if (OB_ISNULL(it->second)) { - OB_LOG_RET(WARN, OB_ERR_UNEXPECTED, "config item is null", "name", it->first.str()); - } else { - _OB_LOG(INFO, "| %-36s = %s", it->first.str(), it->second->str()); - } - } - OB_LOG(INFO, "===================== * stop tenant config report * =======================", K(tenant_id_)); -} - -void ObTenantConfig::trace_all_config() const -{ - ObConfigContainer::const_iterator it = container_.begin(); - for (; it != container_.end(); ++it) { - if (OB_ISNULL(it->second)) { - } else if (it->second->case_compare(it->second->default_str()) != 0) { - OPT_TRACE(" ", it->first.str(), " = ", it->second->str()); - } - } -} - -int ObTenantConfig::read_config() -{ - int ret = OB_SUCCESS; - ObSystemConfigKey key; - ObAddr server; - char local_ip[OB_MAX_SERVER_ADDR_SIZE] = ""; - server = GCTX.self_addr(); - if (OB_UNLIKELY(true != server.ip_to_string(local_ip, sizeof(local_ip)))) { - ret = OB_CONVERT_ERROR; - } else { - key.set_varchar(ObString::make_string("svr_type"), print_server_role(get_server_type())); - key.set_int(ObString::make_string("svr_port"), GCONF.rpc_port); - key.set_varchar(ObString::make_string("svr_ip"), local_ip); - key.set_varchar(ObString::make_string("zone"), GCONF.zone); - ObConfigContainer::const_iterator it = container_.begin(); - for (; OB_SUCC(ret) && it != container_.end(); ++it) { - key.set_name(it->first.str()); - if (OB_ISNULL(it->second)) { - ret = OB_ERR_UNEXPECTED; - OB_LOG(ERROR, "config item is null", "name", it->first.str(), K(ret)); - } else { - key.set_version(it->second->version()); - int temp_ret = system_config_.read_config(get_tenant_id(), key, *(it->second)); - if (OB_SUCCESS != temp_ret) { - OB_LOG(DEBUG, "Read config error", "name", it->first.str(), K(temp_ret)); - } - } - } // for - } - return ret; -} - -void ObTenantConfig::TenantConfigUpdateTask::runTimerTask() -{ - int ret = OB_SUCCESS; - if (OB_ISNULL(config_mgr_)) { - ret = OB_NOT_INIT; - LOG_WARN("invalid argument", K_(config_mgr), K(ret)); - } else if (OB_ISNULL(tenant_config_)){ - ret = OB_NOT_INIT; - LOG_WARN("invalid argument", K_(tenant_config), K(ret)); - } else { - const int64_t saved_current_version = tenant_config_->current_version_; - const int64_t version = version_; - THIS_WORKER.set_timeout_ts(INT64_MAX); - if (tenant_config_->current_version_ >= version) { - ret = OB_ALREADY_DONE; - } else if (update_local_) { - tenant_config_->current_version_ = version; - if (OB_FAIL(tenant_config_->system_config_.clear())) { - LOG_WARN("Clear system config map failed", K(ret)); - } else if (OB_FAIL(config_mgr_->update_local(tenant_config_->tenant_id_, version))) { - LOG_WARN("ObTenantConfigMgr update_local failed", K(ret), K(tenant_config_)); - } else { - config_mgr_->notify_tenant_config_changed(tenant_config_->tenant_id_); - } - - sql::ObFLTControlInfoManager mgr(tenant_config_->tenant_id_); - if (OB_FAIL(ret)) { - // do nothing - } else if (OB_FAIL(mgr.init())) { - LOG_WARN("fail to init", KR(ret)); - } else if (OB_FAIL(mgr.apply_control_info())) { - LOG_WARN("fail to apply control info", KR(ret)); - } else { - LOG_TRACE("apply control info", K(tenant_config_->tenant_id_)); - } - - if (OB_FAIL(ret)) { - int tmp_ret = OB_SUCCESS; - uint64_t tenant_id = tenant_config_->tenant_id_; - tenant_config_->current_version_ = saved_current_version; - share::schema::ObSchemaGetterGuard schema_guard; - share::schema::ObMultiVersionSchemaService *schema_service = GCTX.schema_service_; - bool tenant_dropped = false; - // 租户如果正在删除过程中,schema失效,则返回添加反复失败,会导致定时器任务超量 - if (OB_ISNULL(schema_service)) { - tmp_ret = OB_ERR_UNEXPECTED; - LOG_WARN("schema_service is null", K(ret), K(tmp_ret)); - } else if (OB_SUCCESS != (tmp_ret = schema_service->get_tenant_schema_guard(OB_SYS_TENANT_ID, schema_guard))) { - LOG_WARN("fail to get schema guard", K(ret), K(tmp_ret), K(tenant_id)); - } else if (OB_SUCCESS != (tmp_ret = schema_guard.check_if_tenant_has_been_dropped(tenant_id, tenant_dropped))) { - LOG_WARN("fail to check if tenant has been dropped", K(ret), K(tmp_ret), K(tenant_id)); - } else { - if (tenant_dropped) { - LOG_INFO("tenant has dropped", K(tenant_id)); - } else if ((ATOMIC_FAA(&running_task_count_, 1) < 2)) { - if (OB_FAIL(config_mgr_->schedule(*this, 0))) { - LOG_WARN("schedule task failed", K(tenant_id), K(ret)); - ATOMIC_DEC(&running_task_count_); - } else if (tenant_config_->is_deleting_) { - LOG_INFO("tenant under deleting, cancel task", K(tenant_id)); - if (OB_FAIL(config_mgr_->cancel(*this))) { - LOG_WARN("cancel task failed", K(tenant_id), K(ret)); - } else { - ATOMIC_DEC(&running_task_count_); - } - } else { - LOG_INFO("Schedule a retry task!", K(tenant_id)); - } - } else { - ATOMIC_DEC(&running_task_count_); - LOG_INFO("already 2 running task, temporory no need more", K(tenant_id)); - } - } - } else { - const int64_t read_version = tenant_config_->system_config_.get_version(); - LOG_INFO("loaded new tenant config", - "tenant_id", tenant_config_->tenant_id_, - "read_version", read_version, - "old_version", saved_current_version, - "current_version", tenant_config_->current_version_, - "expected_version", version); - tenant_config_->print(); - } - } - } - - ATOMIC_DEC(&running_task_count_); -} - -// 需要解决的场景: -// 场景1:脚本中更新上百个参数,每个参数触发一次 got_version,如果不加以防范, -// 会导致 timer 线程 32 个槽位被耗尽,导致参数更新丢失。 -// 场景2: heartbeat 始终广播相同的 version,只需要响应最多一次 -int ObTenantConfig::got_version(int64_t version, const bool remove_repeat) -{ - UNUSED(remove_repeat); - int ret = OB_SUCCESS; - bool schedule_task = false; - if (version < 0) { - update_task_.update_local_ = false; - schedule_task = true; - } else if (0 == version) { - LOG_DEBUG("root server restarting"); - } else if (current_version_ == version) { - } else if (version < current_version_) { - LOG_WARN("Local tenant config is newer than rs, weird", K_(current_version), K(version)); - } else if (version > current_version_) { - if (!mutex_.trylock()) { - LOG_DEBUG("Processed by other thread!"); - } else { - LOG_INFO("Got new tenant config version", K_(tenant_id), - K_(current_version), K(version)); - update_task_.update_local_ = true; - update_task_.version_ = version; - update_task_.scheduled_time_ = ObClockGenerator::getClock(); - schedule_task = true; - mutex_.unlock(); - } - } - if (schedule_task) { - bool schedule = true; - if (!config_mgr_->inited()) { - schedule = false; - ret = OB_NOT_INIT; - LOG_WARN("Couldn't update config because timer is NULL", K(ret)); - } - if (schedule && !is_deleting_) { - // 为了避免极短时间内上百个变量被更新导致生成上百个update_task - // 占满 timer slots (32个),我们需要限定短时间内生成的 update_task - // 数量。考虑到每个 update_task 的任务都是同质的(不区分version,都是 - // 负责把 parameter 刷到最新),我们只需要为这数百个变量更新生成 - // 1个 update task 即可。但是,考虑到 update task 执行过程中还会有 - // 新的变量更新到来,为了让这些更新不丢失,需要另外在生成一个任务负责 - // “扫尾”。整个时序如下图: - // - // t----> 时间增长的方向 - // '~' 表示在 timer 队列中等待调度 - // '-' 表示 task 被 timer 调度执行中 - // - // case1: task3 在 task1 结束后进入 timer 队列 - // |~~~~|--- task1 ----| - // |~~~~~~~~|--- task2 ----| - // |~~~~~~~~~~~~~|--- task3 ----| - // - // case2: task3 在 task1 结束前就进入了 timer 队列 - // |~~~~|--- task1 ----| - // |~~~~~~~~|--- task2 ----| - // |~~~~~~~~~~~~~~~|--- task3 ----| - // - // - - // running_task_count_ 可以 - // 不甚精确地限定同一时刻只能有两个 update_task,要么两个都在 - // 调度队列中等待,要么一个在运行另一个在调度队列中等待(上图 case1)。 - // 之所以说“不甚精确”,是因为 running_task_count_-- 操作是在 - // runTimerTask() 的结尾调用的,那么存在一种小概率的情况,某一很短的 - // 时刻,有大于 2 个 update_task 在调度队列中等待(上图的case2)。 - // 不过我们认为,这种情况可以接受,不会影响正确性。 - if ((ATOMIC_FAA(&update_task_.running_task_count_, 1) < 2)) { - if (OB_FAIL(config_mgr_->schedule(update_task_, 0))) { - LOG_WARN("schedule task failed", K_(tenant_id), K(ret)); - ret = OB_SUCCESS; // if task reach 32 limit, it has chance to retry later - ATOMIC_DEC(&update_task_.running_task_count_); - } else { - LOG_INFO("Schedule update tenant config task successfully!", K_(tenant_id)); - } - } else { - ATOMIC_DEC(&update_task_.running_task_count_); - LOG_INFO("already 2 running task, temporory no need more", K_(tenant_id)); - } - } - } - return ret; -} - -int ObTenantConfig::update_local(int64_t expected_version, ObMySQLProxy::MySQLResult &result, - bool save2file /* = true */) -{ - int ret = OB_SUCCESS; - if (OB_FAIL(system_config_.update(result))) { - LOG_WARN("failed to load system config", K(ret)); - } else if (expected_version != ObSystemConfig::INIT_VERSION && (system_config_.get_version() < current_version_ - || system_config_.get_version() < expected_version)) { - ret = OB_EAGAIN; - LOG_WARN("__tenant_parameter is older than the expected version", K(ret), - "read_version", system_config_.get_version(), - "current_version", current_version_, - "expected_version", expected_version); - } else { - LOG_INFO("read tenant config from __tenant_parameter succeed", K_(tenant_id)); - } - - if (OB_SUCC(ret)) { - if (OB_FAIL(read_config())) { - LOG_ERROR("Read tenant config failed", K_(tenant_id), K(ret)); - } else if (save2file && OB_FAIL(config_mgr_->dump2file_unsafe())) { - LOG_WARN("Dump to file failed", K(ret)); - } else if (OB_FAIL(publish_special_config_after_dump())) { - LOG_WARN("publish special config after dump failed", K(tenant_id_), K(ret)); - } -#ifdef ERRSIM - else if (OB_FAIL(build_errsim_module_())) { - LOG_WARN("failed to build errsim module", K(ret), K(tenant_id_)); - } -#endif - print(); - } else { - LOG_WARN("Read tenant config from inner table error", K_(tenant_id), K(ret)); - } - return ret; -} - -int ObTenantConfig::publish_special_config_after_dump() -{ - int ret = OB_SUCCESS; - ObConfigItem *const *pp_item = NULL; - if (OB_ISNULL(pp_item = container_.get(ObConfigStringKey(COMPATIBLE)))) { - ret = OB_INVALID_CONFIG; - LOG_WARN("Invalid config string", K(tenant_id_), K(ret)); - } else if (!(*pp_item)->dump_value_updated()) { - LOG_INFO("config dump value is not set, no need read", K(tenant_id_), K((*pp_item)->spfile_str())); - } else { - uint64_t new_data_version = 0; - uint64_t old_data_version = 0; - bool value_updated = (*pp_item)->value_updated(); - if (OB_FAIL(ObClusterVersion::get_version((*pp_item)->spfile_str(), new_data_version))) { - LOG_ERROR("parse data_version failed", KR(ret), K((*pp_item)->spfile_str())); - } else if (OB_FAIL(ObClusterVersion::get_version((*pp_item)->str(), old_data_version))) { - LOG_ERROR("parse data_version failed", KR(ret), K((*pp_item)->str())); - } else if (!value_updated && old_data_version != DATA_CURRENT_VERSION) { - ret = OB_ERR_UNEXPECTED; - SHARE_LOG(ERROR, "unexpected data_version", KR(ret), K(old_data_version)); - } else if (value_updated && new_data_version <= old_data_version) { - LOG_INFO("[COMPATIBLE] [DATA_VERSION] no need to update", K(tenant_id_), - "old_data_version", DVP(old_data_version), - "new_data_version", DVP(new_data_version)); - // do nothing - } else { - if (!(*pp_item)->set_value_unsafe((*pp_item)->spfile_str())) { - ret = OB_INVALID_CONFIG; - LOG_WARN("Invalid config value", K(tenant_id_), K((*pp_item)->spfile_str()), K(ret)); - } else { - FLOG_INFO("[COMPATIBLE] [DATA_VERSION] read data_version after dump", - KR(ret), K_(tenant_id), "version", (*pp_item)->version(), - "value", (*pp_item)->str(), "value_updated", - (*pp_item)->value_updated(), "dump_version", - (*pp_item)->dumped_version(), "dump_value", - (*pp_item)->spfile_str(), "dump_value_updated", - (*pp_item)->dump_value_updated()); - } - } - } - return ret; -} - -int ObTenantConfig::add_extra_config_unsafe(const char *config_str, - int64_t version /* = 0 */ , - bool check_config /* = true */) -{ - int ret = OB_SUCCESS; - const int64_t MAX_OPTS_LENGTH = sysconf(_SC_ARG_MAX); - int64_t config_str_length = 0; - char *buf = NULL; - char *saveptr = NULL; - char *token = NULL; - const char *delimiter = "|\n"; - if (OB_ISNULL(config_str)) { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("config str is null", K(ret)); - } else if ((config_str_length = static_cast(STRLEN(config_str))) >= MAX_OPTS_LENGTH) { - ret = OB_BUF_NOT_ENOUGH; - LOG_ERROR("Extra config is too long", K(ret)); - } else if (OB_ISNULL(buf = new (std::nothrow) char[config_str_length + 1])) { - ret = OB_ALLOCATE_MEMORY_FAILED; - LOG_ERROR("ob tc malloc memory for buf fail", K(ret)); - } else { - MEMCPY(buf, config_str, config_str_length); - buf[config_str_length] = '\0'; - token = STRTOK_R(buf, delimiter, &saveptr); - if (0 == STRLEN(saveptr)) { - delimiter = ",\n"; - token = STRTOK_R(buf, delimiter, &saveptr); - } - const ObString compatible_cfg(COMPATIBLE); - const ObString enable_compatible_monotonic_cfg(ENABLE_COMPATIBLE_MONOTONIC); - while (OB_SUCC(ret) && OB_LIKELY(NULL != token)) { - char *saveptr_one = NULL; - char *name = NULL; - const char *value = NULL; - ObConfigItem *const *pp_item = NULL; - if (OB_ISNULL(name = STRTOK_R(token, "=", &saveptr_one))) { - ret = OB_INVALID_CONFIG; - LOG_ERROR("Invalid config string", K(token), K(ret)); - } else if (OB_ISNULL(saveptr_one) || OB_UNLIKELY('\0' == *(value = saveptr_one))) { - LOG_INFO("Empty config string", K(token), K(name)); - // ret = OB_INVALID_CONFIG; - name = NULL; - } - if (OB_SUCC(ret)) { - if (OB_ISNULL(name)) { - // do nothing, just skip this parameter - } else { - char curr_tid_str[32] = {'\0'}; // 32 is enougth for uint64_t - snprintf(curr_tid_str, sizeof(curr_tid_str), "%lu", tenant_id_); - char *tid_in_arg = NULL; - name = STRTOK_R(name, "@", &tid_in_arg); - if (OB_ISNULL(name) || OB_UNLIKELY('\0' == *name)) { - // skip this parameter because name is invalid - } else if (OB_NOT_NULL(tid_in_arg) && ('\0' != *tid_in_arg) && - 0 != strcmp(tid_in_arg, curr_tid_str)) { - // skip this parameter because the tenant_id does bot match - } else { - const int value_len = strlen(value); - // hex2cstring -> value_len / 2 + 1 - // '\0' -> 1 - const int external_info_val_len = value_len / 2 + 1 + 1; - char *external_info_val = (char*)ob_malloc(external_info_val_len, "temp"); - DEFER(if (external_info_val != nullptr) ob_free(external_info_val);); - if (OB_ISNULL(external_info_val)) { - ret = OB_ALLOCATE_MEMORY_FAILED; - LOG_WARN("failed to alloc", K(ret)); - } else if (FALSE_IT(external_info_val[0] = '\0')) { - } else if (OB_ISNULL(pp_item = container_.get(ObConfigStringKey(name)))) { - ret = OB_SUCCESS; - LOG_WARN("Invalid config string, no such config item", K(name), K(value), K(ret)); - } - if (OB_FAIL(ret) || OB_ISNULL(pp_item)) { - } else if (0 == compatible_cfg.case_compare(name)) { - // init tenant and observer reload with -o will use this interface to update tenant's - // config. considering the -o situation, we need to ensure the new_data_version won't - // go back - uint64_t new_data_version = 0; - uint64_t old_data_version = 0; - if (OB_FAIL(ObClusterVersion::get_version(value, new_data_version))) { - LOG_ERROR("parse data_version failed", KR(ret), K(value)); - } else if (((*pp_item)->value_updated() || (*pp_item)->dump_value_updated()) && - OB_FAIL(ObClusterVersion::get_version( - (*pp_item)->spfile_str(), old_data_version))) { - LOG_ERROR("parse data_version failed", KR(ret), K((*pp_item)->spfile_str())); - } else if (new_data_version <= old_data_version) { - // do nothing - LOG_INFO("[COMPATIBLE] DATA_VERSION no need to update", - K(tenant_id_), K(old_data_version), - K(new_data_version)); - } else { - if (!(*pp_item)->set_dump_value(value)) { - ret = OB_INVALID_CONFIG; - LOG_WARN("Invalid config value", K(name), K(value), K(ret)); - } else { - (*pp_item)->set_dump_value_updated(); - (*pp_item)->set_version(version); - int tmp_ret = 0; - if (OB_TMP_FAIL(ODV_MGR.set(tenant_id_, new_data_version))) { - LOG_WARN("fail to set data_version", KR(tmp_ret), - K(tenant_id_), K(new_data_version)); - } - FLOG_INFO("[COMPATIBLE] [DATA_VERSION] init data_version before dump", - KR(ret), K_(tenant_id), "version", - (*pp_item)->version(), "value", (*pp_item)->str(), - "value_updated", (*pp_item)->value_updated(), - "dump_version", (*pp_item)->dumped_version(), - "dump_value", (*pp_item)->spfile_str(), - "dump_value_updated", (*pp_item)->dump_value_updated(), - K(old_data_version), K(new_data_version)); - } - } - } else if (!(*pp_item)->set_value_unsafe(value)) { - ret = OB_INVALID_CONFIG; - LOG_WARN("Invalid config value", K(name), K(value), K(ret)); - } else if (check_config && (!(*pp_item)->check_unit(value) || !(*pp_item)->check())) { - ret = OB_INVALID_CONFIG; - const char* range = (*pp_item)->range(); - if (OB_ISNULL(range) || strlen(range) == 0) { - LOG_ERROR("Invalid config, value out of range", K(name), K(value), K(ret)); - } else { - _LOG_ERROR("Invalid config, value out of %s (for reference only). name=%s, value=%s, ret=%d", range, name, value, ret); - } - } else { - (*pp_item)->set_version(version); - LOG_INFO("Load tenant config succ", K(name), K(value)); - if (0 == enable_compatible_monotonic_cfg.case_compare(name)) { - ObString v_str((*pp_item)->str()); - ODV_MGR.set_enable_compatible_monotonic(0 == v_str.case_compare("True") ? true - : false); - } - } - } - } - token = STRTOK_R(NULL, delimiter, &saveptr); - } - } - } - if (NULL != buf) { - delete [] buf; - buf = NULL; - } - return ret; -} - -OB_DEF_SERIALIZE(ObTenantConfig) -{ - int ret = OB_SUCCESS; - int64_t expect_data_len = get_serialize_size_(); - int64_t saved_pos = pos; - if (OB_FAIL(databuff_printf(buf, buf_len, pos, "[%lu]\n", tenant_id_))) { - } else { - ret = ObCommonConfig::serialize(buf, buf_len, pos); - } - if (OB_SUCC(ret)) { - int64_t writen_len = pos - saved_pos; - if (writen_len != expect_data_len) { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("unexpected data size", K(writen_len), K(expect_data_len)); - } - } - return ret; -} - -OB_DEF_DESERIALIZE(ObTenantConfig) -{ - int ret = OB_SUCCESS; - if ('[' != *(buf + pos)) { - ret = OB_INVALID_DATA; - LOG_ERROR("invalid tenant config", K(ret)); - } else { - int64_t cur = pos + 1; - while (cur < data_len - 1 && ']' != *(buf + cur)) { - ++cur; - } // while - if (cur >= data_len - 1 || '\n' != *(buf + cur + 1)) { - ret = OB_INVALID_DATA; - LOG_ERROR("invalid tenant config", K(ret)); - } else { - uint64_t tenant_id = OB_INVALID_TENANT_ID; - char tenant_str[100]; - char *p_end = nullptr; - MEMSET(tenant_str, '\0', 100); - if (cur - pos - 1 < 100) { - MEMCPY(tenant_str, buf + pos + 1, cur - pos - 1); - tenant_id = strtoul(tenant_str, &p_end, 0); - pos = cur + 2; - if ('\0' != *p_end) { - ret = OB_INVALID_CONFIG; - LOG_ERROR("invalid tenant id", K(ret)); - } else if (tenant_id != tenant_id_) { - LOG_ERROR("wrong tenant id", K(ret)); - } else { - ret = ObCommonConfig::deserialize(buf, data_len, pos); - } - } else { - ret = OB_INVALID_DATA; - LOG_ERROR("invalid tenant id", K(ret)); - } - } - } - return ret; -} - -OB_DEF_SERIALIZE_SIZE(ObTenantConfig) -{ - int64_t len = 0, tmp_pos = 0; - int ret = OB_SUCCESS; - char tenant_str[100] = {'\0'}; - if (OB_FAIL(databuff_printf(tenant_str, 100, tmp_pos, "[%lu]\n", tenant_id_))) { - LOG_WARN("write data buff failed", K(ret)); - } else { - len += tmp_pos; - } - len += ObCommonConfig::get_serialize_size(); - return len; -} - -#ifdef ERRSIM -int ObTenantConfig::build_errsim_module_() -{ - int ret = OB_SUCCESS; - char buf[ObErrsimModuleTypeHelper::MAX_TYPE_NAME_LENGTH] = ""; - ObTenantErrsimModuleMgr::ModuleArray module_array; - ObTenantErrsimModuleMgr::ErrsimModuleString string; - - for (int64_t i = 0; OB_SUCC(ret) && i < this->errsim_module_types.size(); ++i) { - if (OB_FAIL(this->errsim_module_types.get( - static_cast(i), buf, sizeof(buf)))) { - LOG_WARN("get rs failed", K(ret), K(i)); - } else if (OB_FAIL(string.assign(buf))) { - LOG_WARN("failed to assign buffer", K(ret)); - } else if (OB_FAIL(module_array.push_back(string))) { - LOG_WARN("failed to push string into array", K(ret), K(string)); - } - } - - if (OB_SUCC(ret)) { - const int64_t percentage = this->errsim_module_error_percentage; - - if (OB_FAIL(build_tenant_errsim_moulde(tenant_id_, current_version_, module_array, percentage))) { - LOG_WARN("failed to build tenant module", K(ret), K(tenant_id_)); - } - } - return ret; -} -#endif - - -} // omt -} // oceanbase diff --git a/src/observer/omt/ob_tenant_config.h b/src/observer/omt/ob_tenant_config.h deleted file mode 100644 index 7b5f60885..000000000 --- a/src/observer/omt/ob_tenant_config.h +++ /dev/null @@ -1,129 +0,0 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ - -#ifndef OCEANBASE_TENANT_CONFIG_H_ -#define OCEANBASE_TENANT_CONFIG_H_ - -#include "share/config/ob_config.h" -#include "share/config/ob_system_config.h" -#include "share/config/ob_common_config.h" -#include "share/config/ob_config_helper.h" -#include "lib/lock/ob_drw_lock.h" - -namespace oceanbase { - -namespace omt { - -using common::ObCommonConfig; -using common::Section; -using common::Scope; -using common::Source; -using common::EditLevel; -using common::ObParameterAttr; -class ObTenantConfigMgr; - -class ObTenantConfig : public ObCommonConfig -{ - friend class ObTenantConfigMgr; -public: - static const int64_t INITIAL_TENANT_CONF_VERSION = 1; -public: - class TenantConfigUpdateTask : public common::ObTimerTask - { - public: - TenantConfigUpdateTask() : config_mgr_(nullptr), tenant_config_(nullptr), - version_(0), scheduled_time_(0), - update_local_(false), - running_task_count_(0) {} - int init(ObTenantConfigMgr *config_mgr, ObTenantConfig *config) - { - config_mgr_ = config_mgr; - tenant_config_ = config; - return common::OB_SUCCESS; - } - virtual ~TenantConfigUpdateTask() {} - TenantConfigUpdateTask(const TenantConfigUpdateTask &) = delete; - TenantConfigUpdateTask &operator=(const TenantConfigUpdateTask &) = delete; - void runTimerTask(void) override; - ObTenantConfigMgr *config_mgr_; - ObTenantConfig *tenant_config_; - volatile int64_t version_; - volatile int64_t scheduled_time_; - bool update_local_; - volatile int64_t running_task_count_; - }; - friend class TenantConfigUpdateTask; - static const int64_t LOCK_TIMEOUT = 1 * 1000 * 1000; -public: - ObTenantConfig(); - ObTenantConfig(uint64_t tenant_id); - int init(ObTenantConfigMgr *config_mgr); - virtual ~ObTenantConfig() {}; - void set_tenant_config_mgr(ObTenantConfigMgr *config_mgr) { config_mgr_ = config_mgr; }; - void set_deleting(bool deleting = true) { is_deleting_ = deleting; } - ObTenantConfig(const ObTenantConfig &)=delete; - ObTenantConfig &operator=(const ObTenantConfig &)=delete; - - void print() const override; - void trace_all_config() const; - int check_all() const override { return OB_SUCCESS; } - common::ObServerRole get_server_type() const override { return common::OB_SERVER; } - void ref() { ATOMIC_INC(&ref_); } - void unref() { ATOMIC_DEC(&ref_); } - bool is_ref_clear() { return 0 == ATOMIC_LOAD(&ref_); } - - int read_config(); - int publish_special_config_after_dump(); - virtual uint64_t get_tenant_id() const override { return tenant_id_; } - int64_t get_current_version() const { return current_version_; } - const TenantConfigUpdateTask &get_update_task() const { return update_task_; } - int64_t get_create_timestamp() const { return create_timestamp_; } - int got_version(int64_t version, const bool remove_repeat); - int update_local(int64_t expected_version, common::ObMySQLProxy::MySQLResult &result, - bool save2file = true); - - OB_UNIS_VERSION(1); -private: -#ifdef ERRSIM - int build_errsim_module_(); -#endif - // whitout lock, only used inner - int add_extra_config_unsafe(const char *config_str, - int64_t version = 0 , - bool check_config = true); -private: - uint64_t tenant_id_; - int64_t current_version_; // 当前 tenant config 正在被 task 更新中的版本 - obutil::Mutex mutex_; - TenantConfigUpdateTask update_task_; - common::ObSystemConfig system_config_; - ObTenantConfigMgr *config_mgr_; - int64_t ref_; - bool is_deleting_; - int64_t create_timestamp_; - -public: -/////////////////////////////////////////////////////////////////////////////// -// use MACRO 'OB_TENANT_PARAMETER' to define new tenant parameters -// in ob_parameter_seed.ipp -/////////////////////////////////////////////////////////////////////////////// -#undef OB_TENANT_PARAMETER -#define OB_TENANT_PARAMETER(args...) args -#include "share/parameter/ob_parameter_seed.ipp" -#undef OB_TENANT_PARAMETER - -}; - -} // omt -} // oceanbase - -#endif diff --git a/src/observer/omt/ob_tenant_config_mgr.cpp b/src/observer/omt/ob_tenant_config_mgr.cpp index f046575c3..c94360309 100644 --- a/src/observer/omt/ob_tenant_config_mgr.cpp +++ b/src/observer/omt/ob_tenant_config_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER_OMT @@ -25,809 +29,20 @@ ObTenantConfigGuard::ObTenantConfigGuard() : ObTenantConfigGuard(nullptr) { } -ObTenantConfigGuard::ObTenantConfigGuard(ObTenantConfig *config) +ObTenantConfigGuard::ObTenantConfigGuard(ObServerConfig *config) { config_ = config; } ObTenantConfigGuard::~ObTenantConfigGuard() { - if (OB_NOT_NULL(config_)) { - config_->unref(); - } } -void ObTenantConfigGuard::set_config(ObTenantConfig *config) +void ObTenantConfigGuard::set_config(ObServerConfig *config) { - if (OB_NOT_NULL(config_)) { - config_->unref(); - } config_ = config; } -void ObTenantConfigGuard::trace_all_config() const -{ - if (OB_NOT_NULL(config_)) { - config_->trace_all_config(); - } -} - -int TenantConfigInfo::assign(const TenantConfigInfo &rhs) -{ - int ret = OB_SUCCESS; - tenant_id_ = rhs.tenant_id_; - if (OB_FAIL(name_.assign(rhs.name_))) { - LOG_WARN("assign name fail", K_(name), K(ret)); - } else if (OB_FAIL(data_type_.assign(rhs.data_type_))) { - LOG_WARN("assign data_type fail", K_(data_type), K(ret)); - } else if (OB_FAIL(value_.assign(rhs.value_))) { - LOG_WARN("assign value fail", K_(value), K(ret)); - } else if (OB_FAIL(info_.assign(rhs.info_))) { - LOG_WARN("assign info fail", K_(info), K(ret)); - } else if (OB_FAIL(section_.assign(rhs.section_))) { - LOG_WARN("assign section fail", K_(section), K(ret)); - } else if (OB_FAIL(scope_.assign(rhs.scope_))) { - LOG_WARN("assign scope fail", K_(scope), K(ret)); - } else if (OB_FAIL(source_.assign(rhs.source_))) { - LOG_WARN("assign source fail", K_(source), K(ret)); - } else if (OB_FAIL(edit_level_.assign(rhs.edit_level_))) { - LOG_WARN("assign edit_level fail", K_(edit_level), K(ret)); - } - return ret; -} - -int64_t TenantConfigInfo::to_string(char *buf, const int64_t buf_len) const -{ - int64_t pos = 0; - int ret = OB_SUCCESS; - if (OB_NOT_NULL(buf) && buf_len > 0) { - if (OB_FAIL(databuff_printf(buf, buf_len, pos, "tenant_id: [%lu], name: [%s]," - "value: [%s], info: [%s]", - tenant_id_, name_.ptr(), value_.ptr(), info_.ptr()))) { - pos = 0; - LOG_WARN("to_string buff fail", K(ret)); - } - } - return pos; -} - -ObTenantConfigMgr::ObTenantConfigMgr() - : rwlock_(ObLatchIds::CONFIG_LOCK), inited_(false), self_(), sql_proxy_(nullptr), - config_map_(), config_version_map_(), sys_config_mgr_(nullptr), - version_has_refreshed_(false), update_tenant_config_cb_() -{ -} - -ObTenantConfigMgr::~ObTenantConfigMgr() -{ -} - -ObTenantConfigMgr &ObTenantConfigMgr::get_instance() -{ - static ObTenantConfigMgr ob_tenant_config_mgr; - return ob_tenant_config_mgr; -} - -int ObTenantConfigMgr::init(ObMySQLProxy &sql_proxy, - const ObAddr &server, - ObConfigManager *config_mgr, - const UpdateTenantConfigCb &update_tenant_config_cb) -{ - int ret = OB_SUCCESS; - sql_proxy_ = &sql_proxy; - self_ = server; - sys_config_mgr_ = config_mgr; - update_tenant_config_cb_ = update_tenant_config_cb; - ret = config_version_map_.create(oceanbase::common::OB_MAX_SERVER_TENANT_CNT, - oceanbase::common::ObModIds::OB_HASH_BUCKET_CONF_CONTAINER, - oceanbase::common::ObModIds::OB_HASH_NODE_CONF_CONTAINER); - inited_ = true; - return ret; -} - -void ObTenantConfigMgr::refresh_config_version_map(const ObIArray &tenants) -{ - int ret = OB_SUCCESS; - if (true == version_has_refreshed_) { - // no need to refresh again - } else if (OB_ISNULL(sql_proxy_)) { - ret = OB_NOT_INIT; - LOG_WARN("sql proxy is null", K(ret)); - } else { - ObSQLClientRetryWeak sql_client_retry_weak(sql_proxy_); - SMART_VAR(ObMySQLProxy::MySQLResult, result) { - bool has_sql_error = false; - for (int i = 0; OB_SUCC(ret) && i < tenants.count(); ++i) { - int64_t version = 0; - uint64_t tenant_id = tenants.at(i); - uint64_t exec_tenant_id = gen_meta_tenant_id(tenant_id); - ObSqlString sql; - if (OB_FAIL(sql.assign_fmt("select max(config_version) from %s where tenant_id = '%lu'", - OB_TENANT_PARAMETER_TNAME, tenant_id))) { - LOG_WARN("fail to generate sql", KR(ret), K(tenant_id)); - } else if (OB_FAIL(sql_client_retry_weak.read(result, exec_tenant_id, sql.ptr()))) { - has_sql_error = true; - ret = OB_SUCCESS; - LOG_INFO("read config from __tenant_parameter failed", - KR(ret), K(tenant_id), K(exec_tenant_id), K(sql)); - } else if (NULL == result.get_result()) { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("config result is null", K(tenant_id), K(ret)); - } else if (OB_FAIL(result.get_result()->next())) { - LOG_WARN("get result next failed", K(tenant_id), K(ret)); - } else if (OB_FAIL(result.get_result()->get_int(0L, version))) { - if (OB_ERR_NULL_VALUE != ret) { - LOG_WARN("get config_version failed", K(tenant_id), K(ret)); - } else { - LOG_INFO("tenant has no config", K(tenant_id)); - ret = OB_SUCCESS; - } - } else if (OB_FAIL(set_tenant_config_version(tenant_id, version))) { - LOG_WARN("set config version failed", K(tenant_id), K(ret)); - } else { - LOG_INFO("update tenant config version success", K(tenant_id), K(version)); - } - } - if ((OB_SUCCESS == ret) && (false == has_sql_error)) { - version_has_refreshed_ = true; - LOG_INFO("update all tenant config success"); - } - } - } -} - -// 背景:每个 server 上需要保存所有租户的 config 信息 -// 当新建租户/删除租户时需要对应维护 config 状态。 -// -// IN: 当前活跃租户 -// ACTION: 根据 tenants 信息,决定要添加/删除哪些租户配置项 -int ObTenantConfigMgr::refresh_tenants(const ObIArray &tenants) -{ - int ret = OB_SUCCESS; - ObSEArray new_tenants; - ObSEArray del_tenants; - - if (tenants.count() > 0) { - // 探测要加的 config - { - DRWLock::RDLockGuard guard(rwlock_); - for (int i = 0; i < tenants.count(); ++i) { - uint64_t tenant_id = tenants.at(i); - ObTenantConfig *const *config = nullptr; - if (NULL == (config = config_map_.get(ObTenantID(tenant_id)))) { - // 如果 tenant 不存在,则添加到 config_map 中 - if (OB_FAIL(new_tenants.push_back(tenant_id))) { - LOG_WARN("fail add tenant config", K(tenant_id), K(ret)); - } - } else if (OB_ISNULL((*config))) { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("tenant config is null", K(ret), K(tenant_id), K(config)); - } else { - // periodically(10s) check that ObTenantDataVersionMgr doesn't fall behind ObTenantConfigMgr - bool value_updated = (*config)->compatible.value_updated(); - int tmp_ret = OB_SUCCESS; - const uint64_t data_version = (*config)->compatible; - if (value_updated) { - if (OB_TMP_FAIL(ODV_MGR.set(tenant_id, data_version))) { - LOG_WARN("fail to set data_version in refresh_tenants", KR(tmp_ret), K(tenant_id), - KDV(data_version)); - } - } - LOG_INFO("[DATA_VERSION] periodically update data_version", KR(tmp_ret), K(tenant_id), - K(value_updated), KDV(data_version)); - } - } - } - // 探测要删的 config - { - DRWLock::RDLockGuard guard(rwlock_); - TenantConfigMap::const_iterator it = config_map_.begin(); - for (; it != config_map_.end(); ++it) { - uint64_t tenant_id = it->first.tenant_id_; - if (OB_SYS_TENANT_ID == tenant_id) { - continue; - } - bool need_del = true; - for (int i = 0; i < tenants.count(); ++i) { - if (tenant_id == tenants.at(i) || GCTX.omt_->has_tenant(tenant_id)) { - need_del = false; - break; - } - } - if (need_del) { - if (OB_FAIL(del_tenants.push_back(tenant_id))) { - LOG_WARN("fail add tenant config", K(tenant_id), K(ret)); - } - } - } - } - } - int tmp_ret = OB_SUCCESS; - // 加 config - for (int i = 0; i < new_tenants.count(); ++i) { - if (OB_TMP_FAIL(add_tenant_config(new_tenants.at(i)))) { - LOG_WARN("fail add tenant config", K(i), K(new_tenants.at(i)), K(ret), K(tmp_ret)); - } else { - LOG_INFO("add created tenant config succ", K(i), K(new_tenants.at(i))); - } - } - // 删 config - // use timeout to avoid holding the write lock of ObTenantConfigMgr::rwlock_ for too long - int64_t delete_abs_timeout_us = ObTimeUtility::current_time() + 500 * 1000; - for (int i = 0; i < del_tenants.count(); ++i) { - if (OB_TMP_FAIL(del_tenant_config(del_tenants.at(i), delete_abs_timeout_us))) { - LOG_WARN("fail del tenant config, will try later", K(i), K(del_tenants.at(i)), K(ret), K(tmp_ret)); - } else { - LOG_INFO("del dropped tenant config succ.", K(i), K(del_tenants.at(i))); - } - } - - refresh_config_version_map(tenants); - - return ret; -} - -// This function will be called in the early stage in bootstrap/create tenant. -// Meanwhile, related tenant's tables are not readable, so it's safe to call add_extra_config(). -int ObTenantConfigMgr::init_tenant_config(const obrpc::ObTenantConfigArg &arg) -{ - int ret = OB_SUCCESS; - if (OB_FAIL(add_tenant_config(arg.tenant_id_))) { - LOG_WARN("fail to add tenant config", KR(ret), K(arg)); - } else if (OB_FAIL(add_extra_config(arg))) { - LOG_WARN("fail to add extra config", KR(ret), K(arg)); - } else { - DRWLock::WRLockGuard guard(rwlock_); - ObTenantConfig *config = nullptr; - if (OB_FAIL(dump2file_unsafe())) { - LOG_WARN("fail to dump config to file", KR(ret), K(arg)); - } else if (OB_FAIL(config_map_.get_refactored(ObTenantID(arg.tenant_id_), config))) { - LOG_WARN("No tenant config found", K(arg.tenant_id_), K(ret)); - } else if (OB_FAIL(config->publish_special_config_after_dump())) { - LOG_WARN("publish special config after dump failed", K(ret)); - } - } - return ret; -} - -int ObTenantConfigMgr::add_tenant_config(uint64_t tenant_id) -{ - int ret = OB_SUCCESS; - ObTenantConfig *const *config = nullptr; - DRWLock::WRLockGuard guard(rwlock_); - if (is_virtual_tenant_id(tenant_id) - || OB_NOT_NULL(config = config_map_.get(ObTenantID(tenant_id)))) { - if (nullptr != config) { - ObTenantConfig *new_config = *config; - new_config->set_deleting(false); - } - } else { - ObTenantConfig *new_config = nullptr; - new_config = OB_NEW(ObTenantConfig, SET_USE_UNEXPECTED_500("TenantConfig"), tenant_id); - if (OB_NOT_NULL(new_config)) { - if(OB_FAIL(new_config->init(this))) { - LOG_WARN("new tenant config init failed", K(ret)); - } else if (OB_FAIL(config_map_.set_refactored(ObTenantID(tenant_id), - new_config, 0))) { - LOG_WARN("add new tenant config failed", K(ret)); - } - if (OB_FAIL(ret)) { - ob_delete(new_config); - } - } else { - ret = OB_ALLOCATE_MEMORY_FAILED; - LOG_WARN("alloc new tenant config failed", K(ret)); - } - } - LOG_INFO("tenant config added", K(tenant_id), K(ret)); - return ret; -} - -int ObTenantConfigMgr::del_tenant_config(uint64_t tenant_id, const int64_t abs_timeout_us) -{ - int ret = OB_SUCCESS; - ObTenantConfig *config = nullptr; - DRWLock::WRLockGuard guard(rwlock_); - ObTenant *tenant = NULL; - bool has_dropped = false; - if (is_virtual_tenant_id(tenant_id)) { - } else if (OB_FAIL(config_map_.get_refactored(ObTenantID(tenant_id), config))) { - LOG_WARN("get tenant config failed", K(tenant_id), K(ret)); - } else if (OB_FAIL(GSCHEMASERVICE.check_if_tenant_has_been_dropped(tenant_id, has_dropped))) { - LOG_WARN("failed to check tenant has been dropped", K(tenant_id)); - } else if (!has_dropped && ObTimeUtility::current_time() - config->get_create_timestamp() < RECYCLE_LATENCY) { - LOG_WARN("tenant still exist, try to delete tenant config later...", K(tenant_id)); - } else if (!config->is_ref_clear()) { - ret = OB_EAGAIN; - LOG_INFO("something hold config ref, try delete later..."); - } else if (OB_ISNULL(GCTX.omt_)) { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("omt is null", KR(ret)); - } else if (GCTX.omt_->has_tenant(tenant_id)) { - LOG_WARN("local tenant resource still exist, try to delete tenant config later", K(tenant_id)); - } else { - config->set_deleting(); - if (OB_FAIL(wait(config->get_update_task(), abs_timeout_us))) { - LOG_WARN("wait tenant config update task failed", K(ret), K(tenant_id)); - } else if (OB_FAIL(config_map_.erase_refactored(ObTenantID(tenant_id)))) { - LOG_WARN("delete tenant config failed", K(ret), K(tenant_id)); - } else { - ob_delete(config); - LOG_INFO("tenant config deleted", K(tenant_id), K(ret)); - int tmp_ret = OB_SUCCESS; - if (OB_TMP_FAIL(ODV_MGR.remove(tenant_id))) { - LOG_WARN("fail to remove data_version", K(tmp_ret), K(tenant_id)); - } - } - } - return ret; -} - -ObTenantConfig *ObTenantConfigMgr::get_tenant_config_with_lock( - const uint64_t tenant_id, const uint64_t fallback_tenant_id /* = 0 */, - const uint64_t timeout_us /* = 0 */) const -{ - int ret = OB_SUCCESS; - ObTenantConfig *config = nullptr; - DRWLock::RDLockGuard guard(rwlock_); - do { - if (OB_FAIL(config_map_.get_refactored(ObTenantID(tenant_id), config)) && timeout_us > 0) { - ob_usleep(10 * 1000L); - if (REACH_TIME_INTERVAL(1 * 1000 * 1000L)) { - LOG_WARN("failed to get tenant config, retry for 1s", K(tenant_id), K(ret)); - } - } else { - break; - } - } while (!REACH_TIME_INTERVAL(timeout_us)); - if (OB_FAIL(ret)) { - if (fallback_tenant_id > 0 && OB_INVALID_ID != fallback_tenant_id) { - if (OB_FAIL(config_map_.get_refactored(ObTenantID(fallback_tenant_id), config))) { - LOG_WARN("failed to get fallback tenant config", K(fallback_tenant_id), K(ret)); - } - } else { - LOG_WARN("failed to get tenant config", K(tenant_id), K(ret)); - } - } - if (OB_SUCC(ret) && OB_NOT_NULL(config)) { - config->ref(); // remember to unref outside - } - return config; -} - -int ObTenantConfigMgr::read_tenant_config( - const uint64_t tenant_id, - const uint64_t fallback_tenant_id, - const SuccessFunctor &on_success, - const FailureFunctor &on_failure) const -{ - int ret = OB_SUCCESS; - ObTenantConfig *config = nullptr; - DRWLock::RDLockGuard guard(rwlock_); - if (OB_FAIL(config_map_.get_refactored(ObTenantID(tenant_id), config))) { - if (fallback_tenant_id > 0 && OB_INVALID_ID != fallback_tenant_id) { - if (OB_FAIL(config_map_.get_refactored(ObTenantID(fallback_tenant_id), config))) { - LOG_WARN("failed to get tenant config", K(fallback_tenant_id), K(ret), K(lbt())); - } - } else { - LOG_WARN("failed to get tenant config", K(tenant_id), K(ret)); - } - } - if (OB_SUCC(ret) && OB_NOT_NULL(config)) { - on_success(*config); - } else { - on_failure(); - LOG_WARN("fail read tenant config", K(tenant_id), K(ret)); - } - return ret; -} - - -int ObTenantConfigMgr::dump2file_unsafe() -{ - int ret = OB_SUCCESS; - if (OB_FAIL(sys_config_mgr_->dump2file_unsafe())) { - LOG_WARN("failed to dump2file", K(ret)); - } else if (OB_FAIL(sys_config_mgr_->config_backup())) { - LOG_WARN("failed to dump2file backup", K(ret)); - } - return ret; -} - - -int ObTenantConfigMgr::set_tenant_config_version(uint64_t tenant_id, int64_t version) -{ - int ret = OB_SUCCESS; - int64_t cur_version = 0; - DRWLock::WRLockGuard guard(rwlock_); - if (OB_FAIL(config_version_map_.get_refactored(ObTenantID(tenant_id), cur_version))) { - if (OB_HASH_NOT_EXIST != ret) { - LOG_WARN("get tenant config version fail", K(tenant_id), K(ret)); - } else { - ret = OB_SUCCESS; - } - } - if (OB_SUCC(ret)) { - if (version <= cur_version) { - // avoid set smaller version when refresh config_version_map_ in refresh_config_version_map() - } else if (OB_FAIL(config_version_map_.set_refactored(ObTenantID(tenant_id), version, 1))) { - LOG_WARN("set tenant config version fail", K(tenant_id), K(version), K(ret)); - } - } - return ret; -} - -int64_t ObTenantConfigMgr::get_tenant_config_version(uint64_t tenant_id) -{ - int64_t version = ObSystemConfig::INIT_VERSION; - int ret = OB_SUCCESS; - DRWLock::RDLockGuard guard(rwlock_); - if (OB_FAIL(config_version_map_.get_refactored(ObTenantID(tenant_id), version))) { - if (OB_HASH_NOT_EXIST != ret) { - LOG_WARN("get tenant config version fail", K(tenant_id), K(ret)); - } - } - return version; -} - -// 由 RS 调用 -int ObTenantConfigMgr::get_lease_response(share::ObLeaseResponse &lease_response) -{ - int ret = OB_SUCCESS; - std::pair pair; - lease_response.tenant_config_version_.reset(); - lease_response.tenant_config_version_.reserve(config_version_map_.size()); - DRWLock::RDLockGuard guard(rwlock_); - TenantConfigVersionMap::const_iterator it = config_version_map_.begin(); - for (; it != config_version_map_.end() && OB_SUCC(ret); ++it) { - pair.first = it->first.tenant_id_; - pair.second = it->second; - if (OB_FAIL(lease_response.tenant_config_version_.push_back(pair))) { - LOG_WARN("push back tenant config fail", - "tenant_id", pair.first, "version", pair.second, K(ret)); - } else { - LOG_DEBUG("push back tenant config response succ", - "tenant", pair.first, "version", pair.second); - } - } - if (OB_FAIL(ret)) { - // 和 obs 端约定,如果 lease_response 中没有返回任何 config version,则 obs 什么都不做 - lease_response.tenant_config_version_.reset(); - } else if (0 == config_version_map_.size()) { - ret = OB_ENTRY_NOT_EXIST; - if (REACH_TIME_INTERVAL(10 * 1000L * 1000L)) { - LOG_INFO("config version map size is 0, try get lease later"); - } - } - return ret; -} - -// 由各个 observer 调用 -void ObTenantConfigMgr::get_lease_request(share::ObLeaseRequest &lease_request) -{ - int ret = OB_SUCCESS; - DRWLock::RDLockGuard guard(rwlock_); - std::pair pair; - TenantConfigMap::const_iterator it = config_map_.begin(); - for (; it != config_map_.end(); ++it) { - if (OB_NOT_NULL(it->second)) { - pair.first = it->first.tenant_id_; - pair.second = it->second->get_current_version(); - if (OB_FAIL(lease_request.tenant_config_version_.push_back(pair))) { - LOG_WARN("push back tenant config fail", K(ret)); - } - } - } // for -} - -// for __all_virtual_tenant_parameter_info -int ObTenantConfigMgr::get_all_tenant_config_info( - common::ObArray &all_config, - common::ObIAllocator *allocator) -{ - int ret = OB_SUCCESS; - DRWLock::RDLockGuard guard(rwlock_); - TenantConfigMap::const_iterator it = config_map_.begin(); - for (; OB_SUCC(ret) && it != config_map_.end(); ++it) { - const uint64_t tenant_id = it->first.tenant_id_; - ObTenantConfig *tenant_config = it->second; - for (ObConfigContainer::const_iterator iter = tenant_config->get_container().begin(); - iter != tenant_config->get_container().end(); iter++) { - TenantConfigInfo config_info(tenant_id); - if (0 == ObString("compatible").case_compare(iter->first.str())) { - uint64_t data_version = 0; - char *dv_buf = NULL; - if (GET_MIN_DATA_VERSION(tenant_id, data_version) != OB_SUCCESS) { - if (OB_FAIL(config_info.set_value("0.0.0.0"))) { - LOG_WARN("set value fail", K(ret), K(tenant_id)); - } - } else if (OB_ISNULL(dv_buf = (char *)allocator->alloc(OB_SERVER_VERSION_LENGTH))) { - ret = OB_ALLOCATE_MEMORY_FAILED; - LOG_ERROR("fail to alloc buf", K(ret), K(tenant_id), K(OB_SERVER_VERSION_LENGTH)); - } else if (OB_INVALID_INDEX == - VersionUtil::print_version_str( - dv_buf, OB_SERVER_VERSION_LENGTH, data_version)) { - ret = OB_INVALID_ARGUMENT; - LOG_ERROR("fail to print data_version", K(ret), K(tenant_id), KDV(data_version)); - } else { - if (OB_FAIL(config_info.set_value(dv_buf))) { - LOG_WARN("set value fail", K(ret), K(tenant_id), K(data_version), K(dv_buf)); - } - } - } else { - if (OB_FAIL(config_info.set_value(iter->second->str()))) { - LOG_WARN("set value fail", K(iter->second->str()), K(ret)); - } - } - if (FAILEDx(config_info.set_name(iter->first.str()))) { - LOG_WARN("set name fail", K(iter->first.str()), K(ret)); - } else if (OB_FAIL(config_info.set_data_type(iter->second->data_type()))) { - LOG_WARN("set data_type fail", K(iter->second->data_type()), K(ret)); - } else if (OB_FAIL(config_info.set_info(iter->second->info()))) { - LOG_WARN("set info fail", K(iter->second->info()), K(ret)); - } else if (OB_FAIL(config_info.set_section(iter->second->section()))) { - LOG_WARN("set section fail", K(iter->second->section()), K(ret)); - } else if (OB_FAIL(config_info.set_scope(iter->second->scope()))) { - LOG_WARN("set scope fail", K(iter->second->scope()), K(ret)); - } else if (OB_FAIL(config_info.set_source(iter->second->source()))) { - LOG_WARN("set source fail", K(iter->second->source()), K(ret)); - } else if (OB_FAIL(config_info.set_edit_level(iter->second->edit_level()))) { - LOG_WARN("set edit_level fail", K(iter->second->edit_level()), K(ret)); - } else if (OB_FAIL(all_config.push_back(config_info))) { - LOG_WARN("push to array fail", K(config_info), K(ret)); - } - } // for - } // for - return ret; -} - -int ObTenantConfigMgr::got_versions(const common::ObIArray> &versions) -{ - int ret = OB_SUCCESS; - DRWLock::RDLockGuard guard(rwlock_); - for (int i = 0; i < versions.count(); ++i) { - uint64_t tenant_id = versions.at(i).first; - int64_t version = versions.at(i).second; - if (OB_FAIL(got_version(tenant_id, version))) { - LOG_WARN("fail got version", K(tenant_id), K(version), K(ret)); - } - } - return ret; -} - -int ObTenantConfigMgr::got_version(uint64_t tenant_id, int64_t version, const bool remove_repeat/* = true */) -{ - int ret = OB_SUCCESS; - DRWLock::RDLockGuard guard(rwlock_); - ObTenantConfig *config = nullptr; - if (OB_FAIL(config_map_.get_refactored(ObTenantID(tenant_id), config))) { - LOG_WARN("No tenant config found", K(tenant_id), K(ret)); - } else { - ret = config->got_version(version, remove_repeat); - } - return ret; -} - -int ObTenantConfigMgr::update_local(uint64_t tenant_id, int64_t expected_version) -{ - int ret = OB_SUCCESS; - if (OB_ISNULL(sql_proxy_)) { - ret = OB_NOT_INIT; - LOG_WARN("sql proxy is null", K(ret)); - } else { - uint64_t exec_tenant_id = gen_meta_tenant_id(tenant_id); - ObTenantConfig *config = nullptr; - ObSQLClientRetryWeak sql_client_retry_weak(sql_proxy_); - ObSqlString sql; - SMART_VAR(ObMySQLProxy::MySQLResult, result) { - if (OB_FAIL(sql.assign_fmt( - "select config_version, zone, svr_type, svr_ip, svr_port, name, " - "data_type, value, info, section, scope, source, edit_level " - "from %s where tenant_id = '%lu'", OB_TENANT_PARAMETER_TNAME, tenant_id))) { - } else if (OB_FAIL(sql_client_retry_weak.read(result, exec_tenant_id, sql.ptr()))) { - LOG_WARN("read config from __tenant_parameter failed", - KR(ret), K(tenant_id), K(exec_tenant_id), K(sql)); - } else { - DRWLock::WRLockGuard guard(rwlock_); - ret = config_map_.get_refactored(ObTenantID(tenant_id), config); - if (OB_FAIL(ret)) { - LOG_ERROR("failed to get tenant config", K(tenant_id), K(ret)); - } else { - ret = config->update_local(expected_version, result); - } - } - } - } - return ret; -} - -void ObTenantConfigMgr::notify_tenant_config_changed(uint64_t tenant_id) -{ - update_tenant_config_cb_(tenant_id); -} - -int ObTenantConfigMgr::add_config_to_existing_tenant(const char *config_str) -{ - int ret = OB_SUCCESS; - DRWLock::WRLockGuard guard(rwlock_); - if (!config_map_.empty() && nullptr != config_str) { - TenantConfigMap::const_iterator it = config_map_.begin(); - for (; it != config_map_.end() && OB_SUCC(ret); ++it) { - if (OB_NOT_NULL(it->second)) { - int64_t version = ObTimeUtility::current_time(); - if (OB_FAIL(it->second->add_extra_config_unsafe(config_str, version))) { - LOG_WARN("add tenant extra config failed", "tenant_id", it->second->get_tenant_id(), - "config_str", config_str, KR(ret)); - } else if (OB_FAIL(dump2file_unsafe())) { - LOG_WARN("fail to dump config to file", KR(ret), K(config_str)); - } else if (OB_FAIL(it->second->publish_special_config_after_dump())) { - LOG_WARN("fail to publish config after dump", KR(ret), K(config_str)); - } - } - } - } - return ret; -} - -int ObTenantConfigMgr::add_extra_config(const obrpc::ObTenantConfigArg &arg) -{ - int ret = OB_SUCCESS; - ObTenantConfig *config = nullptr; - if (!arg.is_valid()) { - ret = OB_INVALID_ARGUMENT; - LOG_ERROR("invalid arg", K(ret), K(arg)); - } else { - DRWLock::WRLockGuard guard(rwlock_); - if (OB_FAIL(config_map_.get_refactored(ObTenantID(arg.tenant_id_), config))) { - LOG_ERROR("failed to get tenant config", K(arg.tenant_id_), K(ret)); - } else { - ret = config->add_extra_config_unsafe(arg.config_str_.ptr()); - } - } - FLOG_INFO("add tenant extra config", K(arg)); - return ret; -} - -int ObTenantConfigMgr::schedule(ObTenantConfig::TenantConfigUpdateTask &task, const int64_t delay) -{ - int ret = OB_SUCCESS; - bool repeat = false; - if (OB_FAIL(TG_SCHEDULE(lib::TGDefIDs::CONFIG_MGR, task, delay, repeat))) { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("schedule task failed", K(ret)); - } - return ret; -} - -int ObTenantConfigMgr::cancel(const ObTenantConfig::TenantConfigUpdateTask &task) -{ - int ret = OB_SUCCESS; - bool exist = false; - if (OB_FAIL(TG_CANCEL_R(lib::TGDefIDs::CONFIG_MGR, task))) { - LOG_WARN("cancel tenant config update task failed", K(ret)); - } - return ret; -} - -int ObTenantConfigMgr::wait(const ObTenantConfig::TenantConfigUpdateTask &task, const int64_t abs_timeout_us) -{ - int ret = OB_EAGAIN; - const int try_times = 30; - const int64_t period = 10000; - ret = OB_EAGAIN; - bool has_timeout = false; - for (int i = 0; i < try_times && !has_timeout; ++i) { - if (ATOMIC_LOAD(&task.running_task_count_) > 0) { - // wait running task finish - } else { - ret = OB_SUCCESS; - break; - } - if (ObTimeUtility::current_time() >= abs_timeout_us) { - has_timeout = true; - } - ob_usleep(period); - } // for - if (OB_EAGAIN == ret) { - LOG_WARN("wait running update task failed, try later", K(ret), K(ATOMIC_LOAD(&task.running_task_count_)), K(abs_timeout_us)); - } - return ret; -} - -OB_DEF_SERIALIZE(ObTenantConfigMgr) -{ - int ret = OB_SUCCESS; - int64_t expect_data_len = get_serialize_size_(); - int64_t saved_pos = pos; - TenantConfigMap::const_iterator it = config_map_.begin(); - for (; OB_SUCC(ret) && it != config_map_.end(); ++it) { - if (OB_ISNULL(it->second)) { - ret = OB_ERR_UNEXPECTED; - } else { - ret = it->second->serialize(buf, buf_len, pos); - } - } // for - if (OB_SUCC(ret)) { - int64_t writen_len = pos - saved_pos; - if (writen_len != expect_data_len) { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("unexpected data size", K(writen_len), K(expect_data_len)); - } - } - return ret; -} - -OB_DEF_DESERIALIZE(ObTenantConfigMgr) -{ - int ret = OB_SUCCESS; - if (data_len == 0 || pos >= data_len) { - } else { - while(OB_SUCC(ret) && pos < data_len) { - int64_t saved_pos = pos; - int64_t ignore_version = 0, ignore_len = 0; - OB_UNIS_DECODE(ignore_version); - OB_UNIS_DECODE(ignore_len); - if (OB_FAIL(ret)) { - } else if ('[' != *(buf + pos)) { - ret = OB_INVALID_DATA; - LOG_ERROR("invalid tenant config", K(ret)); - } else { - int64_t cur = pos + 1; - while (cur < data_len - 1 && ']' != *(buf + cur)) { - ++cur; - } // while - if (cur >= data_len - 1 || '\n' != *(buf + cur + 1)) { - ret = OB_INVALID_DATA; - LOG_ERROR("invalid tenant config", K(ret)); - } else { - uint64_t tenant_id = OB_INVALID_TENANT_ID; - char tenant_str[100]; - char *p_end = nullptr; - MEMSET(tenant_str, '\0', 100); - if (cur - pos - 1 < 100) { - MEMCPY(tenant_str, buf + pos + 1, cur - pos - 1); - tenant_id = strtoul(tenant_str, &p_end, 0); - } else { - ret = OB_INVALID_DATA; - LOG_ERROR("invalid tenant id", K(ret)); - break; - } - if ('\0' != *p_end) { - ret = OB_INVALID_CONFIG; - LOG_ERROR("invalid tenant id", K(ret)); - } else { - pos = cur + 2; - ObTenantConfig *config = nullptr; - if (OB_FAIL(config_map_.get_refactored(ObTenantID(tenant_id), config))) { - if (ret != OB_HASH_NOT_EXIST || OB_FAIL(add_tenant_config(tenant_id))) { - LOG_ERROR("get tenant config failed", K(tenant_id), K(ret)); - break; - } - ret = config_map_.get_refactored(ObTenantID(tenant_id), config); - } - if (OB_SUCC(ret)) { - pos = saved_pos; - ret = config->deserialize(buf, data_len, pos); - } - } - } - } // else - } // while - } - return ret; -} - -OB_DEF_SERIALIZE_SIZE(ObTenantConfigMgr) -{ - int64_t len = 0; - TenantConfigMap::const_iterator it = config_map_.begin(); - for (; it != config_map_.end(); ++it) { - if (OB_NOT_NULL(it->second)) { - len += it->second->get_serialize_size(); - } - } // for - return len; -} } // omt } // oceanbase diff --git a/src/observer/omt/ob_tenant_config_mgr.h b/src/observer/omt/ob_tenant_config_mgr.h index 4258ebdb6..cbbc81599 100644 --- a/src/observer/omt/ob_tenant_config_mgr.h +++ b/src/observer/omt/ob_tenant_config_mgr.h @@ -1,20 +1,23 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_TENANT_CONFIG_MGR_H_ #define OCEANBASE_TENANT_CONFIG_MGR_H_ #include "lib/function/ob_function.h" -#include "observer/omt/ob_tenant_config.h" #include "lib/hash/ob_hashmap.h" #include "lib/string/ob_sql_string.h" #include "lib/container/ob_array.h" @@ -36,170 +39,26 @@ namespace omt { class ObTenantConfigGuard { public: ObTenantConfigGuard(); - ObTenantConfigGuard(ObTenantConfig *config); + ObTenantConfigGuard(ObServerConfig *config); virtual ~ObTenantConfigGuard(); ObTenantConfigGuard(const ObTenantConfigGuard &guard) = delete; ObTenantConfigGuard & operator=(const ObTenantConfigGuard &guard) = delete; - void set_config(ObTenantConfig *config); + void set_config(ObServerConfig *config); bool is_valid() { return nullptr != config_; } /* * Requires: check is_valid(). */ - ObTenantConfig *operator->() { return config_; } - void trace_all_config() const; + ObServerConfig *operator->() { return config_; } private: - ObTenantConfig *config_; -}; - -struct TenantConfigInfo { - using ConfigString = common::ObSqlString; - - TenantConfigInfo() : TenantConfigInfo(common::OB_INVALID_TENANT_ID) {} - TenantConfigInfo(uint64_t tenant_id) : tenant_id_(tenant_id), - name_(), data_type_(), value_(), info_(), section_(), - scope_(), source_(), edit_level_() {} - virtual ~TenantConfigInfo() {} - void set_tenant_id(uint64_t tenant_id) { tenant_id_ = tenant_id; } - int set_name(const char *name) { return name_.assign(name); } - int set_data_type(const char *data_type) { return data_type_.assign(data_type); } - int set_value(const char *value) { return value_.assign(value); } - int set_info(const char *info) { return info_.assign(info); } - int set_section(const char *section) { return section_.assign(section); } - int set_scope(const char *scope) { return scope_.assign(scope); } - int set_source(const char *source) { return source_.assign(source); } - int set_edit_level(const char *edit_level) { return edit_level_.assign(edit_level); } - int assign(const TenantConfigInfo &rhs); - int64_t to_string(char *buf, const int64_t buf_len) const; - - uint64_t tenant_id_; - ConfigString name_; - ConfigString data_type_; - ConfigString value_; - ConfigString info_; - ConfigString section_; - ConfigString scope_; - ConfigString source_; - ConfigString edit_level_; -}; - -struct ObTenantID { - ObTenantID() : tenant_id_(common::OB_INVALID_TENANT_ID) {} - ObTenantID(uint64_t tenant_id) : tenant_id_(tenant_id) {} - bool operator == (const ObTenantID &other) const - { - return tenant_id_ == other.tenant_id_; - } - uint64_t hash() const { return tenant_id_; } - int hash(uint64_t &hash_val) const { hash_val = hash(); return OB_SUCCESS; } - uint64_t tenant_id_; + ObServerConfig *config_; }; -using TenantConfigMap = common::__ObConfigContainer; -using TenantConfigVersionMap = common::hash::ObHashMap; - -using SuccessFunctor = std::function; -using FailureFunctor = std::function; -using UpdateTenantConfigCb = common::ObFunction; - -class ObTenantConfigMgr -{ - friend class ObTenantConfig; -public: - static ObTenantConfigMgr &get_instance(); - virtual ~ObTenantConfigMgr(); - ObTenantConfigMgr(const ObTenantConfigMgr &config) = delete; - ObTenantConfigMgr & operator=(const ObTenantConfigMgr &) = delete; - - int init(common::ObMySQLProxy &sql_proxy, - const common::ObAddr &server, - common::ObConfigManager *config_mgr, - const UpdateTenantConfigCb &update_tenant_config_cb); - int refresh_tenants(const common::ObIArray &tenants); - int add_tenant_config(uint64_t tenant_id); - int del_tenant_config(uint64_t tenant_id, const int64_t abs_timeout_us); - int init_tenant_config(const obrpc::ObTenantConfigArg &arg); - ObTenantConfig *get_tenant_config(uint64_t tenant_id) const; - // lock to guarantee this will not be deleted by calling del_tenant_config. - // Fallback to get tenant config of %fallback_tenant_id if %tenant_id config not exist. - // NOTICE: remember to unlock - ObTenantConfig *get_tenant_config_with_lock( - const uint64_t tenant_id, - const uint64_t fallback_tenant_id = 0, - const uint64_t timeout_us = 0) const; - int read_tenant_config( - const uint64_t tenant_id, - const uint64_t fallback_tenant_id, - const SuccessFunctor &on_success, - const FailureFunctor &on_failure) const; - int64_t get_tenant_newest_version(uint64_t tenant_id) const; - int64_t get_tenant_current_version(uint64_t tenant_id) const; +#define TENANT_CONF(tenant_id) &GCONF +#define TENANT_CONF_TIL(tenant_id) &GCONF - void refresh_config_version_map(const common::ObIArray &tenants); - void reset_version_has_refreshed() { version_has_refreshed_ = false; } - int set_tenant_config_version(uint64_t tenant_id, int64_t version); - int64_t get_tenant_config_version(uint64_t tenant_id); - void get_lease_request(share::ObLeaseRequest &lease_request); - int get_lease_response(share::ObLeaseResponse &lease_response); - int get_all_tenant_config_info(common::ObArray &config_info, - common::ObIAllocator *allocator); - int got_versions(const common::ObIArray > &versions); - int got_version(uint64_t tenant_id, int64_t version, const bool remove_repeat = true); - int update_local(uint64_t tenant_id, int64_t expected_version); - void notify_tenant_config_changed(uint64_t tenatn_id); - int add_config_to_existing_tenant(const char *config_str); - int add_extra_config(const obrpc::ObTenantConfigArg &arg); - int schedule(ObTenantConfig::TenantConfigUpdateTask &task, const int64_t delay); - int cancel(const ObTenantConfig::TenantConfigUpdateTask &task); - int wait(const ObTenantConfig::TenantConfigUpdateTask &task, const int64_t abs_timeout_us); - bool inited() { return inited_; } - - static uint64_t default_fallback_tenant_id() - { - const auto tenant = CURRENT_ENTITY(TENANT_SPACE)->get_tenant();; - uint64_t id = 0; - if (NULL == tenant || 0 == tenant->id() || common::OB_INVALID_ID == tenant->id()) { - // for background thread, fallback to sys tenant - id = common::OB_SYS_TENANT_ID; - } else { - id = tenant->id(); - } - return id; - } - // protect config_map_ - mutable common::DRWLock rwlock_; - OB_UNIS_VERSION(1); - -private: - static const int64_t RECYCLE_LATENCY = 30L * 60L * 1000L * 1000L; - ObTenantConfigMgr(); - // whitout lock, only used inner - int dump2file_unsafe(); - bool inited_; - common::ObAddr self_; - common::ObMySQLProxy *sql_proxy_; - // 租户配置项的映射 - TenantConfigMap config_map_; - TenantConfigVersionMap config_version_map_; - common::ObConfigManager *sys_config_mgr_; - bool version_has_refreshed_; - UpdateTenantConfigCb update_tenant_config_cb_; - // reload cb - -}; - -} // omt -} // oceanbase - -#define OTC_MGR (::oceanbase::omt::ObTenantConfigMgr::get_instance()) -/* - * use ObTenantConfigGuard to unlock automatically, otherwise remember to unlock: - * ObTenantConfigGuard tenant_config(TENANT_CONF(tenant_id)); - */ -#define TENANT_CONF_TIL(tenant_id, timeout_us) (OTC_MGR.get_tenant_config_with_lock( \ - tenant_id, oceanbase::omt::ObTenantConfigMgr::default_fallback_tenant_id(), timeout_us)) +} +} -#define TENANT_CONF(tenant_id) (OTC_MGR.get_tenant_config_with_lock( \ - tenant_id, oceanbase::omt::ObTenantConfigMgr::default_fallback_tenant_id(), 0)) #endif diff --git a/src/observer/omt/ob_tenant_meta.cpp b/src/observer/omt/ob_tenant_meta.cpp index ebd368c1d..9796e2104 100644 --- a/src/observer/omt/ob_tenant_meta.cpp +++ b/src/observer/omt/ob_tenant_meta.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER_OMT diff --git a/src/observer/omt/ob_tenant_meta.h b/src/observer/omt/ob_tenant_meta.h index d4ec1664d..9c398faaf 100644 --- a/src/observer/omt/ob_tenant_meta.h +++ b/src/observer/omt/ob_tenant_meta.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_OMT_TENANT_META_H_ diff --git a/src/observer/omt/ob_tenant_mtl_helper.h b/src/observer/omt/ob_tenant_mtl_helper.h index de8ed2874..bb81bcdc6 100644 --- a/src/observer/omt/ob_tenant_mtl_helper.h +++ b/src/observer/omt/ob_tenant_mtl_helper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SHARE_OB_TENANT_MTL_HELPER_H_ diff --git a/src/observer/omt/ob_tenant_node_balancer.cpp b/src/observer/omt/ob_tenant_node_balancer.cpp index 5d7022e49..d3e30d1ee 100644 --- a/src/observer/omt/ob_tenant_node_balancer.cpp +++ b/src/observer/omt/ob_tenant_node_balancer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER_OMT @@ -102,8 +106,8 @@ void ObTenantNodeBalancer::handle() ret = OB_NEED_RETRY; } else if (OB_FAIL(unit_getter_.get_tenants(tenants))) { LOG_WARN("get cluster tenants fail", K(ret)); - } else if (OB_FAIL(OTC_MGR.refresh_tenants(tenants))) { - LOG_WARN("fail refresh tenant config", K(tenants), K(ret)); + } else if (OB_FAIL(ODV_MGR.set(OB_SYS_TENANT_ID, GCONF.compatible))) { + LOG_WARN("set sys tenant data version failed", K(ret)); } if (OB_SUCCESS != (tmp_ret = GCTX.log_block_mgr_->try_resize())) { LOG_WARN("ObServerLogBlockMgr try_resize failed", K(tmp_ret)); @@ -184,10 +188,9 @@ int ObTenantNodeBalancer::notify_create_tenant(const obrpc::TenantServerUnitConf return ret; } - -// 标记删除,而不是直接删,是因为并发时,另一个线程可能刷到tenant了,但是还没有refresh tenant, -// 此时drop tenant将tenant删除了,另一个线程过一会refresh tenant时,又给加回来了 -// 所以这里只做标记,删除tenant统一在refresh tenant里做 +// Mark as deleted rather than directly deleting, because during concurrency, another thread might have fetched the tenant but has not yet refreshed the tenant, +// At this point, drop tenant will delete the tenant, and another thread will add it back when it refreshes the tenant a while later +// So here we only make a mark, the deletion of tenant is uniformly done in refresh tenant int ObTenantNodeBalancer::try_notify_drop_tenant(const int64_t tenant_id) { LOG_INFO("[DELETE_TENANT] succ to receive notify of dropping tenant", K(tenant_id)); @@ -228,6 +231,14 @@ int ObTenantNodeBalancer::get_server_allocated_resource(ServerResource &server_r return ret; } +int64_t ObTenantNodeBalancer::get_refresh_interval() { + if (!omt_->has_synced()) { + return BOOTSTRAP_REFRESH_INTERVAL; + } else { + return refresh_interval_; + } +} + int ObTenantNodeBalancer::check_del_tenants(const TenantUnits &local_units, TenantUnits &units) { int ret = OB_SUCCESS; diff --git a/src/observer/omt/ob_tenant_node_balancer.h b/src/observer/omt/ob_tenant_node_balancer.h index 8e8cc4e4e..a7b1f1a34 100644 --- a/src/observer/omt/ob_tenant_node_balancer.h +++ b/src/observer/omt/ob_tenant_node_balancer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_OBSERVER_OMT_OB_TENANT_NODE_BALANCER_H_ @@ -71,7 +75,7 @@ class ObTenantNodeBalancer bool is_inited() { return is_inited_; } - int64_t get_refresh_interval() { return refresh_interval_; } + int64_t get_refresh_interval(); private: static const int64_t RECYCLE_LATENCY = 180L * 1000L * 1000L; @@ -90,6 +94,7 @@ class ObTenantNodeBalancer DISALLOW_COPY_AND_ASSIGN(ObTenantNodeBalancer); private: + const int64_t BOOTSTRAP_REFRESH_INTERVAL = 100L * 1000L; ObMultiTenant *omt_; common::ObAddr myaddr_; bool is_inited_; diff --git a/src/observer/omt/ob_tenant_srs.cpp b/src/observer/omt/ob_tenant_srs.cpp index c97ed7093..132307113 100644 --- a/src/observer/omt/ob_tenant_srs.cpp +++ b/src/observer/omt/ob_tenant_srs.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER_OMT diff --git a/src/observer/omt/ob_tenant_srs.h b/src/observer/omt/ob_tenant_srs.h index 9345365fc..6254e1822 100644 --- a/src/observer/omt/ob_tenant_srs.h +++ b/src/observer/omt/ob_tenant_srs.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_TENANT_SRS_H_ diff --git a/src/observer/omt/ob_tenant_timezone.cpp b/src/observer/omt/ob_tenant_timezone.cpp index f7407b1f6..feee148ad 100644 --- a/src/observer/omt/ob_tenant_timezone.cpp +++ b/src/observer/omt/ob_tenant_timezone.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER_OMT diff --git a/src/observer/omt/ob_tenant_timezone.h b/src/observer/omt/ob_tenant_timezone.h index 8e0dc8dfa..f731780e2 100644 --- a/src/observer/omt/ob_tenant_timezone.h +++ b/src/observer/omt/ob_tenant_timezone.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_TENANT_TIMEZONE_H_ diff --git a/src/observer/omt/ob_tenant_timezone_mgr.cpp b/src/observer/omt/ob_tenant_timezone_mgr.cpp index 1826d882d..22cc3f6a1 100644 --- a/src/observer/omt/ob_tenant_timezone_mgr.cpp +++ b/src/observer/omt/ob_tenant_timezone_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER_OMT diff --git a/src/observer/omt/ob_tenant_timezone_mgr.h b/src/observer/omt/ob_tenant_timezone_mgr.h index 8f81fe6c9..cac7d5773 100644 --- a/src/observer/omt/ob_tenant_timezone_mgr.h +++ b/src/observer/omt/ob_tenant_timezone_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_TENANT_TIMEZONE_MGR_H_ diff --git a/src/observer/omt/ob_th_worker.cpp b/src/observer/omt/ob_th_worker.cpp index 784c77333..7a4b12bbe 100644 --- a/src/observer/omt/ob_th_worker.cpp +++ b/src/observer/omt/ob_th_worker.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER_OMT diff --git a/src/observer/omt/ob_th_worker.h b/src/observer/omt/ob_th_worker.h index 9b05bc15d..63ffb63f3 100644 --- a/src/observer/omt/ob_th_worker.h +++ b/src/observer/omt/ob_th_worker.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_OBSERVER_OMT_OB_TH_WORKER_H_ diff --git a/src/observer/omt/ob_worker_processor.cpp b/src/observer/omt/ob_worker_processor.cpp index fc2ac610a..7856e0027 100644 --- a/src/observer/omt/ob_worker_processor.cpp +++ b/src/observer/omt/ob_worker_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER_OMT diff --git a/src/observer/omt/ob_worker_processor.h b/src/observer/omt/ob_worker_processor.h index 1a2577211..d8ec824e6 100644 --- a/src/observer/omt/ob_worker_processor.h +++ b/src/observer/omt/ob_worker_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_OBSERVER_OMT_OB_WORKER_PROCESSOR_H_ diff --git a/src/observer/report/ob_i_disk_report.h b/src/observer/report/ob_i_disk_report.h index 64371f348..e920569d6 100644 --- a/src/observer/report/ob_i_disk_report.h +++ b/src/observer/report/ob_i_disk_report.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_I_DISK_REPORT @@ -32,4 +36,4 @@ class ObIDiskReport } } -#endif \ No newline at end of file +#endif diff --git a/src/observer/report/ob_i_meta_report.h b/src/observer/report/ob_i_meta_report.h index 28c7a9263..8adfc826d 100644 --- a/src/observer/report/ob_i_meta_report.h +++ b/src/observer/report/ob_i_meta_report.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_I_META_REPORT @@ -37,4 +41,4 @@ class ObIMetaReport } // end namespace observer } // end namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/src/observer/report/ob_ls_table_updater.cpp b/src/observer/report/ob_ls_table_updater.cpp index 3309896b5..d95f4ddcf 100644 --- a/src/observer/report/ob_ls_table_updater.cpp +++ b/src/observer/report/ob_ls_table_updater.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/report/ob_ls_table_updater.h b/src/observer/report/ob_ls_table_updater.h index 828828b4a..411a6bb52 100644 --- a/src/observer/report/ob_ls_table_updater.h +++ b/src/observer/report/ob_ls_table_updater.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_LS_TABLE_UPDATER diff --git a/src/observer/report/ob_server_meta_table_checker.cpp b/src/observer/report/ob_server_meta_table_checker.cpp index b01d13f54..15279c718 100644 --- a/src/observer/report/ob_server_meta_table_checker.cpp +++ b/src/observer/report/ob_server_meta_table_checker.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/report/ob_server_meta_table_checker.h b/src/observer/report/ob_server_meta_table_checker.h index 7122222b6..590bca686 100644 --- a/src/observer/report/ob_server_meta_table_checker.h +++ b/src/observer/report/ob_server_meta_table_checker.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_SERVER_META_TABLE_CHECKER @@ -106,4 +110,4 @@ class ObServerMetaTableChecker } // end namespace observer } // end namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/src/observer/report/ob_tablet_table_updater.cpp b/src/observer/report/ob_tablet_table_updater.cpp index ba755ac07..3cab5d143 100644 --- a/src/observer/report/ob_tablet_table_updater.cpp +++ b/src/observer/report/ob_tablet_table_updater.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -937,5 +941,14 @@ int ObTabletTableUpdater::throttle_( return ret; } +int64_t ObTabletTableUpdateTaskQueue::task_count() const +{ + if (GCTX.in_bootstrap_) { + return 0; + } else { + return ObUniqTaskQueue::task_count(); + } +} + } // end namespace observer } // end namespace oceanbase diff --git a/src/observer/report/ob_tablet_table_updater.h b/src/observer/report/ob_tablet_table_updater.h index 9f20c36b5..a35c696a6 100644 --- a/src/observer/report/ob_tablet_table_updater.h +++ b/src/observer/report/ob_tablet_table_updater.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLET_TABLE_UPDATER_H_ @@ -125,8 +129,15 @@ class ObTabletTableUpdateTask : public ObIUniqTaskQueueTask ObTabletTableUpdateTaskQueue; -typedef ObUniqTaskQueue ObTabletTableRemoveTaskQueue; +class ObTabletTableUpdateTaskQueue : public ObUniqTaskQueue +{ +public: + ObTabletTableUpdateTaskQueue() : ObUniqTaskQueue() {} + virtual ~ObTabletTableUpdateTaskQueue() {} + virtual int64_t task_count() const override; +}; + +typedef ObTabletTableUpdateTaskQueue ObTabletTableRemoveTaskQueue; typedef ObArray UpdateTaskList; typedef ObArray RemoveTaskList; diff --git a/src/observer/report/ob_tenant_meta_checker.cpp b/src/observer/report/ob_tenant_meta_checker.cpp index b224c4ca0..8c4de3550 100644 --- a/src/observer/report/ob_tenant_meta_checker.cpp +++ b/src/observer/report/ob_tenant_meta_checker.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/report/ob_tenant_meta_checker.h b/src/observer/report/ob_tenant_meta_checker.h index 14a80ac0d..3b4c0791e 100644 --- a/src/observer/report/ob_tenant_meta_checker.h +++ b/src/observer/report/ob_tenant_meta_checker.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TENANT_META_TABLE_CHECKER diff --git a/src/observer/table/adapters/ob_hbase_adapter_factory.cpp b/src/observer/table/adapters/ob_hbase_adapter_factory.cpp index 9b46d3b17..53dcd49c9 100644 --- a/src/observer/table/adapters/ob_hbase_adapter_factory.cpp +++ b/src/observer/table/adapters/ob_hbase_adapter_factory.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ @@ -38,4 +42,4 @@ int ObHbaseAdapterGuard::get_hbase_adapter(ObIHbaseAdapter *&hbase_adapter) return ret; } } // end of namespace table -} // end of namespace oceanbase \ No newline at end of file +} // end of namespace oceanbase diff --git a/src/observer/table/adapters/ob_hbase_adapter_factory.h b/src/observer/table/adapters/ob_hbase_adapter_factory.h index 57e09c921..abef0804d 100644 --- a/src/observer/table/adapters/ob_hbase_adapter_factory.h +++ b/src/observer/table/adapters/ob_hbase_adapter_factory.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_HBASE_ADAPTER_FACTORY_H diff --git a/src/observer/table/adapters/ob_hbase_cell_iter.cpp b/src/observer/table/adapters/ob_hbase_cell_iter.cpp index 6027acfa6..1a3be33a8 100644 --- a/src/observer/table/adapters/ob_hbase_cell_iter.cpp +++ b/src/observer/table/adapters/ob_hbase_cell_iter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/adapters/ob_hbase_cell_iter.h b/src/observer/table/adapters/ob_hbase_cell_iter.h index c041d10b7..cf6479133 100644 --- a/src/observer/table/adapters/ob_hbase_cell_iter.h +++ b/src/observer/table/adapters/ob_hbase_cell_iter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_HBASE_CELL_ITER_H @@ -84,4 +88,4 @@ class ObHbaseCellIter : public ObHbaseICellIter } // end of namespace table } // end of namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/src/observer/table/adapters/ob_hbase_normal_adapter.cpp b/src/observer/table/adapters/ob_hbase_normal_adapter.cpp index b88af5bbd..90f7c87ae 100644 --- a/src/observer/table/adapters/ob_hbase_normal_adapter.cpp +++ b/src/observer/table/adapters/ob_hbase_normal_adapter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -139,4 +143,4 @@ int ObHNormalAdapter::scan(ObIAllocator &alloc, ObTableExecCtx &ctx, const ObTab } } // end of namespace table -} // end of namespace oceanbase \ No newline at end of file +} // end of namespace oceanbase diff --git a/src/observer/table/adapters/ob_hbase_normal_adapter.h b/src/observer/table/adapters/ob_hbase_normal_adapter.h index 64cfdfdac..629f5824e 100644 --- a/src/observer/table/adapters/ob_hbase_normal_adapter.h +++ b/src/observer/table/adapters/ob_hbase_normal_adapter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_HBASE_NORMAL_ADAPTER_H diff --git a/src/observer/table/adapters/ob_hbase_series_adapter.cpp b/src/observer/table/adapters/ob_hbase_series_adapter.cpp index 6ba827a95..faad3f7c1 100644 --- a/src/observer/table/adapters/ob_hbase_series_adapter.cpp +++ b/src/observer/table/adapters/ob_hbase_series_adapter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -57,7 +61,7 @@ int ObHSeriesAdapter::multi_put(ObTableExecCtx &ctx, const ObIArray~ObTableApiSessGuard(); query_ctx_.sess_guard_ = nullptr; - // multi_cf_infos_ 中tb_ctx的sess_guard就来自于query_ctx_ + // The sess_guard of tb_ctx in multi_cf_infos_ comes from query_ctx_ query_ctx_.multi_cf_infos_[0]->tb_ctx_.set_sess_guard(nullptr); } if (OB_NOT_NULL(result_iterator_)) { diff --git a/src/observer/table/common/ob_table_query_session_mgr.cpp b/src/observer/table/common/ob_table_query_session_mgr.cpp index 194f363d5..cc1a8b9bd 100644 --- a/src/observer/table/common/ob_table_query_session_mgr.cpp +++ b/src/observer/table/common/ob_table_query_session_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ @@ -355,4 +359,4 @@ int ObTableQueryASyncMgr::check_query_type(const ObQueryOperationType query_type } // end of namespace table -} // end of namespace oceanbase \ No newline at end of file +} // end of namespace oceanbase diff --git a/src/observer/table/common/ob_table_query_session_mgr.h b/src/observer/table/common/ob_table_query_session_mgr.h index cdfdb6979..eb34d0d90 100644 --- a/src/observer/table/common/ob_table_query_session_mgr.h +++ b/src/observer/table/common/ob_table_query_session_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_QUERY_SESSION_MGR_H @@ -104,4 +108,4 @@ class ObTableQueryASyncMgr : public common::ObTimerTask } // end of namespace table } // end of namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/src/observer/table/common/ob_table_sequential_grouper.cpp b/src/observer/table/common/ob_table_sequential_grouper.cpp index 96d12abdd..561939f11 100644 --- a/src/observer/table/common/ob_table_sequential_grouper.cpp +++ b/src/observer/table/common/ob_table_sequential_grouper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/src/observer/table/common/ob_table_sequential_grouper.h b/src/observer/table/common/ob_table_sequential_grouper.h index 4c7cb159c..04da25e69 100644 --- a/src/observer/table/common/ob_table_sequential_grouper.h +++ b/src/observer/table/common/ob_table_sequential_grouper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_TABLE_SEQUENTIAL_GROUPER_H diff --git a/src/observer/table/fts/ob_table_fts_cg_service.cpp b/src/observer/table/fts/ob_table_fts_cg_service.cpp index 1c4431be9..42f505477 100644 --- a/src/observer/table/fts/ob_table_fts_cg_service.cpp +++ b/src/observer/table/fts/ob_table_fts_cg_service.cpp @@ -1,14 +1,18 @@ -/** -* Copyright (c) 2022 OceanBase -* OceanBase is licensed under Mulan PubL v2. -* You can use this software according to the terms and conditions of the Mulan PubL v2. -* You may obtain a copy of Mulan PubL v2 at: -* http://license.coscl.org.cn/MulanPubL-2.0 -* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -* See the Mulan PubL v2 for more details. -*/ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define USING_LOG_PREFIX SERVER #include "observer/table/ob_table_cg_service.h" @@ -185,7 +189,7 @@ int ObTableFtsExprCgService::generate_text_retrieval_dep_exprs(ObTableCtx &ctx, tr_info->pushdown_match_filter_ = pushdown_match_filter; tr_info->token_column_ = token_column; tr_info->token_cnt_column_ = token_cnt_column; - tr_info->doc_id_column_ = doc_id_column; + tr_info->docid_or_rowkey_column_ = doc_id_column; tr_info->doc_length_column_ = doc_length_column; tr_info->related_doc_cnt_ = related_doc_cnt; tr_info->doc_token_cnt_ = doc_token_cnt; @@ -196,8 +200,41 @@ int ObTableFtsExprCgService::generate_text_retrieval_dep_exprs(ObTableCtx &ctx, return ret; } -int ObTableFtsExprCgService::generate_match_against_exprs(ObTableCtx &ctx, - ObMatchFunRawExpr *&match_expr, +int ObTableFtsExprCgService::generate_topn_related_params(ObTableCtx &ctx, ObTextRetrievalInfo &tr_info) +{ + int ret = OB_SUCCESS; + ObRawExprFactory &expr_factory = ctx.get_expr_factory(); + ObConstRawExpr *limit_expr = nullptr; + ObConstRawExpr *offset_expr = nullptr; + if (OB_FAIL(expr_factory.create_raw_expr(T_INT, limit_expr))) { + LOG_WARN("fail to create raw expr", K(ret)); + } else if (OB_FAIL(expr_factory.create_raw_expr(T_INT, offset_expr))) { + LOG_WARN("fail to create raw expr", K(ret)); + } else if (OB_ISNULL(limit_expr) || OB_ISNULL(offset_expr)) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("expr is NULL", K(ret), KP(limit_expr), KP(offset_expr)); + } else { + ObObj obj; + obj.set_int(ObIntType, -1); + limit_expr->set_value(obj); + obj.set_int(ObIntType, 0); + offset_expr->set_value(obj); + if (OB_FAIL(limit_expr->formalize(&ctx.get_session_info()))) { + LOG_WARN("fail to formalize limit_expr", K(ret)); + } else if (OB_FAIL(offset_expr->formalize(&ctx.get_session_info()))) { + LOG_WARN("fail to formalize limit_expr", K(ret)); + } else { + tr_info.topk_limit_expr_ = limit_expr; + tr_info.topk_offset_expr_ = offset_expr; + tr_info.sort_key_.expr_ = tr_info.match_expr_; + tr_info.sort_key_.order_type_ = default_desc_direction(); + } + } + return ret; +} + +int ObTableFtsExprCgService::generate_match_against_exprs(ObTableCtx &ctx, + ObMatchFunRawExpr *&match_expr, ObRawExpr *&pushdown_match_filter) { int ret = OB_SUCCESS; @@ -274,7 +311,7 @@ int ObTableFtsExprCgService::generate_match_against_exprs(ObTableCtx &ctx, match_expr = match_against; } } - // construct pushdown match filter: + // construct pushdown match filter: // T_OP_BOOL // | // T_FUN_MATCH_AGAINST @@ -311,7 +348,7 @@ int ObTableFtsExprCgService::add_all_text_retrieval_scan_dep_exprs(ObTableCtx &c LOG_WARN("fail to push back token_column", K(ret)); } else if (OB_FAIL(all_exprs.push_back(tr_info->token_cnt_column_))) { LOG_WARN("fail to push back token_cnt_column", K(ret)); - } else if (OB_FAIL(all_exprs.push_back(tr_info->doc_id_column_))) { + } else if (OB_FAIL(all_exprs.push_back(tr_info->docid_or_rowkey_column_))) { LOG_WARN("fail to push back doc_id_column", K(ret)); } else if (OB_FAIL(all_exprs.push_back(tr_info->doc_length_column_))) { LOG_WARN("fail to push back doc_length_column", K(ret)); @@ -368,12 +405,12 @@ int ObTableFtsDmlCgService::generate_rowkey_doc_das_ctdef(ObTableCtx &ctx, ObDAS } } } - + return ret; } -int ObTableFtsDmlCgService::generate_rowkey_doc_ctdef(ObTableCtx &ctx, - ObIAllocator &allocator, +int ObTableFtsDmlCgService::generate_rowkey_doc_ctdef(ObTableCtx &ctx, + ObIAllocator &allocator, ObDASAttachSpec &attach_spec, ObDASScanCtDef *&rowkey_doc_scan_ctdef) { @@ -471,10 +508,11 @@ int ObTableFtsDmlCgService::check_is_main_table_in_fts_ddl(ObTableCtx &ctx, } else if (OB_ISNULL(table_schema)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("table schema is null", K(ret), K(table_schema)); - } else if (!table_schema->is_user_table()) { + } else if (!table_schema->is_user_table() || table_schema->is_fts_index()) { das_dml_ctdef.is_main_table_in_fts_ddl_ = false; - LOG_TRACE("not user table, nothing to do", K(ret), K(table_id)); + LOG_TRACE("neither user table nor fts index, nothing to do", K(ret), K(table_id)); } else { + bool has_fts_index = false; bool is_main_table_in_fts_ddl = false; int64_t fts_index_aux_count = 0; int64_t fts_doc_word_aux_count = 0; @@ -486,6 +524,7 @@ int ObTableFtsDmlCgService::check_is_main_table_in_fts_ddl(ObTableCtx &ctx, ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected error, index schema is nullptr", K(ret), K(i), K(index_info.related_index_ids_)); } else if (index_schema->is_fts_index()) { + has_fts_index = true; if (index_schema->is_fts_index_aux()) { ++fts_index_aux_count; } else if (index_schema->is_fts_doc_word_aux()) { @@ -497,20 +536,22 @@ int ObTableFtsDmlCgService::check_is_main_table_in_fts_ddl(ObTableCtx &ctx, } } if (OB_SUCC(ret)) { - if (is_main_table_in_fts_ddl || fts_index_aux_count != fts_doc_word_aux_count) { + if ((has_fts_index && (0 == fts_index_aux_count || 0 == fts_doc_word_aux_count)) // fts aux index count is 0 + || is_main_table_in_fts_ddl // some fts index is building + || fts_index_aux_count != fts_doc_word_aux_count) { // fts aux index count not match das_dml_ctdef.is_main_table_in_fts_ddl_ = true; } else { das_dml_ctdef.is_main_table_in_fts_ddl_ = false; } } - LOG_TRACE("check is main table in fts ddl", K(ret), K(is_main_table_in_fts_ddl), K(fts_index_aux_count), - K(fts_doc_word_aux_count), K(das_dml_ctdef)); + LOG_TRACE("check is main table in fts ddl", K(ret), K(has_fts_index), K(is_main_table_in_fts_ddl), K(fts_index_aux_count), + K(fts_doc_word_aux_count), K(table_id), K(das_dml_ctdef.is_main_table_in_fts_ddl_), K(index_info.related_index_ids_)); } return ret; } -int ObTableFtsTscCgService::extract_text_ir_access_columns(const ObTableCtx &ctx, - ObDASScanCtDef &scan_ctdef, +int ObTableFtsTscCgService::extract_text_ir_access_columns(const ObTableCtx &ctx, + ObDASScanCtDef &scan_ctdef, ObIArray &access_exprs) { int ret = OB_SUCCESS; uint64_t scan_table_id = scan_ctdef.ref_table_id_; @@ -529,13 +570,13 @@ int ObTableFtsTscCgService::extract_text_ir_access_columns(const ObTableCtx &ctx } else { switch (scan_ctdef.ir_scan_type_) { case ObTSCIRScanType::OB_IR_INV_IDX_SCAN: - if (OB_ISNULL(tr_info->token_cnt_column_) || OB_ISNULL(tr_info->doc_id_column_) || OB_ISNULL(tr_info->doc_length_column_)) { + if (OB_ISNULL(tr_info->token_cnt_column_) || OB_ISNULL(tr_info->docid_or_rowkey_column_) || OB_ISNULL(tr_info->doc_length_column_)) { ret = OB_ERR_UNEXPECTED; - LOG_WARN("inv index expr is NULL", KP(tr_info->token_cnt_column_), KP(tr_info->doc_id_column_), + LOG_WARN("inv index expr is NULL", KP(tr_info->token_cnt_column_), KP(tr_info->docid_or_rowkey_column_), KP(tr_info->doc_length_column_), K(ret)); } else if (OB_FAIL(add_var_to_array_no_dup(access_exprs, static_cast(tr_info->token_cnt_column_)))) { LOG_WARN("failed to push token cnt column to access exprs", K(ret)); - } else if (OB_FAIL(add_var_to_array_no_dup(access_exprs, static_cast(tr_info->doc_id_column_)))) { + } else if (OB_FAIL(add_var_to_array_no_dup(access_exprs, static_cast(tr_info->docid_or_rowkey_column_)))) { LOG_WARN("failed to push document id column to access exprs", K(ret)); } else if (OB_FAIL(add_var_to_array_no_dup(access_exprs, static_cast(tr_info->doc_length_column_)))) { LOG_WARN("failed to add document length column to access exprs", K(ret)); @@ -591,15 +632,15 @@ int ObTableFtsTscCgService::extract_text_ir_das_output_column_ids(const ObTableC LOG_WARN("fail to assgin tsc_out_cols", K(ret), K(scan_ctdef.access_column_ids_)); } } else if (ObTSCIRScanType::OB_IR_INV_IDX_SCAN == scan_ctdef.ir_scan_type_) { - if (OB_ISNULL(tr_info->token_cnt_column_) || OB_ISNULL(tr_info->doc_id_column_) || OB_ISNULL(tr_info->doc_id_column_)) { + if (OB_ISNULL(tr_info->token_cnt_column_) || OB_ISNULL(tr_info->docid_or_rowkey_column_) || OB_ISNULL(tr_info->docid_or_rowkey_column_)) { ret = OB_ERR_UNEXPECTED; - LOG_WARN("tr_info exprs is NULL", K(ret), KP(tr_info->token_cnt_column_), - KP(tr_info->doc_id_column_), KP(tr_info->doc_id_column_)); + LOG_WARN("tr_info exprs is NULL", K(ret), KP(tr_info->token_cnt_column_), + KP(tr_info->docid_or_rowkey_column_), KP(tr_info->docid_or_rowkey_column_)); } else if (OB_FAIL(tsc_out_cols.push_back( static_cast(tr_info->token_cnt_column_)->get_column_id()))) { LOG_WARN("failed to push output token cnt col id", K(ret)); } else if (OB_FAIL(tsc_out_cols.push_back( - static_cast(tr_info->doc_id_column_)->get_column_id()))) { + static_cast(tr_info->docid_or_rowkey_column_)->get_column_id()))) { LOG_WARN("failed to push output doc id col id", K(ret)); } else if (OB_FAIL(tsc_out_cols.push_back( static_cast(tr_info->doc_length_column_)->get_column_id()))) { @@ -632,7 +673,7 @@ int ObTableFtsTscCgService::get_fts_schema(const ObTableCtx &ctx, uint64_t table LOG_WARN("tr_info is NULL", K(ret)); } else if (OB_FAIL(schema_guard->get_table_schema(ctx.get_tenant_id(), table_id, index_schema))) { LOG_WARN("fail to get rowkey doc table schema", K(ret), K(table_id)); - } + } } else { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected table id", K(ret), K(table_id)); @@ -828,14 +869,14 @@ int ObTableFtsTscCgService::generate_text_ir_ctdef(const ObTableCtx &ctx, tsc_ctdef.search_text_ = ir_scan_ctdef->search_text_; // No estimated info or approx agg not allowed, do total document count on execution; ir_scan_ctdef->estimated_total_doc_cnt_ = 0; - index_back_doc_id_column = ir_scan_ctdef->inv_scan_doc_id_col_; + index_back_doc_id_column = ir_scan_ctdef->inv_scan_domain_id_col_; } } if (OB_SUCC(ret) && ctx.is_index_back()) { ObDASIRAuxLookupCtDef *aux_lookup_ctdef = nullptr; ObDASBaseCtDef *ir_output_ctdef = static_cast(ir_scan_ctdef); - if (OB_FAIL(generate_doc_id_lookup_ctdef(ctx, allocator, tsc_ctdef, ir_output_ctdef, + if (OB_FAIL(generate_doc_id_lookup_ctdef(ctx, allocator, tsc_ctdef, ir_output_ctdef, index_back_doc_id_column, aux_lookup_ctdef))) { LOG_WARN("generate doc id lookup ctdef failed", K(ret)); } else if (OB_FAIL(append_fts_relavence_project_col(aux_lookup_ctdef, ir_scan_ctdef))) { @@ -844,7 +885,7 @@ int ObTableFtsTscCgService::generate_text_ir_ctdef(const ObTableCtx &ctx, root_ctdef = aux_lookup_ctdef; } } - + return ret; } @@ -863,10 +904,10 @@ int ObTableFtsTscCgService::generate_text_ir_spec_exprs(const ObTableCtx &ctx, O ret = OB_ERR_UNEXPECTED; LOG_WARN("tr_info is NULL", K(ret)); } else if (OB_ISNULL(tr_info->match_expr_) || OB_ISNULL(tr_info->relevance_expr_) || - OB_ISNULL(tr_info->doc_id_column_) || OB_ISNULL(tr_info->doc_length_column_)) { + OB_ISNULL(tr_info->docid_or_rowkey_column_) || OB_ISNULL(tr_info->doc_length_column_)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected null", K(ret), KP(tr_info->match_expr_), KP(tr_info->relevance_expr_), - KP(tr_info->doc_id_column_), KP(tr_info->doc_length_column_)); + KP(tr_info->docid_or_rowkey_column_), KP(tr_info->doc_length_column_)); } else if (OB_FAIL(cg.generate_rt_expr(*tr_info->match_expr_->get_search_key(), text_ir_scan_ctdef.search_text_))) { LOG_WARN("cg rt expr for search text failed", K(ret)); } else if (OB_ISNULL(tr_info->pushdown_match_filter_)) { @@ -876,9 +917,9 @@ int ObTableFtsTscCgService::generate_text_ir_spec_exprs(const ObTableCtx &ctx, O LOG_WARN("cg rt expr for match filter failed", K(ret)); } else { const UIntFixedArray &inv_scan_col_id = text_ir_scan_ctdef.get_inv_idx_scan_ctdef()->access_column_ids_; - const ObColumnRefRawExpr *doc_id_column = static_cast(tr_info->doc_id_column_); + const ObColumnRefRawExpr *doc_id_column = static_cast(tr_info->docid_or_rowkey_column_); const ObColumnRefRawExpr *doc_length_column = static_cast(tr_info->doc_length_column_); - + int64_t doc_id_col_idx = -1; int64_t doc_length_col_idx = -1; for (int64_t i = 0; i < inv_scan_col_id.count(); ++i) { @@ -893,11 +934,11 @@ int ObTableFtsTscCgService::generate_text_ir_spec_exprs(const ObTableCtx &ctx, O LOG_WARN("unexpected doc id not found in inverted index scan access columns", K(ret), K(text_ir_scan_ctdef), K(doc_id_col_idx), K(doc_length_col_idx)); } else { - text_ir_scan_ctdef.inv_scan_doc_id_col_ = + text_ir_scan_ctdef.inv_scan_domain_id_col_ = text_ir_scan_ctdef.get_inv_idx_scan_ctdef()->pd_expr_spec_.access_exprs_.at(doc_id_col_idx); text_ir_scan_ctdef.inv_scan_doc_length_col_ = text_ir_scan_ctdef.get_inv_idx_scan_ctdef()->pd_expr_spec_.access_exprs_.at(doc_length_col_idx); - if (OB_FAIL(result_output.push_back(text_ir_scan_ctdef.inv_scan_doc_id_col_))) { + if (OB_FAIL(result_output.push_back(text_ir_scan_ctdef.inv_scan_domain_id_col_))) { LOG_WARN("failed to append output exprs", K(ret)); } } @@ -983,7 +1024,7 @@ int ObTableFtsTscCgService::generate_doc_id_lookup_ctdef(const ObTableCtx &ctx, aux_lookup_ctdef->children_[0] = ir_scan_ctdef; aux_lookup_ctdef->children_[1] = scan_ctdef; } - + if (OB_SUCC(ret)) { if (OB_FAIL(aux_lookup_ctdef->result_output_.assign(result_outputs))) { LOG_WARN("assign result output failed", K(ret)); @@ -1019,10 +1060,10 @@ int ObTableFtsTscCgService::append_fts_relavence_project_col(ObDASIRAuxLookupCtD return ret; } -int ObTableFtsTscCgService::generate_das_scan_ctdef_with_doc_id(ObIAllocator &alloc, +int ObTableFtsTscCgService::generate_das_scan_ctdef_with_doc_id(ObIAllocator &alloc, const ObTableCtx &ctx, ObTableApiScanCtDef &tsc_ctdef, - ObDASScanCtDef *scan_ctdef, + ObDASScanCtDef *scan_ctdef, ObDASDomainIdMergeCtDef *&doc_id_merge_ctdef) { int ret = OB_SUCCESS; @@ -1061,8 +1102,8 @@ int ObTableFtsTscCgService::generate_das_scan_ctdef_with_doc_id(ObIAllocator &al return ret; } -int ObTableFtsTscCgService::generate_rowkey_doc_ctdef(ObIAllocator &alloc, - const ObTableCtx &ctx, +int ObTableFtsTscCgService::generate_rowkey_doc_ctdef(ObIAllocator &alloc, + const ObTableCtx &ctx, ObTableApiScanCtDef &tsc_ctdef, ObDASScanCtDef *&rowkey_doc_scan_ctdef) { @@ -1116,8 +1157,6 @@ int ObTableFtsTscCgService::extract_rowkey_doc_exprs(const ObTableCtx &ctx, } else if (OB_FAIL(rowkey_doc_schema->get_column_ids(rowkey_doc_cids))) { LOG_WARN("fail to get rowkey column ids in rowkey doc", K(ret), KPC(rowkey_doc_schema)); } else { - uint64_t doc_id_col_id = OB_INVALID_ID; - uint64_t ft_col_id = OB_INVALID_ID; for (int64_t i = 0; OB_SUCC(ret) && i < rowkey_doc_cids.count(); i++) { const ObTableColumnItem *item = nullptr; if (OB_FAIL(ctx.get_column_item_by_column_id(rowkey_doc_cids.at(i), item))) { @@ -1152,8 +1191,6 @@ int ObTableFtsTscCgService::extract_doc_rowkey_exprs(const ObTableCtx &ctx, } else if (OB_FAIL(doc_rowkey_schema->get_column_ids(rowkey_doc_cids))) { LOG_WARN("fail to get rowkey column ids in rowkey doc", K(ret), KP(doc_rowkey_schema)); } else { - uint64_t doc_id_col_id = OB_INVALID_ID; - uint64_t ft_col_id = OB_INVALID_ID; for (int64_t i = 0; OB_SUCC(ret) && i < rowkey_doc_cids.count(); i++) { const ObTableColumnItem *item = nullptr; if (OB_FAIL(ctx.get_column_item_by_column_id(rowkey_doc_cids.at(i), item))) { diff --git a/src/observer/table/fts/ob_table_fts_cg_service.h b/src/observer/table/fts/ob_table_fts_cg_service.h index 13f929bf9..d24282980 100644 --- a/src/observer/table/fts/ob_table_fts_cg_service.h +++ b/src/observer/table/fts/ob_table_fts_cg_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_FTS_CG_SERVICE_H_ @@ -22,12 +26,13 @@ class ObTableFtsExprCgService { public: static int fill_doc_id_expr_param(ObTableCtx &ctx, ObRawExpr *&doc_id_expr); - static bool need_calc_doc_id(ObTableCtx &ctx); + static bool need_calc_doc_id(ObTableCtx &ctx); static int generate_text_retrieval_dep_exprs(ObTableCtx &ctx, common::ObIAllocator &allocator); static int add_all_text_retrieval_scan_dep_exprs(ObTableCtx &ctx); + static int generate_topn_related_params(ObTableCtx &ctx, ObTextRetrievalInfo &tr_info); private: - static int generate_match_against_exprs(ObTableCtx &ctx, - ObMatchFunRawExpr *&match_expr, + static int generate_match_against_exprs(ObTableCtx &ctx, + ObMatchFunRawExpr *&match_expr, ObRawExpr *&pushdown_match_filter); private: DISALLOW_COPY_AND_ASSIGN(ObTableFtsExprCgService); @@ -45,8 +50,8 @@ class ObTableFtsDmlCgService const uint64_t table_id, ObDASDMLBaseCtDef &das_dml_ctdef); private: - static int generate_rowkey_doc_ctdef(ObTableCtx &ctx, - ObIAllocator &allocator, + static int generate_rowkey_doc_ctdef(ObTableCtx &ctx, + ObIAllocator &allocator, ObDASAttachSpec &attach_spec, ObDASScanCtDef *&rowkey_doc_scan_ctdef); static int generate_rowkey_doc_das_ctdef(ObTableCtx &ctx, ObDASScanCtDef &rowkey_doc_scan_ctdef); @@ -59,25 +64,25 @@ class ObTableFtsTscCgService public: ObTableFtsTscCgService() {} virtual ~ObTableFtsTscCgService() {} - static int extract_rowkey_doc_exprs(const ObTableCtx &ctx, + static int extract_rowkey_doc_exprs(const ObTableCtx &ctx, common::ObIArray &rowkey_doc_exprs); - static int extract_doc_rowkey_exprs(const ObTableCtx &ctx, + static int extract_doc_rowkey_exprs(const ObTableCtx &ctx, common::ObIArray &doc_rowkey_exprs); static int extract_text_ir_das_output_column_ids(const ObTableCtx &ctx, ObDASScanCtDef &scan_ctdef, ObIArray &tsc_out_cols); - static int generate_das_scan_ctdef_with_doc_id(ObIAllocator &alloc, + static int generate_das_scan_ctdef_with_doc_id(ObIAllocator &alloc, const ObTableCtx &ctx, ObTableApiScanCtDef &tsc_ctdef, - ObDASScanCtDef *scan_ctdef, + ObDASScanCtDef *scan_ctdef, ObDASDomainIdMergeCtDef *&doc_id_merge_ctdef); static int get_fts_schema(const ObTableCtx &ctx, uint64_t table_id, const ObTableSchema *&index_schema); - static int extract_text_ir_access_columns(const ObTableCtx &ctx, - ObDASScanCtDef &scan_ctdef, + static int extract_text_ir_access_columns(const ObTableCtx &ctx, + ObDASScanCtDef &scan_ctdef, ObIArray &access_expr); static int generate_text_ir_pushdown_expr_ctdef(const ObTableCtx &ctx, ObDASScanCtDef &scan_ctdef); - static int generate_text_ir_ctdef(const ObTableCtx &ctx, - ObIAllocator &allocator, + static int generate_text_ir_ctdef(const ObTableCtx &ctx, + ObIAllocator &allocator, ObTableApiScanCtDef &tsc_ctdef, ObDASBaseCtDef *&root_ctdef); private: @@ -90,7 +95,7 @@ class ObTableFtsTscCgService ObDASIRAuxLookupCtDef *&aux_lookup_ctdef); static int append_fts_relavence_project_col(ObDASIRAuxLookupCtDef *aux_lookup_ctdef, ObDASIRScanCtDef *ir_scan_ctdef); - static int generate_rowkey_doc_ctdef(ObIAllocator &alloc, + static int generate_rowkey_doc_ctdef(ObIAllocator &alloc, const ObTableCtx &ctx, ObTableApiScanCtDef &tsc_ctdef, ObDASScanCtDef *&rowkey_doc_scan_ctdef); @@ -112,4 +117,4 @@ class ObTableFtsUtil } // end namespace table } // end namespace oceanbase -#endif /* OCEANBASE_OBSERVER_OB_TABLE_FTS_CG_SERVICE_H_ */ \ No newline at end of file +#endif /* OCEANBASE_OBSERVER_OB_TABLE_FTS_CG_SERVICE_H_ */ diff --git a/src/observer/table/fts/ob_table_fts_context.h b/src/observer/table/fts/ob_table_fts_context.h index d3bcfa17f..253192616 100644 --- a/src/observer/table/fts/ob_table_fts_context.h +++ b/src/observer/table/fts/ob_table_fts_context.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_FTS_CONTEXT_H_ @@ -69,4 +73,4 @@ struct ObTableFtsCtx } // end namespace table } // end namespace oceanbase -#endif /* OCEANBASE_OBSERVER_OB_TABLE_FTS_CG_SERVICE_H_ */ \ No newline at end of file +#endif /* OCEANBASE_OBSERVER_OB_TABLE_FTS_CG_SERVICE_H_ */ diff --git a/src/observer/table/group/ob_i_table_struct.cpp b/src/observer/table/group/ob_i_table_struct.cpp index 252525079..8816da037 100644 --- a/src/observer/table/group/ob_i_table_struct.cpp +++ b/src/observer/table/group/ob_i_table_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_i_table_struct.h" diff --git a/src/observer/table/group/ob_i_table_struct.h b/src/observer/table/group/ob_i_table_struct.h index e52ba72e5..f49d3a1e1 100644 --- a/src/observer/table/group/ob_i_table_struct.h +++ b/src/observer/table/group/ob_i_table_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_I_TABLE_GROUP_H_ diff --git a/src/observer/table/group/ob_table_group_common.cpp b/src/observer/table/group/ob_table_group_common.cpp index 4d171b5b6..65ae25025 100644 --- a/src/observer/table/group/ob_table_group_common.cpp +++ b/src/observer/table/group/ob_table_group_common.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/group/ob_table_group_common.h b/src/observer/table/group/ob_table_group_common.h index f717c7bf6..b71db4810 100644 --- a/src/observer/table/group/ob_table_group_common.h +++ b/src/observer/table/group/ob_table_group_common.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_GROUP_COMMON_H_ diff --git a/src/observer/table/group/ob_table_group_execute.cpp b/src/observer/table/group/ob_table_group_execute.cpp index 9dbe9c340..504ee44fe 100644 --- a/src/observer/table/group/ob_table_group_execute.cpp +++ b/src/observer/table/group/ob_table_group_execute.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/group/ob_table_group_execute.h b/src/observer/table/group/ob_table_group_execute.h index c43e79086..09c12dd96 100644 --- a/src/observer/table/group/ob_table_group_execute.h +++ b/src/observer/table/group/ob_table_group_execute.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_GROUP_EXECUTE_H_ diff --git a/src/observer/table/group/ob_table_group_factory.cpp b/src/observer/table/group/ob_table_group_factory.cpp index a22ec61c2..3d82007f2 100644 --- a/src/observer/table/group/ob_table_group_factory.cpp +++ b/src/observer/table/group/ob_table_group_factory.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/group/ob_table_group_factory.h b/src/observer/table/group/ob_table_group_factory.h index fe41c2f67..2b1ef9a11 100644 --- a/src/observer/table/group/ob_table_group_factory.h +++ b/src/observer/table/group/ob_table_group_factory.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_GROUP_FACTORY_H_ diff --git a/src/observer/table/group/ob_table_group_register.cpp b/src/observer/table/group/ob_table_group_register.cpp index a2485c679..ad7835e33 100644 --- a/src/observer/table/group/ob_table_group_register.cpp +++ b/src/observer/table/group/ob_table_group_register.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ // register group obj class and then add its define header file in ob_table_group_traits_type.h diff --git a/src/observer/table/group/ob_table_group_register.h b/src/observer/table/group/ob_table_group_register.h index 7f2351f7f..68808cd8a 100644 --- a/src/observer/table/group/ob_table_group_register.h +++ b/src/observer/table/group/ob_table_group_register.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ // register group obj class and then add its define header file in ob_table_group_traits_type.h diff --git a/src/observer/table/group/ob_table_group_service.cpp b/src/observer/table/group/ob_table_group_service.cpp index 4cb1c791b..170b8e192 100644 --- a/src/observer/table/group/ob_table_group_service.cpp +++ b/src/observer/table/group/ob_table_group_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/group/ob_table_group_service.h b/src/observer/table/group/ob_table_group_service.h index e35510eac..5ac1d29d7 100644 --- a/src/observer/table/group/ob_table_group_service.h +++ b/src/observer/table/group/ob_table_group_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_GROUP_SERVICE_H_ diff --git a/src/observer/table/group/ob_table_tenant_group.cpp b/src/observer/table/group/ob_table_tenant_group.cpp index a1076dd8e..74b8d6b90 100644 --- a/src/observer/table/group/ob_table_tenant_group.cpp +++ b/src/observer/table/group/ob_table_tenant_group.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/group/ob_table_tenant_group.h b/src/observer/table/group/ob_table_tenant_group.h index ba5283902..b959e01d1 100644 --- a/src/observer/table/group/ob_table_tenant_group.h +++ b/src/observer/table/group/ob_table_tenant_group.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_TENANT_GROUP_H_ diff --git a/src/observer/table/hbase/ob_hbase_group_processor.cpp b/src/observer/table/hbase/ob_hbase_group_processor.cpp index 32a084137..d844e3367 100644 --- a/src/observer/table/hbase/ob_hbase_group_processor.cpp +++ b/src/observer/table/hbase/ob_hbase_group_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/hbase/ob_hbase_group_processor.h b/src/observer/table/hbase/ob_hbase_group_processor.h index adcaf2ced..55f0161db 100644 --- a/src/observer/table/hbase/ob_hbase_group_processor.h +++ b/src/observer/table/hbase/ob_hbase_group_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_HBASE_GROUP_PROCESSOR_H diff --git a/src/observer/table/hbase/ob_hbase_group_struct.cpp b/src/observer/table/hbase/ob_hbase_group_struct.cpp index 77cff2dbe..fdcf00dbf 100644 --- a/src/observer/table/hbase/ob_hbase_group_struct.cpp +++ b/src/observer/table/hbase/ob_hbase_group_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/hbase/ob_hbase_group_struct.h b/src/observer/table/hbase/ob_hbase_group_struct.h index 08a4d10b0..d8a7956ad 100644 --- a/src/observer/table/hbase/ob_hbase_group_struct.h +++ b/src/observer/table/hbase/ob_hbase_group_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_HBASE_GROUP_STRUCT_H diff --git a/src/observer/table/htable_filter_lex.cxx b/src/observer/table/htable_filter_lex.cxx index 1ea6b9473..1693bdcf8 100644 --- a/src/observer/table/htable_filter_lex.cxx +++ b/src/observer/table/htable_filter_lex.cxx @@ -1,15 +1,19 @@ #line 2 "../../../src/observer/table/htable_filter_lex.cxx" #line 7 "../../../src/observer/table/htable_filter_lex.lxx" - /** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. + /* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER #include "observer/table/ob_htable_filter_parser.h" diff --git a/src/observer/table/htable_filter_lex.hxx b/src/observer/table/htable_filter_lex.hxx index b8445ba7d..bfa8b3784 100644 --- a/src/observer/table/htable_filter_lex.hxx +++ b/src/observer/table/htable_filter_lex.hxx @@ -4,16 +4,20 @@ #line 6 "../../../src/observer/table/htable_filter_lex.hxx" #line 7 "../../../src/observer/table/htable_filter_lex.lxx" - /** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. + /* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER #include "observer/table/ob_htable_filter_parser.h" diff --git a/src/observer/table/htable_filter_lex.lxx b/src/observer/table/htable_filter_lex.lxx index fc4540f06..c8e0a7c88 100644 --- a/src/observer/table/htable_filter_lex.lxx +++ b/src/observer/table/htable_filter_lex.lxx @@ -4,16 +4,20 @@ %option extra-type="oceanbase::table::ObHTableFilterParser *" %option prefix="ob_hfilter_" %top{ - /** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. + /* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER #include "observer/table/ob_htable_filter_parser.h" diff --git a/src/observer/table/htable_filter_tab.cxx b/src/observer/table/htable_filter_tab.cxx index 65e64ed65..9422ef95f 100644 --- a/src/observer/table/htable_filter_tab.cxx +++ b/src/observer/table/htable_filter_tab.cxx @@ -68,16 +68,20 @@ /* Line 171 of yacc.c */ #line 14 "../../../src/observer/table/htable_filter_tab.yxx" -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ @@ -135,16 +139,20 @@ using namespace oceanbase::common; /* Line 209 of yacc.c */ #line 1 "../../../src/observer/table/htable_filter_tab.yxx" -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/src/observer/table/htable_filter_tab.hxx b/src/observer/table/htable_filter_tab.hxx index fe6bfc346..f83ae0fe3 100644 --- a/src/observer/table/htable_filter_tab.hxx +++ b/src/observer/table/htable_filter_tab.hxx @@ -37,16 +37,20 @@ /* Line 1676 of yacc.c */ #line 1 "../../../src/observer/table/htable_filter_tab.yxx" -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/src/observer/table/htable_filter_tab.yxx b/src/observer/table/htable_filter_tab.yxx index c90100829..975d74d49 100644 --- a/src/observer/table/htable_filter_tab.yxx +++ b/src/observer/table/htable_filter_tab.yxx @@ -1,27 +1,35 @@ %code requires { -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ } %code top { -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ } /* Location tracking. */ @@ -1002,4 +1010,4 @@ prefix_list: } } ; -%% \ No newline at end of file +%% diff --git a/src/observer/table/models/ob_hbase_model.cpp b/src/observer/table/models/ob_hbase_model.cpp index 65f70fb2a..227c5937c 100644 --- a/src/observer/table/models/ob_hbase_model.cpp +++ b/src/observer/table/models/ob_hbase_model.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ @@ -1615,7 +1619,7 @@ int ObHBaseModel::generate_new_value(ObTableExecCtx &ctx, } else { ObString orig_str; int64_t new_ts = htable_cell.get_timestamp(); // default insert timestamp - if (OB_NOT_NULL(old_entity)) { // 旧行存在,构造新值(base + delta) + if (OB_NOT_NULL(old_entity)) { // The old row exists, construct the new value (base + delta) ObObj base_obj_v; if (OB_FAIL(old_entity->get_property(ObHTableConstants::VALUE_CNAME_STR, base_obj_v))) { LOG_WARN("failed to get value", K(ret), K(old_entity)); @@ -1885,4 +1889,4 @@ int ObHBaseModel::add_dict_and_bm_to_result_entity(const ObTableLSOp &ls_op, } } return ret; -} \ No newline at end of file +} diff --git a/src/observer/table/models/ob_hbase_model.h b/src/observer/table/models/ob_hbase_model.h index 3702cc325..94072c614 100644 --- a/src/observer/table/models/ob_hbase_model.h +++ b/src/observer/table/models/ob_hbase_model.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_TABLE_MODELS_OB_HBASE_MODEL_H_ diff --git a/src/observer/table/models/ob_i_model.cpp b/src/observer/table/models/ob_i_model.cpp index 8d1c4cfce..15822a308 100644 --- a/src/observer/table/models/ob_i_model.cpp +++ b/src/observer/table/models/ob_i_model.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/models/ob_i_model.h b/src/observer/table/models/ob_i_model.h index b9d9f2df1..ce81a63ff 100644 --- a/src/observer/table/models/ob_i_model.h +++ b/src/observer/table/models/ob_i_model.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_TABLE_MODELS_OB_I_MODEL_H_ diff --git a/src/observer/table/models/ob_model_factory.h b/src/observer/table/models/ob_model_factory.h index 330dda056..adf281d4d 100644 --- a/src/observer/table/models/ob_model_factory.h +++ b/src/observer/table/models/ob_model_factory.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_TABLE_MODELS_OB_MODEL_FACTORY_H_ diff --git a/src/observer/table/models/ob_redis_model.cpp b/src/observer/table/models/ob_redis_model.cpp index 633d53d7d..cc7dfce0f 100644 --- a/src/observer/table/models/ob_redis_model.cpp +++ b/src/observer/table/models/ob_redis_model.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/src/observer/table/models/ob_redis_model.h b/src/observer/table/models/ob_redis_model.h index 2f736b86f..cd150a06f 100644 --- a/src/observer/table/models/ob_redis_model.h +++ b/src/observer/table/models/ob_redis_model.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_TABLE_MODELS_OB_REDIS_MODEL_H_ diff --git a/src/observer/table/models/ob_table_model.cpp b/src/observer/table/models/ob_table_model.cpp index b98a288a6..3e828b0c4 100644 --- a/src/observer/table/models/ob_table_model.cpp +++ b/src/observer/table/models/ob_table_model.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/src/observer/table/models/ob_table_model.h b/src/observer/table/models/ob_table_model.h index 149965a40..f6400b355 100644 --- a/src/observer/table/models/ob_table_model.h +++ b/src/observer/table/models/ob_table_model.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_TABLE_MODELS_OB_TABLE_MODEL_H_ diff --git a/src/observer/table/ob_htable_filter_operator.cpp b/src/observer/table/ob_htable_filter_operator.cpp index db5026995..f76625c93 100644 --- a/src/observer/table/ob_htable_filter_operator.cpp +++ b/src/observer/table/ob_htable_filter_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_htable_filter_operator.h b/src/observer/table/ob_htable_filter_operator.h index f136e2853..500813196 100644 --- a/src/observer/table/ob_htable_filter_operator.h +++ b/src/observer/table/ob_htable_filter_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_HTABLE_FILTER_OPERATOR_H diff --git a/src/observer/table/ob_htable_filter_parser.cpp b/src/observer/table/ob_htable_filter_parser.cpp index 3aac7cbc5..b7a32419d 100644 --- a/src/observer/table/ob_htable_filter_parser.cpp +++ b/src/observer/table/ob_htable_filter_parser.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_htable_filter_parser.h b/src/observer/table/ob_htable_filter_parser.h index 28d81ec57..1815c4d2f 100644 --- a/src/observer/table/ob_htable_filter_parser.h +++ b/src/observer/table/ob_htable_filter_parser.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_HTABLE_FILTER_PARSER_H diff --git a/src/observer/table/ob_htable_filters.cpp b/src/observer/table/ob_htable_filters.cpp index dcf3c7c82..aa80de3fd 100644 --- a/src/observer/table/ob_htable_filters.cpp +++ b/src/observer/table/ob_htable_filters.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -2639,7 +2643,7 @@ void CheckAndMutateFilter::reset() } // NOTE: when value_is_null is true,cannot return other cell directly -// 判断是否 check 通过,例如当整个 column family 为空的时候,result_count = 0,但是应该是 check 通过 +// Determine if the check passes, for example when the entire column family is empty, result_count = 0, but it should still be a check pass // NOTE: when value_is_null is true, cannot return other cells directly and determine whether check is // passed by result_count > 0 in ObTableQueryAndMutateP::try_process. diff --git a/src/observer/table/ob_htable_filters.h b/src/observer/table/ob_htable_filters.h index 995df4b51..c3c4602bf 100644 --- a/src/observer/table/ob_htable_filters.h +++ b/src/observer/table/ob_htable_filters.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_HTABLE_FILTERS_H diff --git a/src/observer/table/ob_htable_lock_mgr.cpp b/src/observer/table/ob_htable_lock_mgr.cpp index 056823930..703313fc7 100644 --- a/src/observer/table/ob_htable_lock_mgr.cpp +++ b/src/observer/table/ob_htable_lock_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -464,4 +468,4 @@ int ObHTableLock::unlock() } } // end namespace table -} // end namespace oceanbase \ No newline at end of file +} // end namespace oceanbase diff --git a/src/observer/table/ob_htable_lock_mgr.h b/src/observer/table/ob_htable_lock_mgr.h index bcb034200..b7aeab69b 100644 --- a/src/observer/table/ob_htable_lock_mgr.h +++ b/src/observer/table/ob_htable_lock_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OBSERVER_TABLE_OB_HTABLE_LOCK_MGR_H diff --git a/src/observer/table/ob_htable_rowkey_mgr.cpp b/src/observer/table/ob_htable_rowkey_mgr.cpp index 879c86260..588516bc1 100644 --- a/src/observer/table/ob_htable_rowkey_mgr.cpp +++ b/src/observer/table/ob_htable_rowkey_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -206,4 +210,4 @@ void HRowkeyQueue::destroy() } } // end namespace table -} // end namespace oceanbase \ No newline at end of file +} // end namespace oceanbase diff --git a/src/observer/table/ob_htable_rowkey_mgr.h b/src/observer/table/ob_htable_rowkey_mgr.h index 1b6d5c4c2..ab63fe007 100644 --- a/src/observer/table/ob_htable_rowkey_mgr.h +++ b/src/observer/table/ob_htable_rowkey_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OBSERVER_TABLE_OB_HTABLE_ROWKEY_MGR_H diff --git a/src/observer/table/ob_redis_execute_processor.cpp b/src/observer/table/ob_redis_execute_processor.cpp index 772744643..4d1dd0902 100644 --- a/src/observer/table/ob_redis_execute_processor.cpp +++ b/src/observer/table/ob_redis_execute_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_redis_execute_processor.h b/src/observer/table/ob_redis_execute_processor.h index 2f778b33b..ff0d3d177 100644 --- a/src/observer/table/ob_redis_execute_processor.h +++ b/src/observer/table/ob_redis_execute_processor.h @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table/ob_redis_execute_processor_v2.cpp b/src/observer/table/ob_redis_execute_processor_v2.cpp index 36f4659cb..21f765f0f 100644 --- a/src/observer/table/ob_redis_execute_processor_v2.cpp +++ b/src/observer/table/ob_redis_execute_processor_v2.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_redis_execute_processor_v2.h b/src/observer/table/ob_redis_execute_processor_v2.h index 323784173..6d9daac8a 100644 --- a/src/observer/table/ob_redis_execute_processor_v2.h +++ b/src/observer/table/ob_redis_execute_processor_v2.h @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table/ob_table_aggregation.cpp b/src/observer/table/ob_table_aggregation.cpp index d84a18520..4329a1e21 100644 --- a/src/observer/table/ob_table_aggregation.cpp +++ b/src/observer/table/ob_table_aggregation.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -38,9 +42,8 @@ int ObTableAggCalculator::init() { } return ret; } - -// 在min/max字符串类型时,需要不断的替换最大值/最小值,导致中间内存耗费很多 -// 因此使用中间临时内存,临时内存足够大时,可以复用,不够大时,先释放后重新申请 +// When the type is min/max string, it requires continuous replacement of the maximum/minimum values, leading to significant memory consumption in between +// Therefore, use intermediate temporary memory, which can be reused if it is large enough, or released and reallocated if it is not int ObTableAggCalculator::deep_copy_value(int64_t idx, const ObObj &src, ObObj &dst) { int ret = OB_SUCCESS; @@ -428,4 +431,4 @@ void ObTableAggCalculator::final_aggregate() } } } -} \ No newline at end of file +} diff --git a/src/observer/table/ob_table_aggregation.h b/src/observer/table/ob_table_aggregation.h index 4ed48630c..5747a344e 100644 --- a/src/observer/table/ob_table_aggregation.h +++ b/src/observer/table/ob_table_aggregation.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_AGGREGATION_H #define _OB_TABLE_AGGREGATION_H @@ -156,4 +160,4 @@ class ObTableAggCalculator } // end namespace table } // end namespace oceanbase -#endif /* _OB_TABLE_AGGREGATION_H */ \ No newline at end of file +#endif /* _OB_TABLE_AGGREGATION_H */ diff --git a/src/observer/table/ob_table_audit.cpp b/src/observer/table/ob_table_audit.cpp index 094bfc99f..aa66af17d 100644 --- a/src/observer/table/ob_table_audit.cpp +++ b/src/observer/table/ob_table_audit.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -181,4 +185,4 @@ int ObTableAuditRedisOp::generate_stmt(const ObString &table_name, char *buf, in } return ret; -} \ No newline at end of file +} diff --git a/src/observer/table/ob_table_audit.h b/src/observer/table/ob_table_audit.h index 7ddd8be8b..a02fea1d6 100644 --- a/src/observer/table/ob_table_audit.h +++ b/src/observer/table/ob_table_audit.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_AUDIT_H_ diff --git a/src/observer/table/ob_table_batch_common.cpp b/src/observer/table/ob_table_batch_common.cpp index 26ffa870a..22de9aaf5 100644 --- a/src/observer/table/ob_table_batch_common.cpp +++ b/src/observer/table/ob_table_batch_common.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_batch_common.h b/src/observer/table/ob_table_batch_common.h index 5bab6a837..0db5b6334 100644 --- a/src/observer/table/ob_table_batch_common.h +++ b/src/observer/table/ob_table_batch_common.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_BATCH_COMMON_H diff --git a/src/observer/table/ob_table_batch_execute_processor.cpp b/src/observer/table/ob_table_batch_execute_processor.cpp index d9c78674a..dde8af6af 100644 --- a/src/observer/table/ob_table_batch_execute_processor.cpp +++ b/src/observer/table/ob_table_batch_execute_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_batch_execute_processor.h b/src/observer/table/ob_table_batch_execute_processor.h index 04a2a07c3..7a02ed3a5 100644 --- a/src/observer/table/ob_table_batch_execute_processor.h +++ b/src/observer/table/ob_table_batch_execute_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_BATCH_EXECUTE_PROCESSOR_H diff --git a/src/observer/table/ob_table_batch_service.cpp b/src/observer/table/ob_table_batch_service.cpp index 9d89489d1..3730fb9d3 100644 --- a/src/observer/table/ob_table_batch_service.cpp +++ b/src/observer/table/ob_table_batch_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_batch_service.h b/src/observer/table/ob_table_batch_service.h index c5d0acbd9..4d033aa28 100644 --- a/src/observer/table/ob_table_batch_service.h +++ b/src/observer/table/ob_table_batch_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_BATCH_SERVICE_H diff --git a/src/observer/table/ob_table_cache.cpp b/src/observer/table/ob_table_cache.cpp index e5fafc879..30f6bce1c 100644 --- a/src/observer/table/ob_table_cache.cpp +++ b/src/observer/table/ob_table_cache.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_cache.h b/src/observer/table/ob_table_cache.h index cf5eead56..3fcb0f6c1 100644 --- a/src/observer/table/ob_table_cache.h +++ b/src/observer/table/ob_table_cache.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_CACHE_H_ diff --git a/src/observer/table/ob_table_cg_service.cpp b/src/observer/table/ob_table_cg_service.cpp index 32ab15534..cf1bb6441 100644 --- a/src/observer/table/ob_table_cg_service.cpp +++ b/src/observer/table/ob_table_cg_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -139,7 +143,7 @@ int ObTableExprCgService::generate_expire_expr(ObTableCtx &ctx, &schema_checker))) { LOG_WARN("fail to build expire expr", K(ret), K(ttl_definition)); } else { - // 找到生成列引用的列并替换为真正的列 + // Find the column referenced by the generated column and replace it with the actual column for (int64_t i = 0; OB_SUCC(ret) && i < columns.count(); i++) { const ObQualifiedName &tmp_column = columns.at(i); const ObString &col_name = tmp_column.col_name_; @@ -1101,9 +1105,9 @@ int ObTableSpecCgService::generate_spec(ObIAllocator &alloc, /* table_loc_id_ ref_table_id_ - 主表: 主表table_id 主表table_id - 索引表: 主表table_id 索引表table_id - 回表: 主表table_id 主表table_id + main table: main table table_id main table table_id + index table: main table table_id index table table_id + back to table: main table table_id main table table_id */ int ObTableLocCgService::generate_table_loc_meta(const ObTableCtx &ctx, const ObSimpleTableSchemaV2 &simple_table_schema, @@ -1209,8 +1213,7 @@ int ObTableExprCgService::refresh_delete_exprs_frame(ObTableCtx &ctx, ObObj q_obj; ObObj t_obj; int64_t time = 0; - - // htable场景rowkey都在properties中,所以需要从properties中提取出rowkey + // In the htable scenario, all rowkeys are in properties, so we need to extract the rowkey from properties if (OB_FAIL(entity.get_property(ObHTableConstants::ROWKEY_CNAME_STR, k_obj))) { LOG_WARN("fail to get K", K(ret)); } else if (OB_FAIL(entity.get_property(ObHTableConstants::CQ_CNAME_STR, q_obj))) { @@ -2558,8 +2561,7 @@ int ObTableDmlCgService::generate_conflict_checker_ctdef(ObTableCtx &ctx, conflict_checker_ctdef.use_dist_das_ = ctx.need_dist_das(); conflict_checker_ctdef.rowkey_count_ = ctx.get_table_schema()->get_rowkey_column_num(); } - - // 针对全局索引场景,生成回表的partition id表达式 + // For the global index scenario, generate the partition id expression for table lookups if (OB_SUCC(ret) && (ctx.need_dist_das())) { ObRawExpr *part_id_expr_for_lookup = NULL; ObExpr *rt_part_id_expr = NULL; @@ -2936,9 +2938,8 @@ int ObTableDmlCgService::generate_column_ids(ObTableCtx &ctx, ObTableIndexInfo & return ret; } - -// 构造 das_ctdef 中的 old_row_projector 和 new_row_projector, -// 其中存储 storage column 对应表达式在 full row exprs 数组中下标 +// Construct the old_row_projector and new_row_projector in das_ctdef, +// where the storage column corresponding expression index in the full row exprs array is stored int ObTableDmlCgService::generate_projector(const ObIArray &dml_column_ids, const ObIArray &storage_column_ids, const ObIArray &old_row, @@ -2951,7 +2952,7 @@ int ObTableDmlCgService::generate_projector(const ObIArray &dml_column IntFixedArray &new_row_projector = das_ctdef.new_row_projector_; // generate old row projector - // 查找old row expr 在full row expr中的位置(投影) + // Find the position (projection) of old row expr in full row expr if (!old_row.empty()) { if (OB_FAIL(old_row_projector.prepare_allocate(storage_column_ids.count()))) { LOG_WARN("fail to init row projector array", K(ret), K(storage_column_ids.count())); @@ -2978,7 +2979,7 @@ int ObTableDmlCgService::generate_projector(const ObIArray &dml_column } // generate new row projector - // 查找new row expr 在full row expr中的位置(投影) + // Find the position (projection) of new row expr in full row expr if (!new_row.empty() && OB_SUCC(ret)) { if (OB_FAIL(new_row_projector.prepare_allocate(storage_column_ids.count()))) { LOG_WARN("fail to init row projector array", K(ret), K(storage_column_ids.count())); @@ -2990,7 +2991,7 @@ int ObTableDmlCgService::generate_projector(const ObIArray &dml_column storage_cid; int64_t column_idx = OB_INVALID_INDEX; int64_t projector_idx = OB_INVALID_INDEX; - // 如果 projector[i] = j, 表达式按照 schema 顺序,第 i 个 column 在 full_row 中的下标为 j,如果在 new_row 中不存在,那么 j == -1 + // If projector[i] = j, the expression according to schema order, the index of the i-th column in full_row is j, if it does not exist in new_row, then j == -1 new_row_projector.at(i) = OB_INVALID_INDEX; if (has_exist_in_array(dml_column_ids, ref_cid, &column_idx)) { ObRawExpr *column_expr = new_row.at(column_idx); @@ -2999,7 +3000,7 @@ int ObTableDmlCgService::generate_projector(const ObIArray &dml_column LOG_WARN("row column not found in full row columns", K(ret), K(column_idx), KPC(new_row.at(column_idx))); } else { - new_row_projector.at(i) = projector_idx; // projector_idx 为 column storage_column_ids[i] 在 full row expr 中的 index + new_row_projector.at(i) = projector_idx; // projector_idx is the index of column storage_column_ids[i] in the full row expr } } } @@ -3110,8 +3111,7 @@ int ObTableTscCgService::generate_rt_exprs(const ObTableCtx &ctx, return ret; } - -// 访问虚拟生成列转换为访问其依赖的列 +// Access virtual generated column is converted to access its dependent columns int ObTableTscCgService::replace_gen_col_exprs(const ObTableCtx &ctx, ObIArray &access_exprs) { @@ -3213,12 +3213,10 @@ int ObTableTscCgService::generate_pushdown_aggr_ctdef(const ObTableCtx &ctx, } return ret; } - - -// 非索引扫描: access exprs = select exprs -// 普通索引表: access exprs = [index column exprs][rowkey expr] -// 索引回表: access expr = [rowkey expr][select without rowkey exprs] -// 全文索引表:access exprs = extract_text_ir_access_columns +// Non-index scan: access exprs = select exprs +// Normal index table: access exprs = [index column exprs][rowkey expr] +// Index backtable: access expr = [rowkey expr][select without rowkey exprs] +// Full-text index table: access exprs = extract_text_ir_access_columns int ObTableTscCgService::generate_access_ctdef(const ObTableCtx &ctx, ObIAllocator &allocator, ObDASScanCtDef &das_tsc_ctdef) @@ -3242,25 +3240,25 @@ int ObTableTscCgService::generate_access_ctdef(const ObTableCtx &ctx, if (OB_FAIL(ObTableFtsTscCgService::extract_rowkey_doc_exprs(ctx, access_exprs))) { LOG_WARN("fail to extract rowkey doc id", K(ret)); } - } else if (!ctx.is_index_scan()) { // 非索引扫描 + } else if (!ctx.is_index_scan()) { // non-index scan for (int i = 0; OB_SUCC(ret) && i < select_exprs.count(); i++) { if (OB_FAIL(access_exprs.push_back(select_exprs.at(i)))) { LOG_WARN("fail to push back access exprs", K(ret), K(i)); } } - } else if (is_normal_index_table) { // 非全文索引表 + } else if (is_normal_index_table) { // non-full-text index table if (OB_FAIL(access_exprs.assign(index_exprs))) { LOG_WARN("fail to assign access exprs", K(ret), K(ctx.get_index_table_id())); } else { for (int64_t i = 0; OB_SUCC(ret) && i < rowkey_exprs.count(); i++) { if (is_in_array(index_exprs, rowkey_exprs.at(i))) { - // 在index_exprs中的index expr不需要再次添加 + // The index expr in index_exprs does not need to be added again } else if (OB_FAIL(access_exprs.push_back(rowkey_exprs.at(i)))) { LOG_WARN("fail to push back rowkey expr", K(ret), K(i)); } } } - } else if (ctx.is_index_scan() && is_primary_table) { // 索引回表 + } else if (ctx.is_index_scan() && is_primary_table) { // index back table if (OB_FAIL(access_exprs.assign(rowkey_exprs))) { LOG_WARN("fail to assign access exprs", K(ret), K(ctx.get_ref_table_id())); } else { @@ -3270,7 +3268,7 @@ int ObTableTscCgService::generate_access_ctdef(const ObTableCtx &ctx, } for (int64_t i = 0; OB_SUCC(ret) && i < select_exprs.count(); i++) { if (has_exist_in_array(rowkey_column_ids, select_exprs.at(i)->get_column_id())) { - // 已经在rowkey中,不需要再次添加 + // Already in rowkey, no need to add again } else if (OB_FAIL(access_exprs.push_back(select_exprs.at(i)))) { LOG_WARN("fail to push back select expr", K(ret), K(i)); } @@ -3405,10 +3403,10 @@ int ObTableTscCgService::extract_select_output_column_ids(const ObTableCtx &ctx, } // tsc_out_cols -// 主表/索引回表/索引扫描不需要回表: select column ids -// 索引表: rowkey column ids +// Main table/index backtable/index scan does not require backtable: select column ids +// Index table: rowkey column ids // rowkey_doc:rowkey+doc_id -// 全文检索:extract_text_ir_das_output_column_ids +// Full-text search: extract_text_ir_das_output_column_ids int ObTableTscCgService::generate_table_param(const ObTableCtx &ctx, ObDASScanCtDef &das_tsc_ctdef, const bool query_cs_replica /*=false*/) @@ -3433,8 +3431,8 @@ int ObTableTscCgService::generate_table_param(const ObTableCtx &ctx, if (OB_FAIL(tsc_out_cols.assign(das_tsc_ctdef.access_column_ids_))) { LOG_WARN("fail to assgin tsc_out_cols", K(ret), K(das_tsc_ctdef.access_column_ids_)); } - } else if (is_primary_table // 主表扫描 + 索引扫描回主表 - || (ctx.is_index_scan() && !ctx.is_index_back())) { //索引扫描不需要回表 + } else if (is_primary_table // primary table scan + index scan back to primary table + || (ctx.is_index_scan() && !ctx.is_index_back())) { // index scan does not require back table lookup if (ctx.is_index_scan() && !ctx.is_index_back()) { index_schema = ctx.get_index_schema(); } else { @@ -3443,7 +3441,7 @@ int ObTableTscCgService::generate_table_param(const ObTableCtx &ctx, if (OB_FAIL(extract_select_output_column_ids(ctx, das_tsc_ctdef, index_schema, tsc_out_cols))) { LOG_WARN("fail to extract tsc output column ids", K(ret)); } - } else if (ctx.is_index_scan() && is_index_table) { // 索引表 + } else if (ctx.is_index_scan() && is_index_table) { // index table index_schema = ctx.get_index_schema(); if (OB_FAIL(ctx.get_table_schema()->get_rowkey_column_ids(tsc_out_cols))) { LOG_WARN("fail to get rowkey column ids", K(ret)); diff --git a/src/observer/table/ob_table_cg_service.h b/src/observer/table/ob_table_cg_service.h index 95e36e74e..469c9102a 100644 --- a/src/observer/table/ob_table_cg_service.h +++ b/src/observer/table/ob_table_cg_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_CG_SERVICE_H_ @@ -29,22 +33,21 @@ namespace table { class ObTableExprCgService; class ObTableFtsTscCgService; - -// 构造表达式的静态类 +// Static class for constructing expressions class ObTableExprCgService { public: friend class ObTableFtsExprCgService; public: - // 构造表达式 + // Construct expression static int generate_exprs(ObTableCtx &ctx, common::ObIAllocator &allocator, ObExprFrameInfo &expr_frame_info); - // 基于原生表达式生成表达式内存布局 + // Generate expression memory layout based on native expression static int generate_expr_frame_info(ObTableCtx &ctx, common::ObIAllocator &allocator, ObExprFrameInfo &expr_frame_info); - // 基于内存表达式内存布局申请内存(这里只是申请了frame内存,dml场景还需要初始化) + // Allocate memory based on the memory layout of the in-memory expression (here only frame memory is allocated, initialization is still needed for DML scenarios) static int alloc_exprs_memory(ObTableCtx &ctx, ObExprFrameInfo &expr_frame_info); static int refresh_insert_exprs_frame(ObTableCtx &ctx, const common::ObIArray &exprs, @@ -465,4 +468,4 @@ class ObTableTscCgService } // end namespace table } // end namespace oceanbase -#endif /* OCEANBASE_OBSERVER_OB_TABLE_CG_SERVICE_H_ */ \ No newline at end of file +#endif /* OCEANBASE_OBSERVER_OB_TABLE_CG_SERVICE_H_ */ diff --git a/src/observer/table/ob_table_client_info_mgr.cpp b/src/observer/table/ob_table_client_info_mgr.cpp index 833538e64..2f3b329f7 100644 --- a/src/observer/table/ob_table_client_info_mgr.cpp +++ b/src/observer/table/ob_table_client_info_mgr.cpp @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define USING_LOG_PREFIX SERVER #include "ob_table_client_info_mgr.h" diff --git a/src/observer/table/ob_table_client_info_mgr.h b/src/observer/table/ob_table_client_info_mgr.h index 4fccee927..1a5e94c20 100644 --- a/src/observer/table/ob_table_client_info_mgr.h +++ b/src/observer/table/ob_table_client_info_mgr.h @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #ifndef OB_TABLE_CLIENT_INFO_MGR_H_ #define OB_TABLE_CLIENT_INFO_MGR_H_ diff --git a/src/observer/table/ob_table_connection_mgr.cpp b/src/observer/table/ob_table_connection_mgr.cpp index 3076a631f..91a9fb418 100644 --- a/src/observer/table/ob_table_connection_mgr.cpp +++ b/src/observer/table/ob_table_connection_mgr.cpp @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define USING_LOG_PREFIX SERVER #include "ob_table_connection_mgr.h" diff --git a/src/observer/table/ob_table_connection_mgr.h b/src/observer/table/ob_table_connection_mgr.h index 10bc6eb35..a11ac795b 100644 --- a/src/observer/table/ob_table_connection_mgr.h +++ b/src/observer/table/ob_table_connection_mgr.h @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #ifndef OB_TABLE_CONNECTION_MGR_H_ #define OB_TABLE_CONNECTION_MGR_H_ diff --git a/src/observer/table/ob_table_context.cpp b/src/observer/table/ob_table_context.cpp index 52310e464..0cf6ad8c9 100644 --- a/src/observer/table/ob_table_context.cpp +++ b/src/observer/table/ob_table_context.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER #include "ob_table_context.h" @@ -284,7 +288,7 @@ int ObTableCtx::get_assignment_by_column_id(uint64_t column_id, const ObTableAss */ void ObTableCtx::init_physical_plan_ctx(int64_t timeout_ts, int64_t tenant_schema_version) { - phy_plan_ctx_.set_timeout_timestamp(timeout_ts); // ObConflictChecker::init_das_scan_rtdef 需要 + phy_plan_ctx_.set_timeout_timestamp(timeout_ts); // ObConflictChecker::init_das_scan_rtdef requires phy_plan_ctx_.set_tenant_schema_version(tenant_schema_version); phy_plan_ctx_.set_cur_time(ObTimeUtility::fast_current_time()); exec_ctx_.set_physical_plan_ctx(&phy_plan_ctx_); @@ -879,7 +883,7 @@ int ObTableCtx::generate_key_range(const ObIArray &scan_ranges_columns padding_num = columns_infos.count() - scan_ranges_columns_cnt; } } else if (is_index_scan_) { - // 索引扫描场景下用户可能没有填写rowkey的key_range,需要加上 + // In the index scan scenario, the user may not have filled in the rowkey's key_range, which needs to be added padding_num = index_schema_->get_rowkey_column_num() - index_col_ids_.count(); } @@ -1590,7 +1594,7 @@ int ObTableCtx::init_get() } else if (OB_FAIL(entity_->get_properties_names(query_col_names_))) { LOG_WARN("fail to get entity properties names", K(ret)); } else { - const bool need_get_all_column = query_col_names_.empty(); // 未设置get的列,默认返回全部列 + const bool need_get_all_column = query_col_names_.empty(); // Columns to get are not set, default to return all columns // init select_col_ids, query_col_names_ const ObIArray& col_info_array = schema_cache_guard_->get_column_info_array(); for (int64_t i = 0; OB_SUCC(ret) && i < col_info_array.count(); i++) { @@ -2238,7 +2242,7 @@ int ObTableCtx::get_related_tablet_id(const share::schema::ObTableSchema &index_ ObObjectID related_part_id = OB_INVALID_ID; ObObjectID related_first_level_part_id = OB_INVALID_ID; ObTabletID tmp_tablet_id; - // 先从主表获取part_idx和subpart_idx,索引表的part_idx和subpart_idx是和主表一致的 + // First get part_idx and subpart_idx from the main table, the part_idx and subpart_idx in the index table are consistent with those in the main table if (OB_ISNULL(simple_table_schema_)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("table schema is null", K(ret)); diff --git a/src/observer/table/ob_table_context.h b/src/observer/table/ob_table_context.h index 5aacf39f9..1ba9809ec 100644 --- a/src/observer/table/ob_table_context.h +++ b/src/observer/table/ob_table_context.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_CONTEXT_H_ @@ -162,9 +166,8 @@ enum ObTableIncAppendStage TABLE_INCR_APPEND_UPDATE = 1, TABLE_INCR_APPEND_INSERT = 2 }; - -// 1.用于存放整个process过程中需要的通用上下文信息 -// 2.在try_process()中进行初始化 +// 1. Used to store general context information needed throughout the entire process +// 2. Initialization in try_process() class ObTableCtx { public: @@ -342,12 +345,12 @@ class ObTableCtx virtual ~ObTableCtx() { - // async query 中可能提前析构session, 因此exec_ctx这里必须先解绑, 不然可能 use after free + // async query may destruct session prematurely, therefore exec_ctx must be unbound here first, otherwise it may cause use after free exec_ctx_.set_my_session(nullptr); - // session在其他线程回收, 也可能提前被回收, - // 但 exec_ctx_ 的生命周期一定比 session 短, 因此需要把session的exec_ctx_置空 - // 上层需要保证使用时, 如果提前回收 session, 要把 tb_ctx 的绑定 session_guard 设置为空指针 - // 此处只要判断sess_guard不为空, 我们可以认为上层还没有主动析构 session + // session may be recycled by other threads, or it may be recycled prematurely, + // But the lifecycle of exec_ctx_ is definitely shorter than that of session, therefore, we need to set session's exec_ctx_ to null + // The upper layer needs to ensure that if the session is recycled in advance, the bound session_guard of tb_ctx should be set to a null pointer + // Here we only need to check if sess_guard is not null, we can consider that the upper layer has not proactively destructed the session if (OB_NOT_NULL(get_sess_guard())) { typedef ObSQLSessionInfo::ExecCtxSessionRegister MyExecCtxSessionRegister; MyExecCtxSessionRegister ctx_unregister(get_session_info(), nullptr); @@ -601,7 +604,7 @@ class ObTableCtx // for auto inc OB_INLINE bool need_auto_inc_expr() { - // delete/update/get/scan操作只需要生成列引用表达式 + // delete/update/get/scan operation only needs to generate column reference expressions return has_auto_inc_ && operation_type_ != ObTableOperationType::DEL && operation_type_ != ObTableOperationType::UPDATE @@ -652,7 +655,7 @@ class ObTableCtx return ttl_definition_; } public: - // 基于 table name 初始化common部分(不包括expr_info_, exec_ctx_) + // Initialize common part based on table name (excluding expr_info_, exec_ctx_) int init_common(ObTableApiCredential &credential, const common::ObTabletID &arg_tablet_id, const int64_t &timeout_ts); @@ -660,32 +663,32 @@ class ObTableCtx const ObTabletID &arg_tablet_id, const int64_t &timeout_ts); int check_tablet_id_valid(); - // 初始化 insert 相关 + // Initialize insert related int init_insert(); // init put int init_put(bool allow_insup = false); - // 初始化scan相关(不包括表达分类) + // Initialize scan related (excluding expression classification) int init_scan(const ObTableQuery &query, const bool &is_wead_read, const uint64_t arg_table_id, bool skip_get_ls = false); - // 初始化update相关 + // Initialize update related int init_update(); - // 初始化delete相关 + // Initialize delete related int init_delete(); - // 初始化replace相关 + // Initialize replace related int init_replace(); - // 初始化insert_up相关 + // Initialize insert_up related int init_insert_up(bool is_client_set_put); - // 初始化get相关 + // Initialize get related int init_get(); - // 初始化increment相关 + // Initialize increment related int init_increment(bool return_affected_entity, bool return_rowkey); - // 初始化append相关 + // Initialize append related int init_append(bool return_affected_entity, bool return_rowkey); - // 分类扫描相关表达式 + // Classification scan related expressions int classify_scan_exprs(); - // 初始化exec_ctx_和exec_ctx_.das_ctx_ + // Initialize exec_ctx_ and exec_ctx_.das_ctx_ int init_exec_ctx(bool need_das_ctx = true); // init exec_ctx_.my_session_.tx_desc_ int init_trans(transaction::ObTxDesc *trans_desc, @@ -693,7 +696,7 @@ class ObTableCtx int init_das_context(ObDASCtx &das_ctx); int init_related_tablet_map(ObDASCtx &das_ctx); void init_physical_plan_ctx(int64_t timeout_ts, int64_t tenant_schema_version); - // 更新全局自增值 + // Update global auto-increment value int update_auto_inc_value(); // init table context for ttl operation bool is_ttl_table() const { return is_ttl_table_; } @@ -718,9 +721,9 @@ class ObTableCtx // only use for fts scan cg stage int prepare_text_retrieval_scan(); public: - // convert lob的allocator需要保证obj写入表达式后才能析构 + // convert lob's allocator needs to ensure obj is written to the expression before it is destructed static int convert_lob(common::ObIAllocator &allocator, ObObj &obj); - // read lob的allocator需要保证obj序列化到rpc buffer后才能析构 + // the allocator for reading lob must ensure that obj is serialized into the rpc buffer before it is destructed static int read_real_lob(common::ObIAllocator &allocator, ObObj &obj); int adjust_entity(); int adjust_column_type(const ObTableColumnInfo &column_info, ObObj &ob); @@ -770,7 +773,7 @@ class ObTableCtx int init_schema_info_from_cache(); int adjust_rowkey(); int adjust_properties(); - // 获取索引表的tablet_id + // Get the tablet_id from the index table int get_related_tablet_id(const share::schema::ObTableSchema &index_schema, common::ObTabletID &related_tablet_id); // for fulltext index @@ -820,11 +823,11 @@ class ObTableCtx common::ObSEArray index_exprs_; common::ObSEArray filter_exprs_; common::ObSEArray pushdown_aggr_exprs_; - common::ObSEArray select_col_ids_; // 基于schema序的select column id - common::ObSEArray query_col_ids_; // 用户查询的select column id - common::ObSEArray query_col_names_; // 用户查询的select column name,引用的是schema上的列名 + common::ObSEArray select_col_ids_; // select column id based on schema order + common::ObSEArray query_col_ids_; // user queried select column id + common::ObSEArray query_col_names_; // user queried select column name, referencing the column names on the schema common::ObSEArray index_col_ids_; - common::ObSEArray table_index_info_; // 用于记录主表和全局索引表信息 + common::ObSEArray table_index_info_; // Used to record information about the main table and global index tables const share::schema::ObTableSchema *index_schema_; int64_t offset_; int64_t limit_; diff --git a/src/observer/table/ob_table_delete_executor.cpp b/src/observer/table/ob_table_delete_executor.cpp index 18999049c..f97ed02c6 100644 --- a/src/observer/table/ob_table_delete_executor.cpp +++ b/src/observer/table/ob_table_delete_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -217,7 +221,7 @@ int ObTableApiDeleteExecutor::get_next_row() } int tmp_ret = ret; - if (OB_FAIL(child_->close())) { // 需要写到das后才close child算子,否则扫描的行已经被析构 + if (OB_FAIL(child_->close())) { // need to write to das before closing the child operator, otherwise the scanned rows have been destructed LOG_WARN("fail to close scan executor", K(ret)); } ret = OB_SUCC(tmp_ret) ? ret : tmp_ret; @@ -250,4 +254,4 @@ int ObTableApiDeleteExecutor::close() } } // namespace table -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table/ob_table_delete_executor.h b/src/observer/table/ob_table_delete_executor.h index b39dcc734..513f75ff1 100644 --- a/src/observer/table/ob_table_delete_executor.h +++ b/src/observer/table/ob_table_delete_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_DELETE_EXECUTOR_H @@ -87,4 +91,4 @@ class ObTableApiDeleteExecutor : public ObTableApiModifyExecutor } // namespace table } // namespace oceanbase -#endif /* OCEANBASE_OBSERVER_OB_TABLE_DELETE_EXECUTOR_H */ \ No newline at end of file +#endif /* OCEANBASE_OBSERVER_OB_TABLE_DELETE_EXECUTOR_H */ diff --git a/src/observer/table/ob_table_direct_load_processor.cpp b/src/observer/table/ob_table_direct_load_processor.cpp index 69706d2ef..2b0a22ae5 100644 --- a/src/observer/table/ob_table_direct_load_processor.cpp +++ b/src/observer/table/ob_table_direct_load_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_direct_load_processor.h b/src/observer/table/ob_table_direct_load_processor.h index 285f621c7..be3da6087 100644 --- a/src/observer/table/ob_table_direct_load_processor.h +++ b/src/observer/table/ob_table_direct_load_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table/ob_table_end_trans_cb.cpp b/src/observer/table/ob_table_end_trans_cb.cpp index e4b2c59c9..26bc4d574 100644 --- a/src/observer/table/ob_table_end_trans_cb.cpp +++ b/src/observer/table/ob_table_end_trans_cb.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_end_trans_cb.h b/src/observer/table/ob_table_end_trans_cb.h index c5e062d69..06e5006bf 100644 --- a/src/observer/table/ob_table_end_trans_cb.h +++ b/src/observer/table/ob_table_end_trans_cb.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_END_TRANS_CB_H diff --git a/src/observer/table/ob_table_execute_processor.cpp b/src/observer/table/ob_table_execute_processor.cpp index 9712d1ef8..85a806c52 100644 --- a/src/observer/table/ob_table_execute_processor.cpp +++ b/src/observer/table/ob_table_execute_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_execute_processor.h b/src/observer/table/ob_table_execute_processor.h index 992a47141..3df7650a6 100644 --- a/src/observer/table/ob_table_execute_processor.h +++ b/src/observer/table/ob_table_execute_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_EXECUTE_PROCESSOR_H diff --git a/src/observer/table/ob_table_executor.cpp b/src/observer/table/ob_table_executor.cpp index f44b3fde4..6259ab22c 100644 --- a/src/observer/table/ob_table_executor.cpp +++ b/src/observer/table/ob_table_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -84,4 +88,4 @@ void ObTableApiExecutor::clear_evaluated_flag() } } // namespace table -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table/ob_table_executor.h b/src/observer/table/ob_table_executor.h index 9b23e7fe4..558b1e215 100644 --- a/src/observer/table/ob_table_executor.h +++ b/src/observer/table/ob_table_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_EXECUTOR_H @@ -116,4 +120,4 @@ struct ObTableApiDmlBaseCtDef } // end namespace table } // end namespace oceanbase -#endif /* OCEANBASE_OBSERVER_OB_TABLE_EXECUTOR_H */ \ No newline at end of file +#endif /* OCEANBASE_OBSERVER_OB_TABLE_EXECUTOR_H */ diff --git a/src/observer/table/ob_table_executor_factory.cpp b/src/observer/table/ob_table_executor_factory.cpp index c0e8126ab..cc9b4d63a 100644 --- a/src/observer/table/ob_table_executor_factory.cpp +++ b/src/observer/table/ob_table_executor_factory.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -161,4 +165,4 @@ int ObTableExecutorFactory::generate_spec(ObIAllocator &alloc, } } // namespace table -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table/ob_table_executor_factory.h b/src/observer/table/ob_table_executor_factory.h index 90932fb79..621aab6ea 100644 --- a/src/observer/table/ob_table_executor_factory.h +++ b/src/observer/table/ob_table_executor_factory.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_EXECUTOR_FACTORY_H @@ -53,4 +57,4 @@ class ObTableExecutorFactory } // end namespace table } // end namespace oceanbase -#endif // OCEANBASE_OBSERVER_OB_TABLE_EXECUTOR_FACTORY_H \ No newline at end of file +#endif // OCEANBASE_OBSERVER_OB_TABLE_EXECUTOR_FACTORY_H diff --git a/src/observer/table/ob_table_executor_reg.h b/src/observer/table/ob_table_executor_reg.h index 83a77ed70..0ac224bab 100644 --- a/src/observer/table/ob_table_executor_reg.h +++ b/src/observer/table/ob_table_executor_reg.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_EXECUTOR_REG_H diff --git a/src/observer/table/ob_table_filter.cpp b/src/observer/table/ob_table_filter.cpp index 06c86db34..c73145f4e 100644 --- a/src/observer/table/ob_table_filter.cpp +++ b/src/observer/table/ob_table_filter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER #include "ob_table_filter.h" @@ -652,4 +656,4 @@ int ObTableFilterOperator::get_normal_result(table::ObTableQueryResult *&next_re } return ret; -} \ No newline at end of file +} diff --git a/src/observer/table/ob_table_filter.h b/src/observer/table/ob_table_filter.h index dc9012cff..42f42e55f 100644 --- a/src/observer/table/ob_table_filter.h +++ b/src/observer/table/ob_table_filter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_FILTERS_H #define _OB_TABLE_FILTERS_H 1 diff --git a/src/observer/table/ob_table_global_index_lookup_executor.cpp b/src/observer/table/ob_table_global_index_lookup_executor.cpp index d4c6bf90c..402375b91 100644 --- a/src/observer/table/ob_table_global_index_lookup_executor.cpp +++ b/src/observer/table/ob_table_global_index_lookup_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -288,4 +292,4 @@ int ObTableGlobalIndexLookupExecutor::process_data_table_rowkeys(const int64_t s } } // namespace table -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table/ob_table_global_index_lookup_executor.h b/src/observer/table/ob_table_global_index_lookup_executor.h index 71403d240..98f7758cd 100644 --- a/src/observer/table/ob_table_global_index_lookup_executor.h +++ b/src/observer/table/ob_table_global_index_lookup_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_TABLE_GLOBAL_INDEX_LOOKUP_EXECUTOR_H_ diff --git a/src/observer/table/ob_table_insert_executor.cpp b/src/observer/table/ob_table_insert_executor.cpp index 2f13d3724..0a954f9b4 100644 --- a/src/observer/table/ob_table_insert_executor.cpp +++ b/src/observer/table/ob_table_insert_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -203,7 +207,7 @@ int ObTableApiInsertExecutor::ins_rows_post_proc() LOG_WARN("fail to execute all insert das task", K(ret)); } else { affected_rows_ = 1; - // auto inc 操作中, 同步全局自增值value + // auto inc operation, synchronize global auto increment value if (tb_ctx_.has_auto_inc() && OB_FAIL(tb_ctx_.update_auto_inc_value())) { LOG_WARN("fail to update auto inc value", K(ret)); } diff --git a/src/observer/table/ob_table_insert_executor.h b/src/observer/table/ob_table_insert_executor.h index d1d1a552b..7298a07a6 100644 --- a/src/observer/table/ob_table_insert_executor.h +++ b/src/observer/table/ob_table_insert_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_INSERT_EXECUTOR_H @@ -73,4 +77,4 @@ class ObTableApiInsertExecutor : public ObTableApiModifyExecutor } // namespace table } // namespace oceanbase -#endif /* OCEANBASE_OBSERVER_OB_TABLE_INSERT_EXECUTOR_H */ \ No newline at end of file +#endif /* OCEANBASE_OBSERVER_OB_TABLE_INSERT_EXECUTOR_H */ diff --git a/src/observer/table/ob_table_insert_up_executor.cpp b/src/observer/table/ob_table_insert_up_executor.cpp index e915bfb88..9917b0236 100644 --- a/src/observer/table/ob_table_insert_up_executor.cpp +++ b/src/observer/table/ob_table_insert_up_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -240,14 +244,13 @@ int ObTableApiInsertUpExecutor::try_update_row() int ObTableApiInsertUpExecutor::reset_das_env() { int ret = OB_SUCCESS; - // 释放第一次try insert的das task + // release the das task from the first try insert if (OB_FAIL(dml_rtctx_.das_ref_.close_all_task())) { LOG_WARN("fail to close all das task", K(ret)); } else { dml_rtctx_.das_ref_.reuse(); } - - // 因为第二次插入不需要fetch conflict result了 + // Because the second insertion does not need to fetch conflict result anymore for (int64_t i = 0; OB_SUCC(ret) && i < insert_up_rtdefs_.count(); i++) { ObTableInsRtDef &ins_rtdef = insert_up_rtdefs_.at(i).ins_rtdef_; ins_rtdef.das_rtdef_.need_fetch_conflict_ = false; @@ -272,15 +275,14 @@ int ObTableApiInsertUpExecutor::cache_insert_row() return ret; } - -// 通过主键在conflict_checker_中找到冲突旧行,执行更新 -// 注意,这里更新后还可能出现二级索引冲突,eg: +// Find the conflicting row in conflict_checker_ by primary key and perform an update +// Note, secondary index conflicts may still occur after this update, eg: // create table t (C1 int, C2 varchar(10), primary key(C1), UNIQUE KEY idx_c2 (C2)); // insert into t values (1, 1); // insert into t values (2, 2); // client.insert_up('C1','C2').VALUES(1,2); -// 1. 首先执行insert,冲突,返回冲突行(1,1) -// 2. 然后执行到这个函数,执行update, +// 1. First execute insert, conflict, return conflicting row (1,1) +// 2. Then execute this function, execute update, int ObTableApiInsertUpExecutor::do_insert_up_cache() { int ret = OB_SUCCESS; @@ -420,10 +422,10 @@ int ObTableApiInsertUpExecutor::do_update(const ObConflictValue &constraint_valu int ret = OB_SUCCESS; if (constraint_value.new_row_source_ == ObNewRowSource::FROM_UPDATE) { - // current_datum_row_ 是update的new_row + // current_datum_row_ is the new_row for update if (NULL != constraint_value.baseline_datum_row_ && NULL != constraint_value.current_datum_row_) { - // base_line 和 curr_row 都存在 + // base_line and curr_row both exist if (OB_FAIL(stored_row_to_exprs(*constraint_value.baseline_datum_row_, get_primary_table_upd_old_row(), eval_ctx_))) { @@ -441,7 +443,7 @@ int ObTableApiInsertUpExecutor::do_update(const ObConflictValue &constraint_valu } } } else if (NULL == constraint_value.baseline_datum_row_ && - NULL != constraint_value.current_datum_row_) { // 单单是唯一索引冲突的时候,会走这个分支 + NULL != constraint_value.current_datum_row_) { // This branch is taken only when there is a unique index conflict OZ(to_expr_skip_old(*constraint_value.current_datum_row_, insert_up_spec_.get_ctdefs().at(0)->upd_ctdef_)); OZ(insert_upd_new_row_to_das()); @@ -505,10 +507,10 @@ int ObTableApiInsertUpExecutor::get_next_row() } else if (OB_FAIL(fetch_conflict_rowkey(conflict_checker_))) { LOG_WARN("fail to fetch conflict row", K(ret)); } else if (OB_FAIL(reset_das_env())) { - // 这里需要reuse das 相关信息 + // Here we need to reuse das related information LOG_WARN("fail to reset das env", K(ret)); } else if (OB_FAIL(ObSqlTransControl::rollback_savepoint(exec_ctx_, savepoint_no))) { - // 本次插入存在冲突, 回滚到save_point + // This insertion has conflicts, rollback to save_point LOG_WARN("fail to rollback to save_point", K(ret)); } else if (OB_FAIL(try_update_row())) { LOG_WARN("fail to try update row", K(ret)); @@ -516,7 +518,7 @@ int ObTableApiInsertUpExecutor::get_next_row() if (OB_SUCC(ret)) { affected_rows_ += insert_rows_ + insert_up_rtdefs_.at(0).upd_rtdef_.found_rows_; - // auto inc 操作中, 同步全局自增值value + // auto inc operation, synchronize global auto increment value if (tb_ctx_.has_auto_inc() && OB_FAIL(tb_ctx_.update_auto_inc_value())) { LOG_WARN("fail to update auto inc value", K(ret)); } diff --git a/src/observer/table/ob_table_insert_up_executor.h b/src/observer/table/ob_table_insert_up_executor.h index 69e554493..2f07aab25 100644 --- a/src/observer/table/ob_table_insert_up_executor.h +++ b/src/observer/table/ob_table_insert_up_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_INSERT_UP_EXECUTOR_H diff --git a/src/observer/table/ob_table_lock_executor.cpp b/src/observer/table/ob_table_lock_executor.cpp index 175a9c185..725a866f6 100644 --- a/src/observer/table/ob_table_lock_executor.cpp +++ b/src/observer/table/ob_table_lock_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_lock_executor.h b/src/observer/table/ob_table_lock_executor.h index 7e1859b41..a2f82b098 100644 --- a/src/observer/table/ob_table_lock_executor.h +++ b/src/observer/table/ob_table_lock_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_LOCK_EXECUTOR_H @@ -77,4 +81,4 @@ class ObTableApiLockExecutor : public ObTableApiModifyExecutor } // end namespace table } // end namespace oceanbase -#endif /* OCEANBASE_OBSERVER_OB_TABLE_LOCK_EXECUTOR_H */ \ No newline at end of file +#endif /* OCEANBASE_OBSERVER_OB_TABLE_LOCK_EXECUTOR_H */ diff --git a/src/observer/table/ob_table_ls_execute_processor.cpp b/src/observer/table/ob_table_ls_execute_processor.cpp index 21478e7bf..13bf1b32a 100644 --- a/src/observer/table/ob_table_ls_execute_processor.cpp +++ b/src/observer/table/ob_table_ls_execute_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -198,7 +202,7 @@ int ObTableLSExecuteP::LSExecuteIter::init_batch_ctx(uint64_t table_id, batch_ctx.tb_ctx_))) { LOG_WARN("fail to init table context", K(ret)); } else { - // 构造batch_service需要的入参 + // Construct the parameters required for batch_service batch_ctx.trans_param_ = &outer_exectute_process_.trans_param_; batch_ctx.consistency_level_ = outer_exectute_process_.arg_.consistency_level_; batch_ctx.table_id_ = table_id; @@ -1047,7 +1051,7 @@ int ObTableLSExecuteP::old_try_process() bool need_all_prop = ls_op.need_all_prop_bitmap(); table_id_ = table_id; // init move response need ObTableLSOpResult *cb_result = nullptr; - observer::ObReqTimeGuard req_timeinfo_guard; // 引用cache资源必须加ObReqTimeGuard + observer::ObReqTimeGuard req_timeinfo_guard; // Reference cache resources must add ObReqTimeGuard bool is_hkv = ObTableEntityType::ET_HKV == arg_.entity_type_; if (OB_FAIL(create_cb_result())) { LOG_WARN("fail to create cb result", K(ret)); diff --git a/src/observer/table/ob_table_ls_execute_processor.h b/src/observer/table/ob_table_ls_execute_processor.h index 9e5abf067..9ea2e52d5 100644 --- a/src/observer/table/ob_table_ls_execute_processor.h +++ b/src/observer/table/ob_table_ls_execute_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_LS_EXECUTE_PROCESSOR_H diff --git a/src/observer/table/ob_table_merge_filter.cpp b/src/observer/table/ob_table_merge_filter.cpp index 807910673..8b9b3c771 100644 --- a/src/observer/table/ob_table_merge_filter.cpp +++ b/src/observer/table/ob_table_merge_filter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_merge_filter.h b/src/observer/table/ob_table_merge_filter.h index bfe5dffa3..0c8314360 100644 --- a/src/observer/table/ob_table_merge_filter.h +++ b/src/observer/table/ob_table_merge_filter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/src/observer/table/ob_table_meta_handler.cpp b/src/observer/table/ob_table_meta_handler.cpp index 0f1a47eff..8c40b7d75 100644 --- a/src/observer/table/ob_table_meta_handler.cpp +++ b/src/observer/table/ob_table_meta_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ @@ -283,7 +287,7 @@ int ObHTableRegionLocatorHandler::try_compress(ObTableMetaResponse &response) ["127.0.0.3", 2883] ], "partitions": [ - // 表1001的3个分区,每个分区3副本 + // 3 partitions of table 1001, each partition with 3 replicas [0, 50001, "rowkey_1", 0, 1], // leader [0, 50001, "rowkey_1", 1, 0], // follower [0, 50001, "rowkey_1", 2, 0], // follower @@ -294,7 +298,7 @@ int ObHTableRegionLocatorHandler::try_compress(ObTableMetaResponse &response) [0, 50003, "rowkey_3", 1, 0], [0, 50003, "rowkey_3", 2, 0], - // 表1002的3个分区,每个分区3副本 + // 3 partitions of table 1002, each partition with 3 replicas [1, 50004, "rowkey_1", 0, 1], [1, 50004, "rowkey_1", 1, 0], [1, 50004, "rowkey_1", 2, 0], diff --git a/src/observer/table/ob_table_meta_handler.h b/src/observer/table/ob_table_meta_handler.h index 044656a45..952d1bca4 100644 --- a/src/observer/table/ob_table_meta_handler.h +++ b/src/observer/table/ob_table_meta_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OBSERVER_TABLE_OB_TABLE_META_HANDLER_H_ diff --git a/src/observer/table/ob_table_meta_processor.cpp b/src/observer/table/ob_table_meta_processor.cpp index 973be7200..9b18b527c 100644 --- a/src/observer/table/ob_table_meta_processor.cpp +++ b/src/observer/table/ob_table_meta_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_meta_processor.h b/src/observer/table/ob_table_meta_processor.h index a74b471b9..423183cb0 100644 --- a/src/observer/table/ob_table_meta_processor.h +++ b/src/observer/table/ob_table_meta_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_META_PROCESSOR_H diff --git a/src/observer/table/ob_table_mode_control.cpp b/src/observer/table/ob_table_mode_control.cpp index 3e3f8c461..a12e21a69 100644 --- a/src/observer/table/ob_table_mode_control.cpp +++ b/src/observer/table/ob_table_mode_control.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_mode_control.h b/src/observer/table/ob_table_mode_control.h index 12c0d8168..aaef94db7 100644 --- a/src/observer/table/ob_table_mode_control.h +++ b/src/observer/table/ob_table_mode_control.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_MODE_CONTROL_H #define _OB_TABLE_MODE_CONTROL_H @@ -35,4 +39,4 @@ class ObTableModeCtrl } // end namespace table } // end namespace oceanbase -#endif /* _OB_TABLE_MODE_CONTROL_H */ \ No newline at end of file +#endif /* _OB_TABLE_MODE_CONTROL_H */ diff --git a/src/observer/table/ob_table_modify_executor.cpp b/src/observer/table/ob_table_modify_executor.cpp index 352404e3a..fca23ea8b 100644 --- a/src/observer/table/ob_table_modify_executor.cpp +++ b/src/observer/table/ob_table_modify_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_modify_executor.h b/src/observer/table/ob_table_modify_executor.h index 61d73ddcc..0044604df 100644 --- a/src/observer/table/ob_table_modify_executor.h +++ b/src/observer/table/ob_table_modify_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_MODIFY_EXECUTOR_H @@ -21,7 +25,7 @@ namespace oceanbase { namespace table { -// todo@dazhi: 编译需要,后续修改 dml_rtctx 中的 modify op 引用为指针之后会移除 +// todo@dazhi: Compilation required, will be removed after modifying the modify op reference to a pointer in dml_rtctx static sql::ObTableModifyOp& get_fake_modify_op() { static common::ObArenaAllocator alloc; @@ -30,8 +34,8 @@ static sql::ObTableModifyOp& get_fake_modify_op() static sql::ObExecContext exec_ctx(alloc); static sql::ObSQLSessionInfo session; exec_ctx.set_my_session(&session); - static sql::ObTableInsertOpInput input(exec_ctx, op_spec); // ObDMLService::init_das_dml_rtdef 需要 - static sql::ObPhysicalPlan phy_plan; // ObDMLService::init_das_dml_rtdef 需要 + static sql::ObTableInsertOpInput input(exec_ctx, op_spec); // ObDMLService::init_das_dml_rtdef requires + static sql::ObPhysicalPlan phy_plan; // ObDMLService::init_das_dml_rtdef requires phy_plan.set_plan_type(OB_PHY_PLAN_LOCAL); op_spec.plan_ = &phy_plan; static sql::ObTableInsertOp ins_op(exec_ctx, op_spec, &input); diff --git a/src/observer/table/ob_table_move_response.cpp b/src/observer/table/ob_table_move_response.cpp index dacbbd32f..63c08bd04 100644 --- a/src/observer/table/ob_table_move_response.cpp +++ b/src/observer/table/ob_table_move_response.cpp @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define USING_LOG_PREFIX SERVER #include "ob_table_move_response.h" @@ -26,7 +30,7 @@ int ObTableMoveResponseSender::get_replica(const uint64_t table_id, { int ret = OB_SUCCESS; bool is_cache_hit = false; - int64_t expire_renew_time = INT64_MAX; //对于get接口,需要传一个最大值,表示需要拿最新的location cache,并让老的失效掉 + int64_t expire_renew_time = INT64_MAX; // For the get interface, a maximum value needs to be passed, indicating that the latest location cache should be retrieved and the old one invalidated share::ObLSID ls_id; share::ObLSLocation ls_loc; share::ObLSReplicaLocation replica_loc; diff --git a/src/observer/table/ob_table_move_response.h b/src/observer/table/ob_table_move_response.h index c200ee366..47c9aabd8 100644 --- a/src/observer/table/ob_table_move_response.h +++ b/src/observer/table/ob_table_move_response.h @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #ifndef _OB_TABLE_MOVE_RESPONSE_H #define _OB_TABLE_MOVE_RESPONSE_H 1 diff --git a/src/observer/table/ob_table_multi_batch_common.cpp b/src/observer/table/ob_table_multi_batch_common.cpp index fac954c11..94612adf3 100644 --- a/src/observer/table/ob_table_multi_batch_common.cpp +++ b/src/observer/table/ob_table_multi_batch_common.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_multi_batch_common.h b/src/observer/table/ob_table_multi_batch_common.h index 68b04e8ad..4700818fd 100644 --- a/src/observer/table/ob_table_multi_batch_common.h +++ b/src/observer/table/ob_table_multi_batch_common.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_MULTI_BATCH_COMMON_H diff --git a/src/observer/table/ob_table_multi_batch_service.cpp b/src/observer/table/ob_table_multi_batch_service.cpp index ca069ddd7..389b7f0fd 100644 --- a/src/observer/table/ob_table_multi_batch_service.cpp +++ b/src/observer/table/ob_table_multi_batch_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_multi_batch_service.h b/src/observer/table/ob_table_multi_batch_service.h index ba081b11c..8f008bd40 100644 --- a/src/observer/table/ob_table_multi_batch_service.h +++ b/src/observer/table/ob_table_multi_batch_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_MULTI_BATCH_SERVICE_H diff --git a/src/observer/table/ob_table_old_merge_filter.h b/src/observer/table/ob_table_old_merge_filter.h index 51c3abadd..78bbf1aa0 100644 --- a/src/observer/table/ob_table_old_merge_filter.h +++ b/src/observer/table/ob_table_old_merge_filter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ @@ -448,4 +452,3 @@ } // end namespace oceanbase #endif /* _OB_TABLE_OLD_MERGE_FILTERS_H */ - \ No newline at end of file diff --git a/src/observer/table/ob_table_op_wrapper.cpp b/src/observer/table/ob_table_op_wrapper.cpp index 5665a9269..c9cbbc63e 100644 --- a/src/observer/table/ob_table_op_wrapper.cpp +++ b/src/observer/table/ob_table_op_wrapper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_op_wrapper.h b/src/observer/table/ob_table_op_wrapper.h index 580ac62c4..60c2be52c 100644 --- a/src/observer/table/ob_table_op_wrapper.h +++ b/src/observer/table/ob_table_op_wrapper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_OP_WARPPER_H_ @@ -141,4 +145,4 @@ class ObHTableDeleteExecutor } // end namespace table } // end namespace oceanbase -#endif /* OCEANBASE_OBSERVER_OB_TABLE_OP_WRAPPER_H_ */ \ No newline at end of file +#endif /* OCEANBASE_OBSERVER_OB_TABLE_OP_WRAPPER_H_ */ diff --git a/src/observer/table/ob_table_process_type.h b/src/observer/table/ob_table_process_type.h index 0b65cd2f1..38624f81f 100644 --- a/src/observer/table/ob_table_process_type.h +++ b/src/observer/table/ob_table_process_type.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_PROCESS_TYPE_H diff --git a/src/observer/table/ob_table_query_and_mutate_helper.cpp b/src/observer/table/ob_table_query_and_mutate_helper.cpp index 05b0992c9..5715c3d73 100644 --- a/src/observer/table/ob_table_query_and_mutate_helper.cpp +++ b/src/observer/table/ob_table_query_and_mutate_helper.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -157,7 +161,7 @@ int QueryAndMutateHelper::execute_htable_delete(const ObTableOperation &table_op simple_table_schema_->get_table_name_str(), &audit_ctx_, table_operation); const ObITableEntity &entity = table_operation.entity(); - observer::ObReqTimeGuard req_timeinfo_guard; // 引用cache资源必须加ObReqTimeGuard + observer::ObReqTimeGuard req_timeinfo_guard; // Reference to cache resources must add ObReqTimeGuard ObTableApiCacheGuard cache_guard; ObTableApiExecutor *executor = nullptr; ObTableApiSpec *spec = nullptr; @@ -380,7 +384,7 @@ int QueryAndMutateHelper::generate_new_value(const ObITableEntity *old_entity, if (ObHTableConstants::LATEST_TIMESTAMP == new_ts) { new_ts = now_ms; } - if (OB_NOT_NULL(old_entity)) { // 旧行存在,构造新值(base + delta) + if (OB_NOT_NULL(old_entity)) { // The old row exists, construct new value (base + delta) ObObj base_obj_t, base_obj_v; if (OB_FAIL(old_entity->get_rowkey_value(ObHTableConstants::COL_IDX_T, base_obj_t))) { LOG_WARN("failed to get timestamp", K(ret), K(old_entity)); @@ -485,9 +489,8 @@ int QueryAndMutateHelper::generate_new_value(const ObITableEntity *old_entity, return ret; } - -// 1. 执行query获取到最新版本旧行的V -// 2. 基于旧V执行mutate +// 1. Execute query to get the V of the latest version of the row +// 2. Based on old V execute mutate int QueryAndMutateHelper::execute_htable_inc_or_append(ObTableQueryResult *result) { int ret = OB_SUCCESS; @@ -732,7 +735,7 @@ int QueryAndMutateHelper::execute_one_mutation(ObIAllocator &allocator, const int64_t N = rk_names.count(); bool is_check_and_insert = (mutation.type() == ObTableOperationType::INSERT); - // 判断是否为check and insert 操作 + // Determine if it is a check and insert operation if (mutate_entity.get_rowkey_size() > 0 && !is_check_and_insert) { ret = OB_ERR_UNEXPECTED; LOG_WARN("do not set mutation rowkey in query_and_mutate, invalid mutation", K(ret), K(mutation)); @@ -746,7 +749,7 @@ int QueryAndMutateHelper::execute_one_mutation(ObIAllocator &allocator, while (OB_SUCC(ret) && OB_SUCC(one_result.get_next_entity(query_res_entity))) { // 1. construct new entity if (is_check_and_insert) { - end_in_advance = true; // 若为check and insert, 则无需构造new_entity, 由于只插入一次, 故提前终止 + end_in_advance = true; // If it is check and insert, then there is no need to construct new_entity, as it is only inserted once, hence terminate in advance } else if (OB_ISNULL(new_entity = default_entity_factory_.alloc())) { ret = OB_ALLOCATE_MEMORY_FAILED; LOG_WARN("fail to alloc entity", K(ret)); @@ -792,7 +795,7 @@ int QueryAndMutateHelper::execute_one_mutation(ObIAllocator &allocator, } break; } - case ObTableOperationType::INSERT: { // 使用mutation上的entity执行insert + case ObTableOperationType::INSERT: { // use the entity on mutation to execute insert ret = process_insert(mutate_entity, tmp_affect_rows); if (OB_SUCC(ret)) { affected_rows += tmp_affect_rows; @@ -828,7 +831,7 @@ int QueryAndMutateHelper::execute_table_mutation(ObTableQueryResultIterator *res } else { ObTableQueryResult *one_result = nullptr; bool end_in_advance = false; - while (OB_SUCC(ret) && !end_in_advance) { // 在check and insert 情境下会有提前终止 + while (OB_SUCC(ret) && !end_in_advance) { // In the check and insert scenario, there may be an early termination OB_TABLE_START_AUDIT(credential_, *tb_ctx_.get_sess_guard(), tb_ctx_.get_table_name(), @@ -881,7 +884,7 @@ int QueryAndMutateHelper::execute_table_mutation(ObTableQueryResultIterator *res int QueryAndMutateHelper::execute_query_and_mutate() { int ret = OB_SUCCESS; - observer::ObReqTimeGuard req_timeinfo_guard; // 引用cache资源必须加ObReqTimeGuard + observer::ObReqTimeGuard req_timeinfo_guard; // Reference cache resources must add ObReqTimeGuard ObTableApiCacheGuard cache_guard; ObTableApiSpec *scan_spec = nullptr; set_result_affected_rows(0); @@ -1025,4 +1028,4 @@ int QueryAndMutateHelper::check_and_execute(ObTableQueryResultIterator *result_i #endif return ret; -} \ No newline at end of file +} diff --git a/src/observer/table/ob_table_query_and_mutate_helper.h b/src/observer/table/ob_table_query_and_mutate_helper.h index af6ce6f19..0d93d7002 100644 --- a/src/observer/table/ob_table_query_and_mutate_helper.h +++ b/src/observer/table/ob_table_query_and_mutate_helper.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_QUERY_AND_MUTATE_HELPER_H diff --git a/src/observer/table/ob_table_query_and_mutate_processor.cpp b/src/observer/table/ob_table_query_and_mutate_processor.cpp index 214a0ad4a..9a69d8e33 100644 --- a/src/observer/table/ob_table_query_and_mutate_processor.cpp +++ b/src/observer/table/ob_table_query_and_mutate_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -330,4 +334,4 @@ bool ObTableQueryAndMutateP::is_new_try_process() return arg_.entity_type_ == ObTableEntityType::ET_HKV && !arg_.tablet_id_.is_valid() && TABLEAPI_OBJECT_POOL_MGR->is_support_distributed_execute(); -} \ No newline at end of file +} diff --git a/src/observer/table/ob_table_query_and_mutate_processor.h b/src/observer/table/ob_table_query_and_mutate_processor.h index 03415eb20..0c8efe1ff 100644 --- a/src/observer/table/ob_table_query_and_mutate_processor.h +++ b/src/observer/table/ob_table_query_and_mutate_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_QUERY_AND_MUTATE_PROCESSOR_H @@ -55,7 +59,7 @@ class ObTableQueryAndMutateP: public ObTableRpcProcessor default_entity_factory_; table::ObTableQueryResult one_result_; - bool end_in_advance_; // 提前终止标志 + bool end_in_advance_; // flag for early termination DISALLOW_COPY_AND_ASSIGN(ObTableQueryAndMutateP); }; } // end namespace observer diff --git a/src/observer/table/ob_table_query_async_processor.cpp b/src/observer/table/ob_table_query_async_processor.cpp index bdb2b5076..4803dac4f 100644 --- a/src/observer/table/ob_table_query_async_processor.cpp +++ b/src/observer/table/ob_table_query_async_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -129,7 +133,7 @@ int ObTableQueryAsyncP::init_tb_ctx(ObIAllocator* allocator, ObObjectID tmp_first_level_part_id = OB_INVALID_ID; ObTabletID real_tablet_id; if (tablegroup_req) { - if (query_ctx.part_idx_ == OB_INVALID_INDEX && query_ctx.subpart_idx_ == OB_INVALID_INDEX) { // 非分区表 + if (query_ctx.part_idx_ == OB_INVALID_INDEX && query_ctx.subpart_idx_ == OB_INVALID_INDEX) { // non-partitioned table real_tablet_id = query_info.simple_schema_->get_tablet_id(); } else if (OB_FAIL(query_info.simple_schema_->get_part_id_and_tablet_id_by_idx(query_ctx.part_idx_, query_ctx.subpart_idx_, @@ -637,7 +641,7 @@ int ObTableQueryAsyncP::query_scan_with_init(ObIAllocator *allocator, ObTableQue if (OB_ISNULL(allocator)) { ret = OB_INVALID_ARGUMENT; LOG_WARN("Allocator is NULL", K(ret)); - } else if (OB_FAIL(arg_.query_.deep_copy(*allocator, query))) { // 存储的 key range 是引用,所以这里需要深拷贝 + } else if (OB_FAIL(arg_.query_.deep_copy(*allocator, query))) { // The stored key range is a reference, so a deep copy is needed here LOG_WARN("fail to deep copy query", K(ret), K(arg_.query_)); } else { query_session_->set_req_start_time(common::ObTimeUtility::current_monotonic_time()); @@ -1014,7 +1018,7 @@ int ObTableQueryAsyncP::try_process() int ObTableQueryAsyncP::old_try_process() { int ret = OB_SUCCESS; - observer::ObReqTimeGuard req_timeinfo_guard; // 引用cache资源必须加ObReqTimeGuard + observer::ObReqTimeGuard req_timeinfo_guard; // Reference cache resources must add ObReqTimeGuard if (OB_FAIL(ObTableQueryASyncMgr::check_query_type(arg_.query_type_))) { LOG_WARN("query type is invalid", K(ret), K(arg_.query_type_)); } else if (OB_FAIL(MTL(ObTableQueryASyncMgr*)->get_session_id(query_session_id_, arg_.query_session_id_, arg_.query_type_))) { @@ -1150,4 +1154,4 @@ bool ObTableQueryAsyncP::is_new_try_process() return arg_.entity_type_ == ObTableEntityType::ET_HKV && !arg_.tablet_id_.is_valid() && TABLEAPI_OBJECT_POOL_MGR->is_support_distributed_execute(); -} \ No newline at end of file +} diff --git a/src/observer/table/ob_table_query_async_processor.h b/src/observer/table/ob_table_query_async_processor.h index 6006c3e13..0b81e7801 100644 --- a/src/observer/table/ob_table_query_async_processor.h +++ b/src/observer/table/ob_table_query_async_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_QUERY_ASYNC_PROCESSOR_H diff --git a/src/observer/table/ob_table_query_common.cpp b/src/observer/table/ob_table_query_common.cpp index 0ccf3f823..a680abebb 100644 --- a/src/observer/table/ob_table_query_common.cpp +++ b/src/observer/table/ob_table_query_common.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -341,4 +345,4 @@ int ObTableQueryUtils::get_table_schemas(ObSchemaGetterGuard& schema_guard, } } // end namespace table -} // end namespace oceanbase \ No newline at end of file +} // end namespace oceanbase diff --git a/src/observer/table/ob_table_query_common.h b/src/observer/table/ob_table_query_common.h index eff94632d..9597a3037 100644 --- a/src/observer/table/ob_table_query_common.h +++ b/src/observer/table/ob_table_query_common.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_QUERY_COMMON_H_ @@ -64,4 +68,4 @@ class ObTableQueryUtils } // end namespace table } // end namespace oceanbase -#endif /* OCEANBASE_OBSERVER_OB_TABLE_QUERY_COMMON_H_ */ \ No newline at end of file +#endif /* OCEANBASE_OBSERVER_OB_TABLE_QUERY_COMMON_H_ */ diff --git a/src/observer/table/ob_table_query_processor.cpp b/src/observer/table/ob_table_query_processor.cpp index f78b56542..c74ca9f1b 100644 --- a/src/observer/table/ob_table_query_processor.cpp +++ b/src/observer/table/ob_table_query_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -235,7 +239,7 @@ int ObTableQueryP::old_try_process() int ret = OB_SUCCESS; ObTableApiSpec *spec = nullptr; ObTableApiExecutor *executor = nullptr; - observer::ObReqTimeGuard req_timeinfo_guard; // 引用cache资源必须加ObReqTimeGuard + observer::ObReqTimeGuard req_timeinfo_guard; // Reference cache resources must add ObReqTimeGuard ObTableApiCacheGuard cache_guard; // Tips: when table_name is tablegroup name diff --git a/src/observer/table/ob_table_query_processor.h b/src/observer/table/ob_table_query_processor.h index c5c619797..31ac510d4 100644 --- a/src/observer/table/ob_table_query_processor.h +++ b/src/observer/table/ob_table_query_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_QUERY_PROCESSOR_H diff --git a/src/observer/table/ob_table_replace_executor.cpp b/src/observer/table/ob_table_replace_executor.cpp index 043fc7151..545394b17 100644 --- a/src/observer/table/ob_table_replace_executor.cpp +++ b/src/observer/table/ob_table_replace_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -73,7 +77,7 @@ int ObTableApiReplaceExecutor::generate_replace_rtdefs() replace_rtdef.del_rtdef_))) { LOG_WARN("fail to generate delete rtdef", K(ret)); } else { - replace_rtdef.ins_rtdef_.das_rtdef_.table_loc_->is_writing_ = true; //todo:linjing其他的executor还没有设置is_writting + replace_rtdef.ins_rtdef_.das_rtdef_.table_loc_->is_writing_ = true; //todo:linjing other executors have not set is_writing } } @@ -360,10 +364,10 @@ int ObTableApiReplaceExecutor::get_next_row() } else if (OB_FAIL(fetch_conflict_rowkey(conflict_checker_))) { LOG_WARN("fail to fetch conflict row", K(ret)); } else if (OB_FAIL(reset_das_env())) { - // 这里需要reuse das 相关信息 + // Here we need to reuse das related information LOG_WARN("fail to reset das env", K(ret)); } else if (OB_FAIL(ObSqlTransControl::rollback_savepoint(exec_ctx_, savepoint_no))) { - // 本次插入存在冲突, 回滚到save_point + // This insertion has conflicts, rollback to save_point LOG_WARN("fail to rollback to save_point", K(ret)); } else if (OB_FAIL(conflict_checker_.do_lookup_and_build_base_map(1))) { LOG_WARN("fail to do table lookup", K(ret)); @@ -374,8 +378,8 @@ int ObTableApiReplaceExecutor::get_next_row() } if (OB_SUCC(ret) && !is_iter_end) { - // 只有还有下一个batch时才需要做reuse,如果没有下一个batch,close和destroy中会释放内存 - // 前边逻辑执行成功,这一批batch成功完成replace, reuse环境, 准备下一个batch + // Only need to do reuse if there is a next batch, memory will be released in close and destroy if there is no next batch + // The previous logic executed successfully, this batch has successfully completed replace, reuse environment, prepare for the next batch if (OB_FAIL(reuse())) { LOG_WARN("fail to reuse", K(ret)); } @@ -384,7 +388,7 @@ int ObTableApiReplaceExecutor::get_next_row() if (OB_SUCC(ret)) { affected_rows_ = replace_rtdefs_.at(0).ins_rtdef_.cur_row_num_ + replace_rtdefs_.at(0).del_rtdef_.cur_row_num_; - // auto inc 操作中, 同步全局自增值value + // auto inc operation, synchronize global auto increment value if (tb_ctx_.has_auto_inc() && OB_FAIL(tb_ctx_.update_auto_inc_value())) { LOG_WARN("fail to update auto inc value", K(ret)); } @@ -395,16 +399,14 @@ int ObTableApiReplaceExecutor::get_next_row() int ObTableApiReplaceExecutor::reset_das_env() { int ret = OB_SUCCESS; - - // 释放第一次try insert的das task + // release the das task from the first try insert if (OB_FAIL(dml_rtctx_.das_ref_.close_all_task())) { LOG_WARN("close all das task failed", K(ret)); } else { dml_rtctx_.das_ref_.reuse(); } - - // 因为第二次插入不需要fetch conflict result了,如果有conflict - // 就说明replace into的某些逻辑处理有问题 + // Because the second insertion does not need to fetch conflict result anymore, if there is a conflict + // This indicates that there is a problem with some logic handling of replace into for (int64_t i = 0; i < replace_rtdefs_.count(); i++) { ObTableInsRtDef &ins_rtdef = replace_rtdefs_.at(i).ins_rtdef_; ins_rtdef.das_rtdef_.need_fetch_conflict_ = false; diff --git a/src/observer/table/ob_table_replace_executor.h b/src/observer/table/ob_table_replace_executor.h index 1b3df104c..fd96d4544 100644 --- a/src/observer/table/ob_table_replace_executor.h +++ b/src/observer/table/ob_table_replace_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_TABLE_REPLACE_EXECUTOR_H @@ -111,4 +115,4 @@ class ObTableApiReplaceExecutor : public ObTableApiModifyExecutor } // end namespace table } // end namespace oceanbase -#endif /* OCEANBASE_OBSERVER_TABLE_REPLACE_EXECUTOR_H */ \ No newline at end of file +#endif /* OCEANBASE_OBSERVER_TABLE_REPLACE_EXECUTOR_H */ diff --git a/src/observer/table/ob_table_rpc_processor.cpp b/src/observer/table/ob_table_rpc_processor.cpp index 3d2d85bc6..6c064fa0f 100644 --- a/src/observer/table/ob_table_rpc_processor.cpp +++ b/src/observer/table/ob_table_rpc_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_rpc_processor.h b/src/observer/table/ob_table_rpc_processor.h index 21356e87c..c24636bac 100644 --- a/src/observer/table/ob_table_rpc_processor.h +++ b/src/observer/table/ob_table_rpc_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_RPC_PROCESSOR_H @@ -183,7 +187,7 @@ class ObTableApiProcessorBase share::schema::ObSchemaGetterGuard schema_guard_; const share::schema::ObSimpleTableSchemaV2 *simple_table_schema_; const share::schema::ObTableSchema *table_schema_; - observer::ObReqTimeGuard req_timeinfo_guard_; // 引用cache资源必须加ObReqTimeGuard + observer::ObReqTimeGuard req_timeinfo_guard_; // Reference cache resources must add ObReqTimeGuard table::ObKvSchemaCacheGuard schema_cache_guard_; int32_t stat_process_type_; bool enable_query_response_time_stats_; diff --git a/src/observer/table/ob_table_rpc_processor_util.h b/src/observer/table/ob_table_rpc_processor_util.h index af66bd661..fa8c50b4d 100644 --- a/src/observer/table/ob_table_rpc_processor_util.h +++ b/src/observer/table/ob_table_rpc_processor_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_RPC_PROCESSOR_UTIL_H diff --git a/src/observer/table/ob_table_rpc_response_sender.cpp b/src/observer/table/ob_table_rpc_response_sender.cpp index b670de699..328a2b47b 100644 --- a/src/observer/table/ob_table_rpc_response_sender.cpp +++ b/src/observer/table/ob_table_rpc_response_sender.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_rpc_response_sender.h b/src/observer/table/ob_table_rpc_response_sender.h index 1fcbcf4d0..1f107c761 100644 --- a/src/observer/table/ob_table_rpc_response_sender.h +++ b/src/observer/table/ob_table_rpc_response_sender.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_RPC_RESPONSE_SENDER_H @@ -69,7 +73,7 @@ class ObTableRpcResponseSender private: rpc::ObRequest *req_; table::ObITableResult *result_; - const int exec_ret_code_; // processor执行的返回码 + const int exec_ret_code_; // return code of the processor execution ObRpcPacketCode pcode_; common::ObDataBuffer *using_buffer_; }; diff --git a/src/observer/table/ob_table_scan_executor.cpp b/src/observer/table/ob_table_scan_executor.cpp index 9c10f2d1c..b8adf78be 100644 --- a/src/observer/table/ob_table_scan_executor.cpp +++ b/src/observer/table/ob_table_scan_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -518,7 +522,7 @@ int ObTableApiScanExecutor::check_filter(bool &filter) if (OB_FAIL(exprs.at(i)->eval(eval_ctx_, datum))) { LOG_WARN("fail to eval filter expr", K(ret), K(*exprs.at(i))); } else if (tb_ctx_.is_ttl_table()) { - filter = (!datum->is_null() && datum->get_bool()); // ttl场景下,过期表达式不过滤is_null + filter = (!datum->is_null() && datum->get_bool()); // ttl scenario, expiration expression does not filter is_null } else { filter = datum->get_bool(); } @@ -585,7 +589,7 @@ int ObTableApiScanExecutor::get_next_row_for_tsc() { int ret = OB_SUCCESS; if (0 == get_table_ctx().get_limit()) { - // limit 0,直接返回iter end + // limit 0, directly return iter end ret = OB_ITER_END; } else if (need_do_init_ && OB_FAIL(do_init_before_get_row())) { LOG_WARN("fail to do init before get row", K(ret)); @@ -757,12 +761,12 @@ int ObTableApiScanRowIterator::get_next_row(ObNewRow *&row) ret = OB_ALLOCATE_MEMORY_FAILED; LOG_WARN("fail to alloc cells buffer", K(ret), K(cells_cnt)); } else { - // 循环select_exprs,eval获取datum,并将datum转ObObj,最后组成ObNewRow + // Loop through select_exprs, eval to get datum, and convert datum to ObObj, finally compose ObNewRow tmp_row = new(row_buf)ObNewRow(cells, cells_cnt); ObObj tmp_obj; ObDatum *datum = nullptr; ObEvalCtx &eval_ctx = scan_executor_->get_eval_ctx(); - if (tb_ctx.is_scan()) { // 转为用户select的顺序 + if (tb_ctx.is_scan()) { // Convert to the order of user's select const ObIArray &select_col_ids = tb_ctx.get_select_col_ids(); for (int64_t i = 0; OB_SUCC(ret) && i < query_col_ids.count(); i++) { uint64_t col_id = query_col_ids.at(i); diff --git a/src/observer/table/ob_table_scan_executor.h b/src/observer/table/ob_table_scan_executor.h index 93b62c5c1..48b49bda6 100644 --- a/src/observer/table/ob_table_scan_executor.h +++ b/src/observer/table/ob_table_scan_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_TABLE_OB_TABLE_SCAN_EXECUTOR_H_ diff --git a/src/observer/table/ob_table_schema_cache.cpp b/src/observer/table/ob_table_schema_cache.cpp index 639533129..6553f5e81 100644 --- a/src/observer/table/ob_table_schema_cache.cpp +++ b/src/observer/table/ob_table_schema_cache.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_schema_cache.h b/src/observer/table/ob_table_schema_cache.h index cf68b9fdf..a345a37d6 100644 --- a/src/observer/table/ob_table_schema_cache.h +++ b/src/observer/table/ob_table_schema_cache.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_SCHEMA_CACHE_H_ @@ -337,4 +341,4 @@ class ObKvSchemaCacheGuard } // end namespace table } // end namespace oceanbase -#endif /* OCEANBASE_OBSERVER_OB_TABLE_SCHEMA_CACHE_H_ */ \ No newline at end of file +#endif /* OCEANBASE_OBSERVER_OB_TABLE_SCHEMA_CACHE_H_ */ diff --git a/src/observer/table/ob_table_service.cpp b/src/observer/table/ob_table_service.cpp index 1d7391f01..7d8f6e7cb 100644 --- a/src/observer/table/ob_table_service.cpp +++ b/src/observer/table/ob_table_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ob_table_service.h b/src/observer/table/ob_table_service.h index 56ef03f8c..368f5ed06 100644 --- a/src/observer/table/ob_table_service.h +++ b/src/observer/table/ob_table_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_SERVICE_H diff --git a/src/observer/table/ob_table_update_executor.cpp b/src/observer/table/ob_table_update_executor.cpp index ebca6200c..ec53e4073 100644 --- a/src/observer/table/ob_table_update_executor.cpp +++ b/src/observer/table/ob_table_update_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -179,7 +183,7 @@ int ObTableApiUpdateExecutor::get_next_row() has_row_changed = true; } int tmp_ret = ret; - if (OB_FAIL(child_->close())) { // 需要写到das后才close child算子,否则扫描的行已经被析构 + if (OB_FAIL(child_->close())) { // need to write to das before closing child operator, otherwise the scanned rows have been destructed LOG_WARN("fail to close scan executor", K(ret)); } ret = OB_SUCC(tmp_ret) ? ret : tmp_ret; diff --git a/src/observer/table/ob_table_update_executor.h b/src/observer/table/ob_table_update_executor.h index 0ca2a1715..83b63cbb6 100644 --- a/src/observer/table/ob_table_update_executor.h +++ b/src/observer/table/ob_table_update_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2022 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_UPDATE_EXECUTOR_H diff --git a/src/observer/table/object_pool/ob_table_object_pool.cpp b/src/observer/table/object_pool/ob_table_object_pool.cpp index 5b2971b44..5e87da197 100644 --- a/src/observer/table/object_pool/ob_table_object_pool.cpp +++ b/src/observer/table/object_pool/ob_table_object_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/object_pool/ob_table_object_pool.h b/src/observer/table/object_pool/ob_table_object_pool.h index cc71b7ecb..cce92d1aa 100644 --- a/src/observer/table/object_pool/ob_table_object_pool.h +++ b/src/observer/table/object_pool/ob_table_object_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_OBJECT_POOL_H_ @@ -53,9 +57,9 @@ class ObTableObjectPoolMgr final TO_STRING_KV(K_(is_inited), KPC_(obj_pool_mgr)); void runTimerTask(void); private: - // 回收已经淘汰的session + // Recycle the obsolete session int run_recycle_retired_sess_task(); - // 淘汰长期未被使用的session + // Evict sessions that have not been used for a long time int run_retire_sess_task(); public: bool is_inited_; diff --git a/src/observer/table/object_pool/ob_table_object_pool_common.h b/src/observer/table/object_pool/ob_table_object_pool_common.h index 4bbb68c68..ac72da16c 100644 --- a/src/observer/table/object_pool/ob_table_object_pool_common.h +++ b/src/observer/table/object_pool/ob_table_object_pool_common.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_OBJECT_POOL_COMMON_H_ diff --git a/src/observer/table/object_pool/ob_table_sess_pool.cpp b/src/observer/table/object_pool/ob_table_sess_pool.cpp index 3fbe2c5b4..d4329edb2 100644 --- a/src/observer/table/object_pool/ob_table_sess_pool.cpp +++ b/src/observer/table/object_pool/ob_table_sess_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -668,7 +672,7 @@ int ObTableApiSessNodeReplaceOp::operator()(MapKV &entry) ObTableApiSessNode *old_node = entry.second; entry.second = new_node; // 3. move old node to retired list - pool_.move_node_to_retired_list(old_node); // 添加到链表末尾,不会出错,故不判断返回值 + pool_.move_node_to_retired_list(old_node); // add to the end of the list, will not fail, so do not check the return value } } diff --git a/src/observer/table/object_pool/ob_table_sess_pool.h b/src/observer/table/object_pool/ob_table_sess_pool.h index 555b0efbf..709a18284 100644 --- a/src/observer/table/object_pool/ob_table_sess_pool.h +++ b/src/observer/table/object_pool/ob_table_sess_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_SESS_POOL_H_ @@ -62,8 +66,8 @@ class ObTableApiSessPool final common::ObFIFOAllocator allocator_; bool is_inited_; CacheKeyNodeMap key_node_map_; - // 已经淘汰的node,等待被后台删除 - // 前台login时、后台淘汰时都会操作retired_nodes_,因此需要加锁 + // obsolete node, waiting to be deleted by the background + // Frontend login and backend eviction will both operate on retired_nodes_, so locking is required common::ObDList retired_nodes_; ObSpinLock retired_nodes_lock_; // for lock retired_nodes_ int64_t last_update_ts_; @@ -88,7 +92,7 @@ friend class ObTableApiSessGuard; void destroy(); sql::ObSQLSessionInfo& get_sess_info() { return sess_info_; } int init_sess_info(); - void reset_tx_desc() { // 防止异步提交场景在 session 析构的时候 rollback 事务 + void reset_tx_desc() { // Prevent rollback of transaction during session destruction in asynchronous submission scenario sql::ObSQLSessionInfo::LockGuard guard(sess_info_.get_thread_data_lock()); sess_info_.get_tx_desc() = nullptr; } @@ -174,9 +178,9 @@ friend class ObTableApiSessNode; ObTableApiSessGuard() : sess_node_val_(nullptr) {} - // 析构需要做的两件事: - // 1. reset事务描述符,避免session析构时,回滚事务 - // 2. 将session归还到队列,归还失败直接释放(destroy()会将owner_node_设置为null,需要提前记录owner_node) + // Two things to do during destruction: + // 1. reset transaction descriptor, avoid rolling back the transaction when session is destructed + // 2. Return the session to the queue, and release it directly if the return fails (destroy() will set owner_node_ to null, so the owner_node needs to be recorded in advance) ~ObTableApiSessGuard() { if (OB_NOT_NULL(sess_node_val_)) { diff --git a/src/observer/table/object_pool/ob_table_system_variable.cpp b/src/observer/table/object_pool/ob_table_system_variable.cpp index 209b7e87c..968ca5167 100644 --- a/src/observer/table/object_pool/ob_table_system_variable.cpp +++ b/src/observer/table/object_pool/ob_table_system_variable.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/object_pool/ob_table_system_variable.h b/src/observer/table/object_pool/ob_table_system_variable.h index f3792f5eb..21f3654ee 100644 --- a/src/observer/table/object_pool/ob_table_system_variable.h +++ b/src/observer/table/object_pool/ob_table_system_variable.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_SYSTEM_VARIABLE_H_ diff --git a/src/observer/table/part_calc/ob_table_part_calc.cpp b/src/observer/table/part_calc/ob_table_part_calc.cpp index 9ee5b1fda..3ea3aed62 100644 --- a/src/observer/table/part_calc/ob_table_part_calc.cpp +++ b/src/observer/table/part_calc/ob_table_part_calc.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -709,11 +713,9 @@ int ObTablePartCalculator::calc_generated_col(const ObSimpleTableSchemaV2 &simpl } return ret; } - - -// 1. 构造 insert 执行计划 -// 2. 找到生成列在 new row 中的位置 -// 3. eval 生成列 +// 1. Construct insert execution plan +// 2. Find the position of the generated column in the new row +// 3. eval generate column int ObTablePartCalculator::calc_generated_col(const ObSimpleTableSchemaV2 &simple_schema, const ObNewRange &range, const ObTableColumnInfo &col_info, @@ -743,11 +745,10 @@ int ObTablePartCalculator::calc_generated_col(const ObSimpleTableSchemaV2 &simpl return ret; } - -// 1. 分区键是普通列,直接从 range 中获取 -// 1.1 找到分区键在 range 中的位置,获取对应的 ObObj -// 2. 分区键是生成列,需要找到 new row 中的生成列进行计算 -// 2.1 需要从 range 中取值刷生成列依赖的列 +// 1. Partition key is an ordinary column, directly obtain from range +// 1.1 Find the position of the partition key in the range, and obtain the corresponding ObObj +// 2. The partition key is a generated column, need to find the generated column in the new row for calculation +// 2.1 Need to take values from the range to generate columns dependent on the column int ObTablePartCalculator::construct_part_range(const ObTableSchema &table_schema, const ObNewRange &range, const ObIArray &col_ids, diff --git a/src/observer/table/part_calc/ob_table_part_calc.h b/src/observer/table/part_calc/ob_table_part_calc.h index 77f3735c9..4fcd4b884 100644 --- a/src/observer/table/part_calc/ob_table_part_calc.h +++ b/src/observer/table/part_calc/ob_table_part_calc.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_PART_CALC_H_ @@ -77,26 +81,26 @@ class ObTablePartCalculator } } public: - // 计算单个 entity 的 tablet id + // Calculate the tablet id for a single entity int calc(uint64_t table_id, const ObITableEntity &entity, common::ObTabletID &tablet_id); - // 计算单个 entity 的 tablet id - // 计算多个 entity 的 tablet id + // Calculate the tablet id for a single entity + // Calculate the tablet id for multiple entities int calc(uint64_t table_id, const common::ObIArray &entities, common::ObIArray &tablet_ids); - // 计算多个 entity 的 tablet id - // 计算单个 range 的 tablet id + // Calculate the tablet id for multiple entities + // Calculate the tablet id for a single range int calc(uint64_t table_id, const common::ObNewRange &range, common::ObIArray &tablet_ids); - // 计算单个 range 的 tablet id - // 计算多个 range 的 tablet id + // Calculate the tablet id for a single range + // Calculate the tablet id for multiple ranges int calc(uint64_t table_id, const common::ObIArray &ranges, common::ObIArray &tablet_ids); - // 计算多个 range 的 tablet id + // Calculate the tablet id for multiple ranges OB_INLINE void set_clip_type(ObTablePartClipType clip_type) { clip_type_ = clip_type; } private: void clear_evaluated_flag(); diff --git a/src/observer/table/part_calc/ob_table_part_clip.cpp b/src/observer/table/part_calc/ob_table_part_clip.cpp index 76470e7f8..a0a2377e4 100644 --- a/src/observer/table/part_calc/ob_table_part_clip.cpp +++ b/src/observer/table/part_calc/ob_table_part_clip.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/part_calc/ob_table_part_clip.h b/src/observer/table/part_calc/ob_table_part_clip.h index 48cf527cc..f134c3cd9 100644 --- a/src/observer/table/part_calc/ob_table_part_clip.h +++ b/src/observer/table/part_calc/ob_table_part_clip.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_PART_CLIP_H_ diff --git a/src/observer/table/redis/cmd/ob_redis_cmd.cpp b/src/observer/table/redis/cmd/ob_redis_cmd.cpp index 015ce63fb..3ab4e7969 100644 --- a/src/observer/table/redis/cmd/ob_redis_cmd.cpp +++ b/src/observer/table/redis/cmd/ob_redis_cmd.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER #include "ob_redis_cmd.h" diff --git a/src/observer/table/redis/cmd/ob_redis_cmd.h b/src/observer/table/redis/cmd/ob_redis_cmd.h index 75fa8d90d..1c97b697a 100644 --- a/src/observer/table/redis/cmd/ob_redis_cmd.h +++ b/src/observer/table/redis/cmd/ob_redis_cmd.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_REDIS_CMD_ diff --git a/src/observer/table/redis/cmd/ob_redis_generic_cmd.cpp b/src/observer/table/redis/cmd/ob_redis_generic_cmd.cpp index c77d2fabe..dff7ccf74 100644 --- a/src/observer/table/redis/cmd/ob_redis_generic_cmd.cpp +++ b/src/observer/table/redis/cmd/ob_redis_generic_cmd.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER #include "ob_redis_generic_cmd.h" diff --git a/src/observer/table/redis/cmd/ob_redis_generic_cmd.h b/src/observer/table/redis/cmd/ob_redis_generic_cmd.h index 30bcedb4b..28bafe4ac 100644 --- a/src/observer/table/redis/cmd/ob_redis_generic_cmd.h +++ b/src/observer/table/redis/cmd/ob_redis_generic_cmd.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_REDIS_GENERIC_CMD_ diff --git a/src/observer/table/redis/cmd/ob_redis_hash_cmd.cpp b/src/observer/table/redis/cmd/ob_redis_hash_cmd.cpp index 03628f890..8a566a1e3 100644 --- a/src/observer/table/redis/cmd/ob_redis_hash_cmd.cpp +++ b/src/observer/table/redis/cmd/ob_redis_hash_cmd.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER #include "ob_redis_hash_cmd.h" diff --git a/src/observer/table/redis/cmd/ob_redis_hash_cmd.h b/src/observer/table/redis/cmd/ob_redis_hash_cmd.h index f246fd3f2..04abef7f0 100644 --- a/src/observer/table/redis/cmd/ob_redis_hash_cmd.h +++ b/src/observer/table/redis/cmd/ob_redis_hash_cmd.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_REDIS_HASH_CMD_ diff --git a/src/observer/table/redis/cmd/ob_redis_list_cmd.cpp b/src/observer/table/redis/cmd/ob_redis_list_cmd.cpp index 21170534c..c80f4aaf1 100644 --- a/src/observer/table/redis/cmd/ob_redis_list_cmd.cpp +++ b/src/observer/table/redis/cmd/ob_redis_list_cmd.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER #include "ob_redis_list_cmd.h" diff --git a/src/observer/table/redis/cmd/ob_redis_list_cmd.h b/src/observer/table/redis/cmd/ob_redis_list_cmd.h index 3f49cd374..d8201792e 100644 --- a/src/observer/table/redis/cmd/ob_redis_list_cmd.h +++ b/src/observer/table/redis/cmd/ob_redis_list_cmd.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table/redis/cmd/ob_redis_set_cmd.cpp b/src/observer/table/redis/cmd/ob_redis_set_cmd.cpp index cd1cd9227..d8ae57c6f 100644 --- a/src/observer/table/redis/cmd/ob_redis_set_cmd.cpp +++ b/src/observer/table/redis/cmd/ob_redis_set_cmd.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER #include "ob_redis_set_cmd.h" diff --git a/src/observer/table/redis/cmd/ob_redis_set_cmd.h b/src/observer/table/redis/cmd/ob_redis_set_cmd.h index 74756a3a4..99ece9608 100644 --- a/src/observer/table/redis/cmd/ob_redis_set_cmd.h +++ b/src/observer/table/redis/cmd/ob_redis_set_cmd.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_REDIS_SET_CMD_ #define OCEANBASE_OBSERVER_OB_REDIS_SET_CMD_ diff --git a/src/observer/table/redis/cmd/ob_redis_string_cmd.cpp b/src/observer/table/redis/cmd/ob_redis_string_cmd.cpp index b66edfca1..79aab519b 100644 --- a/src/observer/table/redis/cmd/ob_redis_string_cmd.cpp +++ b/src/observer/table/redis/cmd/ob_redis_string_cmd.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER #include "ob_redis_string_cmd.h" diff --git a/src/observer/table/redis/cmd/ob_redis_string_cmd.h b/src/observer/table/redis/cmd/ob_redis_string_cmd.h index 5d7cbc9d7..ffaf4c613 100644 --- a/src/observer/table/redis/cmd/ob_redis_string_cmd.h +++ b/src/observer/table/redis/cmd/ob_redis_string_cmd.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_REDIS_STRING_CMD_ diff --git a/src/observer/table/redis/cmd/ob_redis_zset_cmd.cpp b/src/observer/table/redis/cmd/ob_redis_zset_cmd.cpp index 0acd0165f..eb17fb2e4 100644 --- a/src/observer/table/redis/cmd/ob_redis_zset_cmd.cpp +++ b/src/observer/table/redis/cmd/ob_redis_zset_cmd.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER #include "ob_redis_zset_cmd.h" diff --git a/src/observer/table/redis/cmd/ob_redis_zset_cmd.h b/src/observer/table/redis/cmd/ob_redis_zset_cmd.h index 4feada15a..508780ede 100644 --- a/src/observer/table/redis/cmd/ob_redis_zset_cmd.h +++ b/src/observer/table/redis/cmd/ob_redis_zset_cmd.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_REDIS_ZSET_CMD_ diff --git a/src/observer/table/redis/group/ob_redis_group_processor.cpp b/src/observer/table/redis/group/ob_redis_group_processor.cpp index 8a54a3519..9e9019cc5 100644 --- a/src/observer/table/redis/group/ob_redis_group_processor.cpp +++ b/src/observer/table/redis/group/ob_redis_group_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/redis/group/ob_redis_group_processor.h b/src/observer/table/redis/group/ob_redis_group_processor.h index 01413519f..2317adae1 100644 --- a/src/observer/table/redis/group/ob_redis_group_processor.h +++ b/src/observer/table/redis/group/ob_redis_group_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table/redis/group/ob_redis_group_struct.h b/src/observer/table/redis/group/ob_redis_group_struct.h index edb0bc322..52e9a7024 100644 --- a/src/observer/table/redis/group/ob_redis_group_struct.h +++ b/src/observer/table/redis/group/ob_redis_group_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table/redis/ob_redis_command_factory.cpp b/src/observer/table/redis/ob_redis_command_factory.cpp index 2b74ae832..d42137001 100644 --- a/src/observer/table/redis/ob_redis_command_factory.cpp +++ b/src/observer/table/redis/ob_redis_command_factory.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/redis/ob_redis_command_factory.h b/src/observer/table/redis/ob_redis_command_factory.h index 8a4c01895..6793f5f79 100644 --- a/src/observer/table/redis/ob_redis_command_factory.h +++ b/src/observer/table/redis/ob_redis_command_factory.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table/redis/ob_redis_command_reg.h b/src/observer/table/redis/ob_redis_command_reg.h index 19de5a50b..2c6a7b67d 100644 --- a/src/observer/table/redis/ob_redis_command_reg.h +++ b/src/observer/table/redis/ob_redis_command_reg.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table/redis/ob_redis_context.cpp b/src/observer/table/redis/ob_redis_context.cpp index 0b3b76bd5..38b42aa8b 100644 --- a/src/observer/table/redis/ob_redis_context.cpp +++ b/src/observer/table/redis/ob_redis_context.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER #include "ob_redis_context.h" diff --git a/src/observer/table/redis/ob_redis_context.h b/src/observer/table/redis/ob_redis_context.h index aad17cb44..12d3c5332 100644 --- a/src/observer/table/redis/ob_redis_context.h +++ b/src/observer/table/redis/ob_redis_context.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_REDIS_CONTEXT_H_ diff --git a/src/observer/table/redis/ob_redis_iterator.cpp b/src/observer/table/redis/ob_redis_iterator.cpp index c2739c8df..f2994be1f 100644 --- a/src/observer/table/redis/ob_redis_iterator.cpp +++ b/src/observer/table/redis/ob_redis_iterator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/redis/ob_redis_iterator.h b/src/observer/table/redis/ob_redis_iterator.h index 1f43ae312..a387b9e37 100644 --- a/src/observer/table/redis/ob_redis_iterator.h +++ b/src/observer/table/redis/ob_redis_iterator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_REDIS_ITERATOR_ @@ -91,4 +95,4 @@ class ObRedisRowIterator : public ObTableTTLRowIterator }; } // namespace table } // namespace oceanbase -#endif // OCEANBASE_OBSERVER_OB_REDIS_ITERATOR_ \ No newline at end of file +#endif // OCEANBASE_OBSERVER_OB_REDIS_ITERATOR_ diff --git a/src/observer/table/redis/ob_redis_meta.cpp b/src/observer/table/redis/ob_redis_meta.cpp index 9e13e3d75..4bd272f5b 100644 --- a/src/observer/table/redis/ob_redis_meta.cpp +++ b/src/observer/table/redis/ob_redis_meta.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/redis/ob_redis_meta.h b/src/observer/table/redis/ob_redis_meta.h index 333149ddd..3b8253e02 100644 --- a/src/observer/table/redis/ob_redis_meta.h +++ b/src/observer/table/redis/ob_redis_meta.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_TABLE_REDIS_OB_REDIS_META_H diff --git a/src/observer/table/redis/ob_redis_rkey.cpp b/src/observer/table/redis/ob_redis_rkey.cpp index 10ab3c4b9..f44c5f158 100644 --- a/src/observer/table/redis/ob_redis_rkey.cpp +++ b/src/observer/table/redis/ob_redis_rkey.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -208,4 +212,4 @@ int ObRedisRKeyUtil::hex_to_key_length(const ObString &hex_str, uint32_t &key_le } } // namespace table -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table/redis/ob_redis_rkey.h b/src/observer/table/redis/ob_redis_rkey.h index 352e7a262..cbe7e87cc 100644 --- a/src/observer/table/redis/ob_redis_rkey.h +++ b/src/observer/table/redis/ob_redis_rkey.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_TABLE_REDIS_OB_REDIS_RKEY_H diff --git a/src/observer/table/redis/ob_redis_service.cpp b/src/observer/table/redis/ob_redis_service.cpp index 358ddda46..8f799b02e 100644 --- a/src/observer/table/redis/ob_redis_service.cpp +++ b/src/observer/table/redis/ob_redis_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER #include "ob_redis_service.h" diff --git a/src/observer/table/redis/ob_redis_service.h b/src/observer/table/redis/ob_redis_service.h index 3d925300b..2d25ab3ee 100644 --- a/src/observer/table/redis/ob_redis_service.h +++ b/src/observer/table/redis/ob_redis_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_REDIS_SERVICE_H diff --git a/src/observer/table/redis/ob_redis_ttl.cpp b/src/observer/table/redis/ob_redis_ttl.cpp index a9bea3486..6f9de9c54 100644 --- a/src/observer/table/redis/ob_redis_ttl.cpp +++ b/src/observer/table/redis/ob_redis_ttl.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/redis/ob_redis_ttl.h b/src/observer/table/redis/ob_redis_ttl.h index abd8a0f4b..e4095fe6a 100644 --- a/src/observer/table/redis/ob_redis_ttl.h +++ b/src/observer/table/redis/ob_redis_ttl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_TABLE_OB_REDIS_TTL_H_ diff --git a/src/observer/table/redis/operator/ob_redis_generic_operator.cpp b/src/observer/table/redis/operator/ob_redis_generic_operator.cpp index 5ec202909..55c614063 100644 --- a/src/observer/table/redis/operator/ob_redis_generic_operator.cpp +++ b/src/observer/table/redis/operator/ob_redis_generic_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/redis/operator/ob_redis_generic_operator.h b/src/observer/table/redis/operator/ob_redis_generic_operator.h index 84c5a4655..e4177a739 100644 --- a/src/observer/table/redis/operator/ob_redis_generic_operator.h +++ b/src/observer/table/redis/operator/ob_redis_generic_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_REDIS_GENERIC_OPERATOR_ diff --git a/src/observer/table/redis/operator/ob_redis_hash_operator.cpp b/src/observer/table/redis/operator/ob_redis_hash_operator.cpp index d19479bde..6dc24a4cc 100644 --- a/src/observer/table/redis/operator/ob_redis_hash_operator.cpp +++ b/src/observer/table/redis/operator/ob_redis_hash_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/redis/operator/ob_redis_hash_operator.h b/src/observer/table/redis/operator/ob_redis_hash_operator.h index a3afc28e2..6cd44750d 100644 --- a/src/observer/table/redis/operator/ob_redis_hash_operator.h +++ b/src/observer/table/redis/operator/ob_redis_hash_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_REDIS_HASH_OPERATOR_ diff --git a/src/observer/table/redis/operator/ob_redis_list_operator.cpp b/src/observer/table/redis/operator/ob_redis_list_operator.cpp index aaeef3d4c..69b193f47 100644 --- a/src/observer/table/redis/operator/ob_redis_list_operator.cpp +++ b/src/observer/table/redis/operator/ob_redis_list_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/redis/operator/ob_redis_list_operator.h b/src/observer/table/redis/operator/ob_redis_list_operator.h index 72bd6ffc4..2fb8579ed 100644 --- a/src/observer/table/redis/operator/ob_redis_list_operator.h +++ b/src/observer/table/redis/operator/ob_redis_list_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table/redis/operator/ob_redis_operator.cpp b/src/observer/table/redis/operator/ob_redis_operator.cpp index 4530f81c2..86e77e72f 100644 --- a/src/observer/table/redis/operator/ob_redis_operator.cpp +++ b/src/observer/table/redis/operator/ob_redis_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/redis/operator/ob_redis_operator.h b/src/observer/table/redis/operator/ob_redis_operator.h index 7199bdad4..33a5a4f00 100644 --- a/src/observer/table/redis/operator/ob_redis_operator.h +++ b/src/observer/table/redis/operator/ob_redis_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_TABLE_REDIS_OB_REDIS_OPERATOR_H diff --git a/src/observer/table/redis/operator/ob_redis_set_operator.cpp b/src/observer/table/redis/operator/ob_redis_set_operator.cpp index ee4cdd415..108567c52 100644 --- a/src/observer/table/redis/operator/ob_redis_set_operator.cpp +++ b/src/observer/table/redis/operator/ob_redis_set_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/redis/operator/ob_redis_set_operator.h b/src/observer/table/redis/operator/ob_redis_set_operator.h index 16497c79a..a4d87eadf 100644 --- a/src/observer/table/redis/operator/ob_redis_set_operator.h +++ b/src/observer/table/redis/operator/ob_redis_set_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_REDIS_SET_OPERATOR_ diff --git a/src/observer/table/redis/operator/ob_redis_string_operator.cpp b/src/observer/table/redis/operator/ob_redis_string_operator.cpp index 8f694c4c5..26ef776f5 100644 --- a/src/observer/table/redis/operator/ob_redis_string_operator.cpp +++ b/src/observer/table/redis/operator/ob_redis_string_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/redis/operator/ob_redis_string_operator.h b/src/observer/table/redis/operator/ob_redis_string_operator.h index d3984c4e6..9ce7c3305 100644 --- a/src/observer/table/redis/operator/ob_redis_string_operator.h +++ b/src/observer/table/redis/operator/ob_redis_string_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_REDIS_STRING_OPERATOR_ diff --git a/src/observer/table/redis/operator/ob_redis_zset_operator.cpp b/src/observer/table/redis/operator/ob_redis_zset_operator.cpp index 02ace3986..90fe389aa 100644 --- a/src/observer/table/redis/operator/ob_redis_zset_operator.cpp +++ b/src/observer/table/redis/operator/ob_redis_zset_operator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/redis/operator/ob_redis_zset_operator.h b/src/observer/table/redis/operator/ob_redis_zset_operator.h index 01c8f436e..2af5e6609 100644 --- a/src/observer/table/redis/operator/ob_redis_zset_operator.h +++ b/src/observer/table/redis/operator/ob_redis_zset_operator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_REDIS_ZSET_OPERATOR_ diff --git a/src/observer/table/tableapi/ob_table_api_service.cpp b/src/observer/table/tableapi/ob_table_api_service.cpp index bb6db9443..20a7b2f94 100644 --- a/src/observer/table/tableapi/ob_table_api_service.cpp +++ b/src/observer/table/tableapi/ob_table_api_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/src/observer/table/tableapi/ob_table_api_service.h b/src/observer/table/tableapi/ob_table_api_service.h index 0bff26fbc..07f70e95c 100644 --- a/src/observer/table/tableapi/ob_table_api_service.h +++ b/src/observer/table/tableapi/ob_table_api_service.h @@ -1,14 +1,17 @@ -/** - - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/container/ob_iarray.h" diff --git a/src/observer/table/trans/ob_table_trans_ctrl.cpp b/src/observer/table/trans/ob_table_trans_ctrl.cpp index de043bcd7..52ad2848f 100644 --- a/src/observer/table/trans/ob_table_trans_ctrl.cpp +++ b/src/observer/table/trans/ob_table_trans_ctrl.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/trans/ob_table_trans_ctrl.h b/src/observer/table/trans/ob_table_trans_ctrl.h index ec69f9a06..27bc83cae 100644 --- a/src/observer/table/trans/ob_table_trans_ctrl.h +++ b/src/observer/table/trans/ob_table_trans_ctrl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_TRANS_CTRL_H diff --git a/src/observer/table/ttl/ob_table_ttl_executor.cpp b/src/observer/table/ttl/ob_table_ttl_executor.cpp index f6f76ac42..f9eb0006a 100644 --- a/src/observer/table/ttl/ob_table_ttl_executor.cpp +++ b/src/observer/table/ttl/ob_table_ttl_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -243,8 +247,7 @@ int ObTableApiTTLExecutor::do_insert() { int ret = OB_SUCCESS; const ObTableEntity *entity = static_cast(tb_ctx_.get_entity()); - - // do_insert前被conflict checker刷成了旧行,需要重新刷一遍 + // do_insert was brushed to the old row by the conflict checker, need to brush it again if (OB_FAIL(refresh_exprs_frame(entity))) { LOG_WARN("fail to refresh exprs frame", K(ret)); } else if (OB_FAIL(insert_row_to_das())) { @@ -275,7 +278,7 @@ int ObTableApiTTLExecutor::update_row_to_conflict_checker() } else { upd_rtdef.found_rows_++; const ObChunkDatumStore::StoredRow *upd_new_row = insert_row; - const ObChunkDatumStore::StoredRow *upd_old_row = constraint_values.at(0).current_datum_row_; // 这里只取第一行是和mysql对齐的 + const ObChunkDatumStore::StoredRow *upd_old_row = constraint_values.at(0).current_datum_row_; // Here only the first row is taken to align with MySQL if (OB_ISNULL(upd_old_row)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("upd_old_row is NULL", K(ret)); @@ -303,11 +306,11 @@ int ObTableApiTTLExecutor::update_row_to_conflict_checker() // unique key idx0(c2), unique key idx1(c3)); // insert into t values(1, 1, 1),(2, 2, 2),(3, 3, 3); // insert into t values(3,1,2) ON DUPLICATE KEY UPDATE c1=4; -// 执行insert后map中有3个元素: +// Execute insert and there are 3 elements in the map: // 1->(base:1, 1, 1 curr:1, 1, 1), // 2->(base:2, 2, 2 curr:2, 2, 2), // 3->(base:3, 3, 3 curr:3, 3, 3); -// 执行conflict_checker_.update_row后: +// After executing conflict_checker_.update_row: // 1->(base:1, 1, 1 curr:nul), // 2->(base:2, 2, 2 curr:nul), // 3->(base:3, 3, 3 curr:4, 3, 3); @@ -337,8 +340,8 @@ int ObTableApiTTLExecutor::update_row_to_das() ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected row source", K(ret), K(constraint_value.new_row_source_)); } else { // FROM_UPDATE - // baseline_datum_row_ 代表存储扫描回来的冲突旧行 - // current_datum_row_ 当前更新的新行 + // baseline_datum_row_ represents the storage of the conflicting old row scanned back + // current_datum_row_ the new row being updated if (NULL != constraint_value.baseline_datum_row_ && NULL != constraint_value.current_datum_row_) { if (OB_FAIL(stored_row_to_exprs(*constraint_value.baseline_datum_row_, @@ -358,7 +361,7 @@ int ObTableApiTTLExecutor::update_row_to_das() } } } else if (NULL == constraint_value.baseline_datum_row_ && - NULL != constraint_value.current_datum_row_) { // 单单是唯一索引冲突的时候,会走这个分支 + NULL != constraint_value.current_datum_row_) { // This branch is taken only when there is a unique index conflict OZ(to_expr_skip_old(*constraint_value.current_datum_row_, ttl_spec_.get_ctdefs().at(0)->upd_ctdef_)); OZ(insert_upd_new_row_to_das()); @@ -397,25 +400,24 @@ int ObTableApiTTLExecutor::insert_upd_new_row_to_das() int ObTableApiTTLExecutor::do_update() { int ret = OB_SUCCESS; - // 1. 刷frame,刷到upd_ctdef.new_row中 + // 1. Brush frame, brush to upd_ctdef.new_row // 2. conflict_checker_.update_row - // 3. 遍历冲突map,do_update,参考ObTableApiInsertUpExecutor::do_update + // 3. Traverse the conflict map, do_update, refer to ObTableApiInsertUpExecutor::do_update - if (OB_FAIL(conflict_checker_.do_lookup_and_build_base_map(1))) { // 1. 使用冲突行去回表,构造冲突行map,key为rowkey,value为旧行 + if (OB_FAIL(conflict_checker_.do_lookup_and_build_base_map(1))) { // 1. Use the conflicting row to look up and construct a conflict row map, key is rowkey, value is the old row LOG_WARN("fail to do table lookup", K(ret)); - } else if (OB_FAIL(update_row_to_conflict_checker())) { // 2. 将更新的行刷到conflict_checker,目的是检查更新的行是否还有冲突 + } else if (OB_FAIL(update_row_to_conflict_checker())) { // 2. Flush the updated row to conflict_checker, the purpose is to check if the updated row still has conflicts LOG_WARN("fail to update row to conflict checker", K(ret)); - } else if (OB_FAIL(update_row_to_das())) { // 3. 根据实际情况更新行到das + } else if (OB_FAIL(update_row_to_das())) { // 3. Update row to das based on the actual situation LOG_WARN("fail to update row to das", K(ret)); } return ret; } - -// 1. 过期,删除旧行,写入新行 -// 2. 未过期 -// a. 当前是insert操作,则报错OB_ERR_ROWKEY_CONFLICT -// b. 当前是insertUp操作,则做update +// 1. Expired, delete the old line, write the new line +// 2. Not expired +// a. If the current operation is insert, then report OB_ERR_ROWKEY_CONFLICT +// b. Current is insertUp operation, then do update int ObTableApiTTLExecutor::process_expire() { int ret = OB_SUCCESS; @@ -432,12 +434,12 @@ int ObTableApiTTLExecutor::process_expire() const ObRowkey &rowkey = start->first; ObConflictValue &old_row = start->second; if (NULL != old_row.baseline_datum_row_) { - // 将旧行刷到表达式中,判断是否过期 + // Flush the old row to the expression and determine if it has expired if (OB_FAIL(stored_row_to_exprs(*old_row.baseline_datum_row_, get_primary_table_upd_old_row(), eval_ctx_))) { LOG_WARN("fail to store row to exprs", K(ret)); } else if (OB_FAIL(check_expired(is_expired_))) { LOG_WARN("fail to check expired", K(ret)); - } else if (is_expired_) { // 过期,删除旧行,写入新行 + } else if (is_expired_) { // expired, delete the old row, write the new row LOG_DEBUG("row is expired", K(ret)); // Notice: here need to clear the evaluated flag, cause the new_row used in try_insert is the same as old_row in do_delete // and if we don't clear the evaluated flag, the generated columns in old_row won't refresh and will use the new_row result @@ -455,7 +457,7 @@ int ObTableApiTTLExecutor::process_expire() } else { insert_rows_ = 1; } - } else { // 未过期, insert操作,则报错OB_ERR_ROWKEY_CONFLICT; insertUp操作,则做update + } else { // Not expired, for insert operation, then report OB_ERR_ROWKEY_CONFLICT; for insertUp operation, then do update if (OB_UNLIKELY(tb_ctx_.is_inc_or_append())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpect execution of increment or append", K(ret), K(tb_ctx_.get_opertion_type())); @@ -494,14 +496,13 @@ void ObTableApiTTLExecutor::set_need_fetch_conflict() int ObTableApiTTLExecutor::reset_das_env() { int ret = OB_SUCCESS; - // 释放第一次try insert的das task + // release the das task from the first try insert if (OB_FAIL(dml_rtctx_.das_ref_.close_all_task())) { LOG_WARN("fail to close all das task", K(ret)); } else { dml_rtctx_.das_ref_.reuse(); } - - // 因为第二次插入不需要fetch conflict result了 + // Because the second insertion does not need to fetch conflict result anymore for (int64_t i = 0; OB_SUCC(ret) && i < ttl_rtdefs_.count(); i++) { ObTableInsRtDef &ins_rtdef = ttl_rtdefs_.at(i).ins_rtdef_; ins_rtdef.das_rtdef_.need_fetch_conflict_ = false; @@ -510,18 +511,16 @@ int ObTableApiTTLExecutor::reset_das_env() return ret; } - - -// 1. 获取快照点 -// 2. 写入记录 -// a. 不冲突,写入成功 -// b. 冲突,需要进一步判断是否是过期 -// ⅰ . 回归到快照点 -// ⅰⅰ. 处理过期逻辑 -// 1. 过期,删除旧行,写入新行 -// 2. 未过期 -// a. 当前是insert操作,则报错OB_ERR_ROWKEY_CONFLICT -// b. 当前是insertUp操作,则做update +// 1. Get the snapshot point +// 2. Write record +// a. No conflict, write successful +// b. Conflict, need further judgment to determine if it is expired +// ⅰ . Roll back to the snapshot point +// ⅰⅰ. Handle expiration logic +// 1. Expired, delete the old line, write the new line +// 2. Not expired +// a. If the current operation is insert, then report OB_ERR_ROWKEY_CONFLICT +// b. Current is insertUp operation, then do update int ObTableApiTTLExecutor::get_next_row() { int ret = OB_SUCCESS; @@ -535,13 +534,13 @@ int ObTableApiTTLExecutor::get_next_row() } else if (!is_duplicated()) { insert_rows_ = 1; LOG_DEBUG("no duplicated, insert successfully"); - } else if (OB_FAIL(fetch_conflict_rowkey(conflict_checker_))) {// 获取所有的冲突主键 + } else if (OB_FAIL(fetch_conflict_rowkey(conflict_checker_))) {// fetch all conflict rowkeys LOG_WARN("fail to fetch conflict rowkey", K(ret)); - } else if (OB_FAIL(reset_das_env())) { // reuse das 相关信息 + } else if (OB_FAIL(reset_das_env())) { // reuse das related information LOG_WARN("fail to reset das env", K(ret)); - } else if (OB_FAIL(ObSqlTransControl::rollback_savepoint(exec_ctx_, savepoint_no))) { // 本次插入存在冲突, 回滚到save_point + } else if (OB_FAIL(ObSqlTransControl::rollback_savepoint(exec_ctx_, savepoint_no))) { // This insertion has conflicts, rollback to save_point LOG_WARN("fail to rollback to save_point", K(ret), K(savepoint_no)); - } else if (OB_FAIL(process_expire())) { // 处理过期 + } else if (OB_FAIL(process_expire())) { // process expiration LOG_WARN("fail to process expire", K(ret)); } diff --git a/src/observer/table/ttl/ob_table_ttl_executor.h b/src/observer/table/ttl/ob_table_ttl_executor.h index f845e0bb6..0384d80ab 100644 --- a/src/observer/table/ttl/ob_table_ttl_executor.h +++ b/src/observer/table/ttl/ob_table_ttl_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_TTL_EXECUTOR_H @@ -125,4 +129,4 @@ class ObTableApiTTLExecutor : public ObTableApiModifyExecutor } // end namespace table } // end namespace oceanbase -#endif /* OCEANBASE_OBSERVER_OB_TABLE_TTL_EXECUTOR_H */ \ No newline at end of file +#endif /* OCEANBASE_OBSERVER_OB_TABLE_TTL_EXECUTOR_H */ diff --git a/src/observer/table/ttl/ob_table_ttl_task.cpp b/src/observer/table/ttl/ob_table_ttl_task.cpp index 5785cd647..a9f7aa14c 100644 --- a/src/observer/table/ttl/ob_table_ttl_task.cpp +++ b/src/observer/table/ttl/ob_table_ttl_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -263,7 +267,7 @@ int ObTableTTLDeleteTask::process_one() ObTableTransParam trans_param; ObTableTTLOperationResult result; ObTableApiSpec *scan_spec = nullptr; - observer::ObReqTimeGuard req_timeinfo_guard; // 引用cache资源必须加ObReqTimeGuard + observer::ObReqTimeGuard req_timeinfo_guard; // Reference cache resources must add ObReqTimeGuard ObKvSchemaCacheGuard schema_cache_guard; ObTableApiCacheGuard cache_guard; ObTableTTLOperation ttl_operation(info_.tenant_id_, @@ -971,4 +975,4 @@ int ObTableTTLDeleteTask::get_scan_ranges(ObIArray &ranges, const Ob } return ret; -} \ No newline at end of file +} diff --git a/src/observer/table/ttl/ob_table_ttl_task.h b/src/observer/table/ttl/ob_table_ttl_task.h index 838dfa6db..caa531a03 100644 --- a/src/observer/table/ttl/ob_table_ttl_task.h +++ b/src/observer/table/ttl/ob_table_ttl_task.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_TTL_TASK_H_ diff --git a/src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.cpp b/src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.cpp index 5a93d46b9..08e95f2fb 100644 --- a/src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.cpp +++ b/src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.h b/src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.h index 95d8a1982..2030e8630 100644 --- a/src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.h +++ b/src/observer/table/ttl/ob_tenant_tablet_ttl_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_TABLE_OB_TENANT_TABLET_TTL_MANAGER_H_ @@ -494,7 +498,7 @@ class ObTenantTabletTTLMgr : public logservice::ObIReplaySubHandler, template int alloc_and_init_tablet_scheduler(storage::ObLS *ls); private: - // 新增加成员 ObALLTabletTTLScheduler + // New added member ObALLTabletTTLScheduler ObArenaAllocator allocator_; // use to alloc ObTTLTaskScheduler bool is_inited_; uint64_t tenant_id_; diff --git a/src/observer/table/ttl/ob_tenant_ttl_manager.cpp b/src/observer/table/ttl/ob_tenant_ttl_manager.cpp index 66878c28e..ac0a1125d 100644 --- a/src/observer/table/ttl/ob_tenant_ttl_manager.cpp +++ b/src/observer/table/ttl/ob_tenant_ttl_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -1020,4 +1024,4 @@ int ObTTLAllTaskScheduler::alloc_and_init_scheduler(const uint64_t tenant_id, co } // end namespace table -} // end namespace oceanbase \ No newline at end of file +} // end namespace oceanbase diff --git a/src/observer/table/ttl/ob_tenant_ttl_manager.h b/src/observer/table/ttl/ob_tenant_ttl_manager.h index 2d9ae255d..8956aa824 100644 --- a/src/observer/table/ttl/ob_tenant_ttl_manager.h +++ b/src/observer/table/ttl/ob_tenant_ttl_manager.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_TABLE_OB_TENANT_TTL_MANAGER_H_ @@ -246,4 +250,4 @@ class ObTenantTTLManager } // end namespace table } // end namespace oceanbase -#endif /* OCEANBASE_OBSERVER_TABLE_OB_TENANT_TTL_MANAGER_H_ */ \ No newline at end of file +#endif /* OCEANBASE_OBSERVER_TABLE_OB_TENANT_TTL_MANAGER_H_ */ diff --git a/src/observer/table/ttl/ob_ttl_service.cpp b/src/observer/table/ttl/ob_ttl_service.cpp index 876659a85..ad4f79453 100644 --- a/src/observer/table/ttl/ob_ttl_service.cpp +++ b/src/observer/table/ttl/ob_ttl_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/ttl/ob_ttl_service.h b/src/observer/table/ttl/ob_ttl_service.h index 4d7ffc3d4..21fe3cf5b 100644 --- a/src/observer/table/ttl/ob_ttl_service.h +++ b/src/observer/table/ttl/ob_ttl_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_TABLE_OB_TTL_SERVICE_DEFINE_H_ diff --git a/src/observer/table/utils/ob_htable_utils.cpp b/src/observer/table/utils/ob_htable_utils.cpp index b049812e3..114a6679a 100644 --- a/src/observer/table/utils/ob_htable_utils.cpp +++ b/src/observer/table/utils/ob_htable_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/utils/ob_htable_utils.h b/src/observer/table/utils/ob_htable_utils.h index 365d4ef02..0b0cee2d1 100644 --- a/src/observer/table/utils/ob_htable_utils.h +++ b/src/observer/table/utils/ob_htable_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_HTABLE_UTILS_H diff --git a/src/observer/table/utils/ob_table_convert_utils.cpp b/src/observer/table/utils/ob_table_convert_utils.cpp index a2bc92ad7..59ad1e13c 100644 --- a/src/observer/table/utils/ob_table_convert_utils.cpp +++ b/src/observer/table/utils/ob_table_convert_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan - * PubL v2. You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY - * KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO - * NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the - * Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/utils/ob_table_convert_utils.h b/src/observer/table/utils/ob_table_convert_utils.h index 708aea91e..5bc1c4248 100644 --- a/src/observer/table/utils/ob_table_convert_utils.h +++ b/src/observer/table/utils/ob_table_convert_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan - * PubL v2. You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY - * KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO - * NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the - * Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_CONVERT_UTILS_H diff --git a/src/observer/table/utils/ob_table_json_utils.cpp b/src/observer/table/utils/ob_table_json_utils.cpp index fd66d2e17..2e7d92454 100644 --- a/src/observer/table/utils/ob_table_json_utils.cpp +++ b/src/observer/table/utils/ob_table_json_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_table_json_utils.h" diff --git a/src/observer/table/utils/ob_table_json_utils.h b/src/observer/table/utils/ob_table_json_utils.h index 8335cd143..333ff896a 100644 --- a/src/observer/table/utils/ob_table_json_utils.h +++ b/src/observer/table/utils/ob_table_json_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_JSON_UTILS_H_ diff --git a/src/observer/table/utils/ob_table_sql_utils.cpp b/src/observer/table/utils/ob_table_sql_utils.cpp index 0a93d2c1d..de8058ab4 100644 --- a/src/observer/table/utils/ob_table_sql_utils.cpp +++ b/src/observer/table/utils/ob_table_sql_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER #include "ob_table_sql_utils.h" diff --git a/src/observer/table/utils/ob_table_sql_utils.h b/src/observer/table/utils/ob_table_sql_utils.h index ae1cd2081..3aa5b60c8 100644 --- a/src/observer/table/utils/ob_table_sql_utils.h +++ b/src/observer/table/utils/ob_table_sql_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_TABLE_SQL_UTILS_H_ diff --git a/src/observer/table/utils/ob_table_trans_utils.cpp b/src/observer/table/utils/ob_table_trans_utils.cpp index 80347e54d..062d3ff7f 100644 --- a/src/observer/table/utils/ob_table_trans_utils.cpp +++ b/src/observer/table/utils/ob_table_trans_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table/utils/ob_table_trans_utils.h b/src/observer/table/utils/ob_table_trans_utils.h index e03b7b31b..d45a7fc0c 100644 --- a/src/observer/table/utils/ob_table_trans_utils.h +++ b/src/observer/table/utils/ob_table_trans_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_TRANS_UTILS_H diff --git a/src/observer/table_load/backup/ob_table_load_backup_file_util.cpp b/src/observer/table_load/backup/ob_table_load_backup_file_util.cpp index c0cb0569a..f7c6de463 100644 --- a/src/observer/table_load/backup/ob_table_load_backup_file_util.cpp +++ b/src/observer/table_load/backup/ob_table_load_backup_file_util.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/backup/ob_table_load_backup_file_util.h b/src/observer/table_load/backup/ob_table_load_backup_file_util.h index 082984ca0..bb1b9e101 100644 --- a/src/observer/table_load/backup/ob_table_load_backup_file_util.h +++ b/src/observer/table_load/backup/ob_table_load_backup_file_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/backup/ob_table_load_backup_table.cpp b/src/observer/table_load/backup/ob_table_load_backup_table.cpp index 77d8b27d2..98cf1aa6f 100644 --- a/src/observer/table_load/backup/ob_table_load_backup_table.cpp +++ b/src/observer/table_load/backup/ob_table_load_backup_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/backup/ob_table_load_backup_table.h b/src/observer/table_load/backup/ob_table_load_backup_table.h index 2dd800b6a..9a7de5363 100644 --- a/src/observer/table_load/backup/ob_table_load_backup_table.h +++ b/src/observer/table_load/backup/ob_table_load_backup_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -24,7 +28,7 @@ enum class ObTableLoadBackupVersion { INVALID = 0, V_1_4, - V_3_X, // FARM COMPAT WHITELIST, 重命名,加白名单 + V_3_X, // FARM COMPAT WHITELIST, rename, add whitelist V_2_X_LOG, V_2_X_PHY, MAX_VERSION diff --git a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_meta_v_1_4.cpp b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_meta_v_1_4.cpp index 1e826361d..f5f088dcb 100644 --- a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_meta_v_1_4.cpp +++ b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_meta_v_1_4.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_meta_v_1_4.h b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_meta_v_1_4.h index 4ffef0727..fbc0f607f 100644 --- a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_meta_v_1_4.h +++ b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_meta_v_1_4.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -87,10 +91,10 @@ class ObTableLoadBackupMacroBlockMeta_V_1_4 //Note that if you use complex structure as variables, the complex structure should also keep compatibility. //The following variables need to be serialized - int16_t attr_; //低8位0,1,2,3,4,5分别表示空闲,sstable数据,tablet元数据,schema,compressor name,宏块元数据;其余位置0; + int16_t attr_; // Low 8 bits 0, 1, 2, 3, 4, 5 represent idle, sstable data, tablet metadata, schema, compressor name, macro block metadata; other positions are 0; union { - uint64_t data_version_; //sstable宏块:sstable的主版本号(高48位)及,小版本号(低16位) + uint64_t data_version_; // sstable macro block: major version number (high 48 bits) and minor version number (low 16 bits) int64_t previous_block_index_; // nonsstable: previous_block_index_ link. }; int16_t column_number_; // column count of this table (size of column_checksum_) diff --git a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_reader_v_1_4.cpp b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_reader_v_1_4.cpp index 7777a55e5..6f3441941 100644 --- a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_reader_v_1_4.cpp +++ b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_reader_v_1_4.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_reader_v_1_4.h b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_reader_v_1_4.h index ba996b93f..14615c950 100644 --- a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_reader_v_1_4.h +++ b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_reader_v_1_4.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_scanner_v_1_4.cpp b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_scanner_v_1_4.cpp index 5aeb5a0c9..a2fceeaf5 100644 --- a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_scanner_v_1_4.cpp +++ b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_scanner_v_1_4.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_scanner_v_1_4.h b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_scanner_v_1_4.h index 074784d98..704d27685 100644 --- a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_scanner_v_1_4.h +++ b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_macro_block_scanner_v_1_4.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_micro_block_scanner_v_1_4.cpp b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_micro_block_scanner_v_1_4.cpp index 2bebfe08a..4038e81c1 100644 --- a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_micro_block_scanner_v_1_4.cpp +++ b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_micro_block_scanner_v_1_4.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -108,7 +112,7 @@ int ObTableLoadBackupMicroBlockScanner_V_1_4::init(const char *buf, const ObTableLoadBackupColumnMap_V_1_4 *column_map) { int ret = OB_SUCCESS; - // meta只在内部的scan中可能会用到,所以为nullptr是可能存在的 + // meta is only used in the internal scan, so it being nullptr is possible if (OB_UNLIKELY(buf == nullptr || column_ids == nullptr || column_map == nullptr || diff --git a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_micro_block_scanner_v_1_4.h b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_micro_block_scanner_v_1_4.h index 2415a745d..8c77b6960 100644 --- a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_micro_block_scanner_v_1_4.h +++ b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_micro_block_scanner_v_1_4.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -67,7 +71,7 @@ class ObTableLoadBackupMicroBlockHeader_V_1_4 int32_t header_size_; int32_t version_; int32_t magic_; - int32_t attr_;//TODO:用途 + int32_t attr_;//TODO:purpose int32_t column_count_; int32_t row_index_offset_; int32_t row_count_; @@ -92,13 +96,13 @@ class ObTableLoadBackupMicroBlockScanner_V_1_4 int get_next_row(ObNewRow &row); private: ObTableLoadBackupRowReader_V_1_4 reader_; - const ObTableLoadBackupMicroBlockHeader_V_1_4 *header_; //微块头首地址 + const ObTableLoadBackupMicroBlockHeader_V_1_4 *header_; // micro block header start address const ObIArray *column_ids_; const ObTableLoadBackupColumnMap_V_1_4 *column_map_; const char *data_begin_; const int32_t *index_begin_; int32_t cur_idx_; - // 避免调用ObObj的构造函数 + // Avoid calling the ObObj constructor bool is_inited_; }; diff --git a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_partition_scanner_v_1_4.cpp b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_partition_scanner_v_1_4.cpp index 9ce4748a7..9eb0fc67d 100644 --- a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_partition_scanner_v_1_4.cpp +++ b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_partition_scanner_v_1_4.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -166,12 +170,12 @@ int ObTableLoadBackupPartScanner_V_1_4::locate_subpart_macro_block(int64_t subpa if (total_macro_block_count > 0) { int64_t valid_subpart_count = subpart_count; if (total_macro_block_count < subpart_count * MIN_SUBPART_MACRO_BLOCK_COUNT) { - // 宏块数目太少, 分不出subpart_count份, 重新计算能分出几份 + // The number of macroblocks is too small, cannot be divided into subpart_count parts, recalculate how many parts can be divided valid_subpart_count = MAX(total_macro_block_count / MIN_SUBPART_MACRO_BLOCK_COUNT, 1); } const int64_t count_per_subpart = total_macro_block_count / valid_subpart_count; const int64_t remain_count = total_macro_block_count - count_per_subpart * valid_subpart_count; - // 比如16个宏块分成5份: 4 3 3 3 3 + // For example, 16 macroblocks divided into 5 parts: 4 3 3 3 3 // count_per_subpart = 3 // remain_count = 1 // [0, 4) [4, 7) [7, 10) [10, 13) [13, 16) diff --git a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_partition_scanner_v_1_4.h b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_partition_scanner_v_1_4.h index 1d266a9a3..43d15d63d 100644 --- a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_partition_scanner_v_1_4.h +++ b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_partition_scanner_v_1_4.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_row_reader_v_1_4.cpp b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_row_reader_v_1_4.cpp index 69526f320..9ba162c9e 100644 --- a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_row_reader_v_1_4.cpp +++ b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_row_reader_v_1_4.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_row_reader_v_1_4.h b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_row_reader_v_1_4.h index e8eb88126..535272c61 100644 --- a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_row_reader_v_1_4.h +++ b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_row_reader_v_1_4.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -27,7 +31,7 @@ struct ObTableLoadBackupColumnIndexItem_V_1_4 { OB_INLINE const common::ObObjMeta &get_obj_meta() const { return request_column_type_; } TO_STRING_KV(K(request_column_type_), K(store_index_), K(is_column_type_matched_)); - common::ObObjMeta request_column_type_; //请求列的类型 + common::ObObjMeta request_column_type_; //The type of the request column int16_t store_index_; //request_index-->store_index bool is_column_type_matched_; }; @@ -59,12 +63,12 @@ class ObTableLoadBackupColumnMap_V_1_4 TO_STRING_KV(K(request_count_), K(store_count_), K(rowkey_store_count_), K(seq_read_column_count_), K(ObArrayWrap(column_indexs_, request_count_)), K(read_full_rowkey_)); private: - int64_t request_count_; //请求列数 - int64_t store_count_; //存储列数 - int64_t rowkey_store_count_; //rowkey列数 - int64_t seq_read_column_count_; //请求的列类型与顺序与存储列类型与顺序相同的列数 + int64_t request_count_; //request count + int64_t store_count_; // number of storage columns + int64_t rowkey_store_count_; // number of rowkey columns + int64_t seq_read_column_count_; //The number of columns with the same type and order as the requested columns and the stored columns ObTableLoadBackupColumnIndexItem_V_1_4 *column_indexs_; - // 避免调用ObColumnIndexItem的构造函数 + // Avoid calling the constructor of ObColumnIndexItem char column_indexs_buf_[sizeof(ObTableLoadBackupColumnIndexItem_V_1_4) * OB_TABLE_LOAD_PRE_ROW_MAX_COLUMNS_COUNT]; bool read_full_rowkey_; bool is_inited_; diff --git a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_table_v_1_4.cpp b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_table_v_1_4.cpp index 37ddd9fab..f10833b99 100644 --- a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_table_v_1_4.cpp +++ b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_table_v_1_4.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_table_v_1_4.h b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_table_v_1_4.h index 824dab899..1789794a6 100644 --- a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_table_v_1_4.h +++ b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_table_v_1_4.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_util_v_1_4.cpp b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_util_v_1_4.cpp index e18ccdee4..7e911cd6c 100644 --- a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_util_v_1_4.cpp +++ b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_util_v_1_4.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_util_v_1_4.h b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_util_v_1_4.h index c4670a55d..d12e5eed9 100644 --- a/src/observer/table_load/backup/v_1_4/ob_table_load_backup_util_v_1_4.h +++ b/src/observer/table_load/backup/v_1_4/ob_table_load_backup_util_v_1_4.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/client/ob_table_direct_load_exec_context.h b/src/observer/table_load/client/ob_table_direct_load_exec_context.h index b7bdb107c..f1a4b5d9b 100644 --- a/src/observer/table_load/client/ob_table_direct_load_exec_context.h +++ b/src/observer/table_load/client/ob_table_direct_load_exec_context.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/client/ob_table_direct_load_rpc_executor.cpp b/src/observer/table_load/client/ob_table_direct_load_rpc_executor.cpp index 92f1730a2..50b2b3ef4 100644 --- a/src/observer/table_load/client/ob_table_direct_load_rpc_executor.cpp +++ b/src/observer/table_load/client/ob_table_direct_load_rpc_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -75,7 +79,7 @@ int ObTableDirectLoadBeginExecutor::process() ObTableLoadClientStatus client_status = ObTableLoadClientStatus::MAX_STATUS; int client_error_code = OB_SUCCESS; while (OB_SUCC(ret) && ObTableLoadClientStatus::RUNNING != client_status) { - client_task->heart_beat(); // 保持心跳 + client_task->heart_beat(); // keep heartbeat if (OB_UNLIKELY(THIS_WORKER.is_timeout())) { ret = OB_TIMEOUT; LOG_WARN("worker timeout", KR(ret)); @@ -159,7 +163,7 @@ int ObTableDirectLoadCommitExecutor::process() if (OB_UNLIKELY(OB_ENTRY_NOT_EXIST != ret)) { LOG_WARN("fail to get client task", KR(ret), K(key)); } else { - // 处理重试场景 + // Handle retry scenario ret = OB_SUCCESS; if (OB_FAIL(ObTableLoadClientService::get_task_brief(key, client_task_brief))) { LOG_WARN("fail to get client task brief", KR(ret), K(key)); diff --git a/src/observer/table_load/client/ob_table_direct_load_rpc_executor.h b/src/observer/table_load/client/ob_table_direct_load_rpc_executor.h index c8c5b7f22..d0c273cd3 100644 --- a/src/observer/table_load/client/ob_table_direct_load_rpc_executor.h +++ b/src/observer/table_load/client/ob_table_direct_load_rpc_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/client/ob_table_direct_load_rpc_proxy.cpp b/src/observer/table_load/client/ob_table_direct_load_rpc_proxy.cpp index 3823f708f..b29ecbf71 100644 --- a/src/observer/table_load/client/ob_table_direct_load_rpc_proxy.cpp +++ b/src/observer/table_load/client/ob_table_direct_load_rpc_proxy.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/client/ob_table_direct_load_rpc_proxy.h b/src/observer/table_load/client/ob_table_direct_load_rpc_proxy.h index 3ae22ab91..b34b513a6 100644 --- a/src/observer/table_load/client/ob_table_direct_load_rpc_proxy.h +++ b/src/observer/table_load/client/ob_table_direct_load_rpc_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/client/ob_table_direct_load_rpc_struct.cpp b/src/observer/table_load/client/ob_table_direct_load_rpc_struct.cpp index 13fefd5be..6a66f12a2 100644 --- a/src/observer/table_load/client/ob_table_direct_load_rpc_struct.cpp +++ b/src/observer/table_load/client/ob_table_direct_load_rpc_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/client/ob_table_direct_load_rpc_struct.h b/src/observer/table_load/client/ob_table_direct_load_rpc_struct.h index a93525b45..f0509ff4a 100644 --- a/src/observer/table_load/client/ob_table_direct_load_rpc_struct.h +++ b/src/observer/table_load/client/ob_table_direct_load_rpc_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/control/ob_table_load_control_rpc_executor.cpp b/src/observer/table_load/control/ob_table_load_control_rpc_executor.cpp index 9726a71a4..a6b667c05 100644 --- a/src/observer/table_load/control/ob_table_load_control_rpc_executor.cpp +++ b/src/observer/table_load/control/ob_table_load_control_rpc_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/control/ob_table_load_control_rpc_executor.h b/src/observer/table_load/control/ob_table_load_control_rpc_executor.h index b27ced44b..1d19448b7 100644 --- a/src/observer/table_load/control/ob_table_load_control_rpc_executor.h +++ b/src/observer/table_load/control/ob_table_load_control_rpc_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/control/ob_table_load_control_rpc_proxy.cpp b/src/observer/table_load/control/ob_table_load_control_rpc_proxy.cpp index caa6f8e1c..5c20dbbed 100644 --- a/src/observer/table_load/control/ob_table_load_control_rpc_proxy.cpp +++ b/src/observer/table_load/control/ob_table_load_control_rpc_proxy.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/control/ob_table_load_control_rpc_proxy.h b/src/observer/table_load/control/ob_table_load_control_rpc_proxy.h index 987c7670d..ba0357eb6 100644 --- a/src/observer/table_load/control/ob_table_load_control_rpc_proxy.h +++ b/src/observer/table_load/control/ob_table_load_control_rpc_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/control/ob_table_load_control_rpc_struct.cpp b/src/observer/table_load/control/ob_table_load_control_rpc_struct.cpp index 86682ef6f..edac85188 100644 --- a/src/observer/table_load/control/ob_table_load_control_rpc_struct.cpp +++ b/src/observer/table_load/control/ob_table_load_control_rpc_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/control/ob_table_load_control_rpc_struct.h b/src/observer/table_load/control/ob_table_load_control_rpc_struct.h index 6b9374f33..ccc664ab4 100644 --- a/src/observer/table_load/control/ob_table_load_control_rpc_struct.h +++ b/src/observer/table_load/control/ob_table_load_control_rpc_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -466,9 +470,9 @@ class ObDirectLoadControlInsertTransArg final uint64_t table_id_; int64_t task_id_; table::ObTableLoadTransId trans_id_; - int32_t session_id_; // 从1开始 - uint64_t sequence_no_; // 从1开始 - ObString payload_; //里面包的是ObTableLoadObjArray + int32_t session_id_; // Start from 1 + uint64_t sequence_no_; // Start from 1 + ObString payload_; //It contains ObTableLoadObjArray }; class ObDirectLoadControlInitEmptyTabletsArg final diff --git a/src/observer/table_load/dag/ob_table_load_dag.cpp b/src/observer/table_load/dag/ob_table_load_dag.cpp index eaba5228b..d34198646 100644 --- a/src/observer/table_load/dag/ob_table_load_dag.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag.h b/src/observer/table_load/dag/ob_table_load_dag.h index 036908bd5..7aaedd096 100644 --- a/src/observer/table_load/dag/ob_table_load_dag.h +++ b/src/observer/table_load/dag/ob_table_load_dag.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_compact_table_task.cpp b/src/observer/table_load/dag/ob_table_load_dag_compact_table_task.cpp index 1bdb3e463..087876e26 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_compact_table_task.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_compact_table_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag_compact_table_task.h b/src/observer/table_load/dag/ob_table_load_dag_compact_table_task.h index 3a3ea6f6b..ff6885971 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_compact_table_task.h +++ b/src/observer/table_load/dag/ob_table_load_dag_compact_table_task.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_direct_write.cpp b/src/observer/table_load/dag/ob_table_load_dag_direct_write.cpp index 8cd165e48..a55450563 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_direct_write.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_direct_write.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag_direct_write.h b/src/observer/table_load/dag/ob_table_load_dag_direct_write.h index 747f4b5fa..737e889af 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_direct_write.h +++ b/src/observer/table_load/dag/ob_table_load_dag_direct_write.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_direct_write_channel.cpp b/src/observer/table_load/dag/ob_table_load_dag_direct_write_channel.cpp index 65a3b561e..c94051174 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_direct_write_channel.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_direct_write_channel.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag_direct_write_channel.h b/src/observer/table_load/dag/ob_table_load_dag_direct_write_channel.h index 632369e68..582083a27 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_direct_write_channel.h +++ b/src/observer/table_load/dag/ob_table_load_dag_direct_write_channel.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_exec_ctx.h b/src/observer/table_load/dag/ob_table_load_dag_exec_ctx.h index 9a4e02f61..02532d442 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_exec_ctx.h +++ b/src/observer/table_load/dag/ob_table_load_dag_exec_ctx.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_generator.cpp b/src/observer/table_load/dag/ob_table_load_dag_generator.cpp index 5c2f9b127..7f7b1ab0f 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_generator.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_generator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag_generator.h b/src/observer/table_load/dag/ob_table_load_dag_generator.h index ecfbd1802..3bebc8b4f 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_generator.h +++ b/src/observer/table_load/dag/ob_table_load_dag_generator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_heap_mem_sort.cpp b/src/observer/table_load/dag/ob_table_load_dag_heap_mem_sort.cpp index ccf762d74..56bd378e8 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_heap_mem_sort.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_heap_mem_sort.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/src/observer/table_load/dag/ob_table_load_dag_heap_mem_sort.h b/src/observer/table_load/dag/ob_table_load_dag_heap_mem_sort.h index a995349d6..99d7146e5 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_heap_mem_sort.h +++ b/src/observer/table_load/dag/ob_table_load_dag_heap_mem_sort.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_insert_sstable_task.cpp b/src/observer/table_load/dag/ob_table_load_dag_insert_sstable_task.cpp index b65d8cd62..103795788 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_insert_sstable_task.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_insert_sstable_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -455,8 +459,10 @@ int ObTableLoadMacroBlockWriteTask::process() const ObTabletID tablet_id = row_iter->get_tablet_id(); const int64_t slice_idx = row_iter->get_slice_idx(); ObWriteMacroParam writer_param; + writer_param.is_sorted_table_load_ = true; if (OB_FAIL(ObDDLUtil::fill_writer_param(tablet_id, slice_idx, -1 /*cg_idx*/, dag_, - 0 /*max_batch_size*/, writer_param))) { + ObTabletSliceBufferTempFileWriter::ObDDLRowBuffer::DEFAULT_MAX_BATCH_SIZE, + writer_param))) { LOG_WARN("fail to fill writer param", K(ret), K(tablet_id), K(slice_idx), K(dag_)); } else if (OB_FAIL(ObDDLUtil::alloc_storage_macro_block_writer(writer_param, allocator, storage_writer))) { diff --git a/src/observer/table_load/dag/ob_table_load_dag_insert_sstable_task.h b/src/observer/table_load/dag/ob_table_load_dag_insert_sstable_task.h index 244cc3fad..1a1c2189d 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_insert_sstable_task.h +++ b/src/observer/table_load/dag/ob_table_load_dag_insert_sstable_task.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_mem_compact.cpp b/src/observer/table_load/dag/ob_table_load_dag_mem_compact.cpp index ec72a18c8..03198ecef 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_mem_compact.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_mem_compact.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag_mem_compact.h b/src/observer/table_load/dag/ob_table_load_dag_mem_compact.h index f4437ecc7..c959c132b 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_mem_compact.h +++ b/src/observer/table_load/dag/ob_table_load_dag_mem_compact.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_mem_sort.cpp b/src/observer/table_load/dag/ob_table_load_dag_mem_sort.cpp index 2d13832c6..211662646 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_mem_sort.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_mem_sort.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag_mem_sort.h b/src/observer/table_load/dag/ob_table_load_dag_mem_sort.h index 196b62ab4..5ebd6ab84 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_mem_sort.h +++ b/src/observer/table_load/dag/ob_table_load_dag_mem_sort.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_parallel_heap_table_compactor.cpp b/src/observer/table_load/dag/ob_table_load_dag_parallel_heap_table_compactor.cpp index 498de1abd..532f177b2 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_parallel_heap_table_compactor.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_parallel_heap_table_compactor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag_parallel_heap_table_compactor.h b/src/observer/table_load/dag/ob_table_load_dag_parallel_heap_table_compactor.h index 88cc0f65b..ec1bce200 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_parallel_heap_table_compactor.h +++ b/src/observer/table_load/dag/ob_table_load_dag_parallel_heap_table_compactor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_parallel_merger.cpp b/src/observer/table_load/dag/ob_table_load_dag_parallel_merger.cpp index 7e6f81857..b5041f829 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_parallel_merger.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_parallel_merger.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag_parallel_merger.h b/src/observer/table_load/dag/ob_table_load_dag_parallel_merger.h index 986d65103..77311c8ee 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_parallel_merger.h +++ b/src/observer/table_load/dag/ob_table_load_dag_parallel_merger.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_parallel_sstable_compactor.cpp b/src/observer/table_load/dag/ob_table_load_dag_parallel_sstable_compactor.cpp index 3d9eefc41..debaeaa6a 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_parallel_sstable_compactor.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_parallel_sstable_compactor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag_parallel_sstable_compactor.h b/src/observer/table_load/dag/ob_table_load_dag_parallel_sstable_compactor.h index 56abd54f4..0a50ccff7 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_parallel_sstable_compactor.h +++ b/src/observer/table_load/dag/ob_table_load_dag_parallel_sstable_compactor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_pk_mem_sort.cpp b/src/observer/table_load/dag/ob_table_load_dag_pk_mem_sort.cpp index 4a672a044..996854f17 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_pk_mem_sort.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_pk_mem_sort.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag_pk_mem_sort.h b/src/observer/table_load/dag/ob_table_load_dag_pk_mem_sort.h index 8083aedc2..5b373667d 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_pk_mem_sort.h +++ b/src/observer/table_load/dag/ob_table_load_dag_pk_mem_sort.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_pre_sort_write.cpp b/src/observer/table_load/dag/ob_table_load_dag_pre_sort_write.cpp index 2431c1e8e..45ee7c283 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_pre_sort_write.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_pre_sort_write.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag_pre_sort_write.h b/src/observer/table_load/dag/ob_table_load_dag_pre_sort_write.h index 1d204a10e..26412da8f 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_pre_sort_write.h +++ b/src/observer/table_load/dag/ob_table_load_dag_pre_sort_write.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_pre_sort_write_channel.cpp b/src/observer/table_load/dag/ob_table_load_dag_pre_sort_write_channel.cpp index ec1047caa..e684a1185 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_pre_sort_write_channel.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_pre_sort_write_channel.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag_pre_sort_write_channel.h b/src/observer/table_load/dag/ob_table_load_dag_pre_sort_write_channel.h index 7b80b6414..9c5b0343d 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_pre_sort_write_channel.h +++ b/src/observer/table_load/dag/ob_table_load_dag_pre_sort_write_channel.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_store_write.cpp b/src/observer/table_load/dag/ob_table_load_dag_store_write.cpp index d0110d509..133b294ef 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_store_write.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_store_write.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag_store_write.h b/src/observer/table_load/dag/ob_table_load_dag_store_write.h index 1891765f5..8ff302a5e 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_store_write.h +++ b/src/observer/table_load/dag/ob_table_load_dag_store_write.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_store_write_channel.cpp b/src/observer/table_load/dag/ob_table_load_dag_store_write_channel.cpp index c6340129b..3aa613481 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_store_write_channel.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_store_write_channel.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag_store_write_channel.h b/src/observer/table_load/dag/ob_table_load_dag_store_write_channel.h index f94a216c6..5c47ec18e 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_store_write_channel.h +++ b/src/observer/table_load/dag/ob_table_load_dag_store_write_channel.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_task.cpp b/src/observer/table_load/dag/ob_table_load_dag_task.cpp index abcdfcf25..9c6af95ed 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_task.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag_task.h b/src/observer/table_load/dag/ob_table_load_dag_task.h index 761bf305f..81fa6fbd8 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_task.h +++ b/src/observer/table_load/dag/ob_table_load_dag_task.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_dag_write_channel.cpp b/src/observer/table_load/dag/ob_table_load_dag_write_channel.cpp index 540793c54..05369c5d5 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_write_channel.cpp +++ b/src/observer/table_load/dag/ob_table_load_dag_write_channel.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_dag_write_channel.h b/src/observer/table_load/dag/ob_table_load_dag_write_channel.h index dbc3ce29d..dd9ad069e 100644 --- a/src/observer/table_load/dag/ob_table_load_dag_write_channel.h +++ b/src/observer/table_load/dag/ob_table_load_dag_write_channel.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/dag/ob_table_load_empty_insert_dag.cpp b/src/observer/table_load/dag/ob_table_load_empty_insert_dag.cpp index f5cc1c192..d675572cc 100644 --- a/src/observer/table_load/dag/ob_table_load_empty_insert_dag.cpp +++ b/src/observer/table_load/dag/ob_table_load_empty_insert_dag.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/dag/ob_table_load_empty_insert_dag.h b/src/observer/table_load/dag/ob_table_load_empty_insert_dag.h index 39d826b53..21e8d458a 100644 --- a/src/observer/table_load/dag/ob_table_load_empty_insert_dag.h +++ b/src/observer/table_load/dag/ob_table_load_empty_insert_dag.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_assigned_memory_manager.cpp b/src/observer/table_load/ob_table_load_assigned_memory_manager.cpp index 76381613b..4440b8be6 100644 --- a/src/observer/table_load/ob_table_load_assigned_memory_manager.cpp +++ b/src/observer/table_load/ob_table_load_assigned_memory_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -139,4 +143,4 @@ int ObTableLoadAssignedMemoryManager::get_sort_memory(int64_t &sort_memory) } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/ob_table_load_assigned_memory_manager.h b/src/observer/table_load/ob_table_load_assigned_memory_manager.h index cb0a34bb1..f4a9d8a04 100644 --- a/src/observer/table_load/ob_table_load_assigned_memory_manager.h +++ b/src/observer/table_load/ob_table_load_assigned_memory_manager.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -44,4 +48,4 @@ class ObTableLoadAssignedMemoryManager }; } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/ob_table_load_assigned_task_manager.cpp b/src/observer/table_load/ob_table_load_assigned_task_manager.cpp index 79fafb1be..1d6757677 100644 --- a/src/observer/table_load/ob_table_load_assigned_task_manager.cpp +++ b/src/observer/table_load/ob_table_load_assigned_task_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -121,4 +125,4 @@ int ObTableLoadAssignedTaskManager::get_assigned_tasks(ObSArray(param_.get_table_name().length()), param_.get_table_name().ptr(), param_.get_task_id())); - OZ(session_info_->load_default_sys_variable(false /*print_info_log*/, false /*is_sys_tenant*/)); //加载默认的session参数 + OZ(session_info_->load_default_sys_variable(false /*print_info_log*/, false /*is_sys_tenant*/)); // load default session parameters OZ(session_info_->load_default_configs_in_pc()); OX(session_info_->init_tenant(tenant_info->get_tenant_name(), tenant_id)); OX(session_info_->set_priv_user_id(user_id)); diff --git a/src/observer/table_load/ob_table_load_client_task.h b/src/observer/table_load/ob_table_load_client_task.h index 99e05bc98..34780f30e 100644 --- a/src/observer/table_load/ob_table_load_client_task.h +++ b/src/observer/table_load/ob_table_load_client_task.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_coordinator.cpp b/src/observer/table_load/ob_table_load_coordinator.cpp index ea691a597..3041031b6 100644 --- a/src/observer/table_load/ob_table_load_coordinator.cpp +++ b/src/observer/table_load/ob_table_load_coordinator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -171,10 +175,10 @@ int ObTableLoadCoordinator::abort_peers_ctx(ObTableLoadTableCtx *ctx) for (int64_t i = 0; i < curr_round->count(); ++i) { StoreInfo *store_info = curr_round->at(i); const ObAddr &addr = store_info->addr_; - if (ObTableLoadUtils::is_local_addr(addr)) { // 本机 + if (ObTableLoadUtils::is_local_addr(addr)) { // local address ObTableLoadStore::abort_ctx(ctx, arg.error_code_, res.is_stopped_); ret = OB_SUCCESS; - } else { // 远端, 发送rpc + } else { // remote, send rpc // use default timeout value, avoid timeout immediately const int64_t origin_timeout_ts = THIS_WORKER.get_timeout_ts(); THIS_WORKER.set_timeout_ts(ObTimeUtil::current_time() + DEFAULT_TIMEOUT_US); @@ -278,16 +282,14 @@ int ObTableLoadCoordinator::calc_session_count( bool include_coord_addr = false; int64_t total_partitions = 0; int64_t store_server_count = all_leader_info_array.count(); - - // 判断coordinator节点是否也作为store节点 + // Determine if the coordinator node also serves as a store node for (int64_t i = 0; i < store_server_count; i++) { total_partitions += all_leader_info_array[i].partition_id_array_.count(); if (coord_addr == all_leader_info_array[i].addr_) { include_coord_addr = true; } } - - // 资源控制先确定线程,第一次遍历先按分区等比例分配线程 + // Resource control first determines the thread, the first traversal allocates threads proportionally by partition for (int64_t i = 0; OB_SUCC(ret) && i < store_server_count; i++) { ObDirectLoadResourceUnit unit; unit.addr_ = all_leader_info_array[i].addr_; @@ -302,8 +304,7 @@ int ObTableLoadCoordinator::calc_session_count( } } } - - // 第一次遍历如果不能分配完所有的线程,继续给每个节点平均分配剩余的线程,直到所有的线程都被分配完 + // The first traversal cannot allocate all threads, continue to average allocate the remaining threads to each node until all threads are allocated if (OB_SUCC(ret)) { bool need_break = false; while (remain_session_count > 0 && !need_break) { @@ -320,8 +321,8 @@ int ObTableLoadCoordinator::calc_session_count( } /* - 协调节点不存在数据分区时,需要申请线程资源,但不需要申请内存,放在申请资源数组的最后一个位置 - coord_session_count表示coordinator节点可用线程数,min_session_count表示所有节点可用线程数的最小值 + When the coordinator node does not have data partitions, thread resources need to be requested, but memory does not need to be requested, and it is placed at the last position of the resource request array + coord_session_count indicates the number of available threads on the coordinator node, min_session_count indicates the minimum value of available threads across all nodes */ if (OB_SUCC(ret)) { if (!include_coord_addr) { @@ -345,8 +346,8 @@ int ObTableLoadCoordinator::calc_session_count( } /* - 确定write_session_count,表示发送数据阶段store节点可用的线程数 - 对于load data模式,如果 协调节点和数据节点都在同一个节点上,就分出一半的线程用于解析数据,一半的线程用于存储数据 + Determine write_session_count, which represents the number of available threads on the store node during the data sending phase + For load data mode, if the coordinator node and data node are on the same node, half of the threads are allocated for data parsing and the other half for data storage */ if (OB_SUCC(ret)) { if (include_coord_addr && ObDirectLoadMode::is_load_data(ctx_->param_.load_mode_)) { @@ -371,35 +372,35 @@ int ObTableLoadCoordinator::calc_memory_size( { int ret = OB_SUCCESS; /* - 先确定主表是否要走排序,对于堆表,sql指定need_sort=true时,如果内存满足不排序,就走不排序流程,只要有一个节点内存不足,整体都要走排序 - 如果主表要走排序,则整个任务按排序方式分配内存,否则再确定是否要做lob_id排序和索引排序,需要的话就按照MAX(主表不排序内存,索引排序内存)来分配内存,否则分配主表不排序需要的内存 + First determine if the main table needs sorting. For heap tables, when SQL specifies need_sort=true, if memory is sufficient for no sorting, the no-sorting process is taken. As long as one node has insufficient memory, the entire process must follow the sorting path. + If the main table requires sorting, the entire task will allocate memory according to the sorting method. Otherwise, determine if LOB_ID sorting and index sorting are needed. If so, allocate memory based on MAX(main table no-sorting memory, index sorting memory). Otherwise, allocate memory required for the main table no-sorting process. */ for (int64_t i = 0; !main_need_sort && i < store_server_count; i++) { ObDirectLoadResourceUnit &unit = apply_arg.apply_array_[i]; int64_t min_sort_memory = unit.thread_count_ * ObDirectLoadExternalMultiPartitionRowChunk::MIN_MEMORY_LIMIT * 4; int64_t min_unsort_memory = 0; int64_t thread_count = write_session_count; - // insert into 和 insert overwrite各个节点的并发在写入数据阶段是独立的 + // The concurrency of insert into and insert overwrite at each node is independent during the data writing phase if (ObDirectLoadMode::is_insert_overwrite(ctx_->param_.load_mode_) || ObDirectLoadMode::is_insert_into(ctx_->param_.load_mode_)) { thread_count = unit.thread_count_; } if (ctx_->schema_.is_table_without_pk_) { if (!ctx_->param_.need_sort_) { - // sql指定need_sort=false,强制不排序 + // sql specifies need_sort=false, forces no sorting } else if (partitions[i] == 1) { - // 单分区排序与不排序需要的内存是一样的, 不走排序 + // Single partition sorting and non-sorting require the same amount of memory, do not perform sorting } else { - // 直接写宏块需要的内存,对于非排序模式,每个分区各自写宏块,所以要乘分区数 + // Directly write the memory needed for macroblocks, for non-sorting mode, each partition writes its own macroblocks, so it needs to be multiplied by the number of partitions min_unsort_memory = part_unsort_memory * partitions[i] * thread_count; if (min_unsort_memory > memory_limit) { main_need_sort = true; } } } else { - // 取写宏块或写临时文件需要内存的最小值,对于非排序模式,每个分区各自写临时文件,所以要乘分区数 + // Get the minimum memory required for writing macro blocks or writing temporary files, for non-sorting mode, each partition writes its own temporary file, so it needs to be multiplied by the number of partitions min_unsort_memory = part_unsort_memory * partitions[i] * thread_count; if (ctx_->param_.need_sort_) { - // sql指定need_sort=true,强制走排序 + // sql specifies need_sort=true, forces sorting to be used main_need_sort = true; } else { if (min_unsort_memory > memory_limit) { @@ -426,25 +427,25 @@ int ObTableLoadCoordinator::calc_memory_size( for (int64_t i = 0; OB_SUCC(ret) && i < store_server_count; i++) { ObDirectLoadResourceUnit &unit = apply_arg.apply_array_[i]; - int64_t min_memory = MIN(min_part_memory * unit.thread_count_, memory_limit); // 至少需要分配的内存 - int64_t min_sort_memory = MIN(unit.thread_count_ * ObDirectLoadExternalMultiPartitionRowChunk::MIN_MEMORY_LIMIT * 4, memory_limit); // 排序至少需要分配的内存 + int64_t min_memory = MIN(min_part_memory * unit.thread_count_, memory_limit); // Minimum memory that needs to be allocated + int64_t min_sort_memory = MIN(unit.thread_count_ * ObDirectLoadExternalMultiPartitionRowChunk::MIN_MEMORY_LIMIT * 4, memory_limit); // At least the memory that needs to be allocated for sorting int64_t min_unsort_memory = 0; int64_t thread_count = write_session_count; - // insert into 和 insert overwrite各个节点的并发在写入数据阶段是独立的 + // The concurrency of insert into and insert overwrite at each node is independent during the data writing phase if (ObDirectLoadMode::is_insert_overwrite(ctx_->param_.load_mode_) || ObDirectLoadMode::is_insert_into(ctx_->param_.load_mode_)) { thread_count = unit.thread_count_; } - min_unsort_memory = MIN(part_unsort_memory * partitions[i] * thread_count, memory_limit); // 不排序最少需要分配的内存 + min_unsort_memory = MIN(part_unsort_memory * partitions[i] * thread_count, memory_limit); // Minimum memory required to be allocated without sorting if (task_need_sort) { if (main_need_sort) { - // 都排序 + // All sorted unit.memory_size_ = MAX(min_sort_memory, min_memory); } else { - // 部分排序部分不排序 + // Partial sorting, partial not sorting unit.memory_size_ = MAX(MAX(min_unsort_memory, min_sort_memory), min_memory); } } else { - // 都不排序 + // Do not sort unit.memory_size_ = MAX(min_memory, min_unsort_memory); } } @@ -463,37 +464,37 @@ int ObTableLoadCoordinator::gen_apply_arg(ObDirectLoadResourceApplyArg &apply_ar apply_arg.task_key_ = ObTableLoadUniqueKey(ctx_->param_.table_id_, ctx_->ddl_param_.task_id_); int64_t retry_count = 0; ObAddr coordinator_addr = ObServer::get_instance().get_self(); - int64_t part_unsort_memory = 0; // 一个分区写入阶段不排序需要的内存, 用于判断是否排序 - int64_t min_part_memory = 0; // 一个分区在整个导入过程中至少需要的内存, 用于计算分配的内存大小 + int64_t part_unsort_memory = 0; // Memory required for a partition write phase without sorting, used to determine whether to sort + int64_t min_part_memory = 0; // The minimum memory a partition needs throughout the entire import process, used for calculating the allocated memory size int64_t parallel_servers_target = 0; if (ctx_->schema_.is_table_without_pk_) { - // 直接写宏块需要的内存 + // directly write the memory needed for macroblocks if (!ctx_->schema_.is_column_store() || ObDirectLoadMethod::is_incremental(ctx_->param_.method_)) { - // 行存 - part_unsort_memory = MACROBLOCK_BUFFER_SIZE; // DDL构造宏块的内存 - min_part_memory = MACROBLOCK_BUFFER_SIZE; // DDL构造宏块的内存 + // row storage + part_unsort_memory = MACROBLOCK_BUFFER_SIZE; // Memory for DDL to construct macroblocks + min_part_memory = MACROBLOCK_BUFFER_SIZE; // Memory for DDL to construct macroblocks } else { - // 列存 + // Column store part_unsort_memory = ctx_->schema_.cg_cnt_ * - ObCGRowFilesGenerater::CG_ROW_FILE_MEMORY_LIMIT; // DDL多cg同时写临时文件的内存 + ObCGRowFilesGenerater::CG_ROW_FILE_MEMORY_LIMIT; // Memory for DDL to write multiple CG temporary files simultaneously min_part_memory = MAX(ctx_->schema_.cg_cnt_ * ObCGRowFilesGenerater::CG_ROW_FILE_MEMORY_LIMIT, - MACROBLOCK_BUFFER_SIZE); // DDL多cg同时写临时文件的内存, rescan按cg构造宏块内存 + MACROBLOCK_BUFFER_SIZE); // Memory for DDL to write multiple CG temporary files simultaneously, rescan constructs macro block memory by CG } } else { if (!ctx_->schema_.is_column_store() || ObDirectLoadMethod::is_incremental(ctx_->param_.method_)) { - // 行存 - part_unsort_memory = SSTABLE_BUFFER_SIZE; // 按行写临时文件的内存 - min_part_memory = MACROBLOCK_BUFFER_SIZE; // DDL构造宏块的内存 + // row storage + part_unsort_memory = SSTABLE_BUFFER_SIZE; // Memory for writing temporary files line by line + min_part_memory = MACROBLOCK_BUFFER_SIZE; // Memory for DDL to construct macroblocks } else { - // 列存 - part_unsort_memory = SSTABLE_BUFFER_SIZE; // 按行写临时文件的内存 + // Column store + part_unsort_memory = SSTABLE_BUFFER_SIZE; // Memory for writing temporary files by row min_part_memory = MAX(ctx_->schema_.cg_cnt_ * ObCGRowFilesGenerater::CG_ROW_FILE_MEMORY_LIMIT, - MACROBLOCK_BUFFER_SIZE); // DDL多cg同时写临时文件的内存, rescan按cg构造宏块内存 + MACROBLOCK_BUFFER_SIZE); // Memory for DDL to write multiple CG temporary files simultaneously, rescan constructs macro block memory by CG } } while (OB_SUCC(ret)) { @@ -517,8 +518,8 @@ int ObTableLoadCoordinator::gen_apply_arg(ObDirectLoadResourceApplyArg &apply_ar LOG_WARN("fail read tenant variable", KR(ret), K(tenant_id)); } else { bool include_cur_addr = false; - bool task_need_sort = false; // 表示整个导入任务是否会走排序的流程 - bool main_need_sort = false; // 表示主表是否会走排序 + bool task_need_sort = false; // Indicates whether the entire import task will go through the sorting process + bool main_need_sort = false; // Indicates whether the main table will go through sorting int64_t total_partitions = 0; ObArray partitions; partitions.set_tenant_id(MTL_ID()); @@ -527,8 +528,8 @@ int ObTableLoadCoordinator::gen_apply_arg(ObDirectLoadResourceApplyArg &apply_ar int64_t write_session_count = 0; int64_t min_session_count = ctx_->param_.parallel_; int64_t max_session_count = 0; - int64_t limit_session_count = MIN(memory_limit / min_part_memory, ObMacroDataSeq::MAX_PARALLEL_IDX + 1); // 节点内不能超过这个并行度 - int64_t total_limit_session_count = MIN(limit_session_count * store_server_count, parallel_servers_target); // 所有节点加起来不能超过这个并行度 + int64_t limit_session_count = MIN(memory_limit / min_part_memory, ObMacroDataSeq::MAX_PARALLEL_IDX + 1); // The parallelism within the node cannot exceed this value + int64_t total_limit_session_count = MIN(limit_session_count * store_server_count, parallel_servers_target); // The total number of sessions across all nodes cannot exceed this level of parallelism int64_t total_session_count = MIN(ctx_->param_.parallel_, total_limit_session_count); ObDirectLoadResourceOpRes apply_res; @@ -636,7 +637,7 @@ int ObTableLoadCoordinator::pre_begin_peers(ObDirectLoadResourceApplyArg &apply_ const ObTableLoadPartitionLocation::LeaderInfo &leader_info = all_leader_info_array.at(i); const ObTableLoadPartitionLocation::LeaderInfo &target_leader_info = target_all_leader_info_array.at(i); - //目前源表和目标表的分区信息连同每个分区的地址都完全一样 + //The partition information of the source table and the target table, along with the address of each partition, is completely the same if (OB_UNLIKELY(addr != leader_info.addr_ || addr != target_leader_info.addr_)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("addr must be same", K(addr), @@ -653,7 +654,7 @@ int ObTableLoadCoordinator::pre_begin_peers(ObDirectLoadResourceApplyArg &apply_ arg.target_partition_id_array_ = target_leader_info.partition_id_array_; if (OB_FAIL(ret)) { - } else if (ObTableLoadUtils::is_local_addr(addr)) { // 本机 + } else if (ObTableLoadUtils::is_local_addr(addr)) { // local address ctx_->param_.session_count_ = arg.config_.parallel_; ctx_->param_.avail_memory_ = arg.avail_memory_; LOG_INFO("table load local pre begin", K(arg)); @@ -667,7 +668,7 @@ int ObTableLoadCoordinator::pre_begin_peers(ObDirectLoadResourceApplyArg &apply_ LOG_WARN("fail to store pre begin", KR(ret)); } } - } else { // 对端, 发送rpc + } else { // peer, send rpc TABLE_LOAD_CONTROL_RPC_CALL(pre_begin, addr, arg); } if (OB_SUCC(ret)) { @@ -801,7 +802,7 @@ int ObTableLoadCoordinator::confirm_begin_peers() for (int64_t i = 0; OB_SUCC(ret) && i < coordinator_ctx_->store_infos_.count(); ++i) { ObTableLoadCoordinatorCtx::StoreInfo &store_info = coordinator_ctx_->store_infos_.at(i); const ObAddr &addr = store_info.addr_; - if (ObTableLoadUtils::is_local_addr(addr)) { // 本机 + if (ObTableLoadUtils::is_local_addr(addr)) { // Local machine LOG_INFO("table load local confirm begin", K(arg)); ObTableLoadStore store(ctx_); if (OB_FAIL(store.init())) { @@ -809,7 +810,7 @@ int ObTableLoadCoordinator::confirm_begin_peers() } else if (OB_FAIL(store.confirm_begin())) { LOG_WARN("fail to store confirm begin", KR(ret)); } - } else { // 对端, 发送rpc + } else { // peer, send rpc TABLE_LOAD_CONTROL_RPC_CALL(confirm_begin, addr, arg); } } @@ -868,14 +869,14 @@ int ObTableLoadCoordinator::check_peers_begin_result(bool &is_finish) is_finish = true; for (int64_t i = 0; OB_SUCC(ret) && i < coordinator_ctx_->store_infos_.count(); ++i) { const ObAddr &addr = coordinator_ctx_->store_infos_.at(i).addr_; - if (ObTableLoadUtils::is_local_addr(addr)) { // 本机 + if (ObTableLoadUtils::is_local_addr(addr)) { // local address ObTableLoadStore store(ctx_); if (OB_FAIL(store.init())) { LOG_WARN("fail to init store", KR(ret)); } else if (OB_FAIL(store.get_status(res.status_, res.error_code_))) { LOG_WARN("fail to store get status", KR(ret)); } - } else { // 远端, 发送rpc + } else { // remote, send rpc TABLE_LOAD_CONTROL_RPC_CALL(get_status, addr, arg, res); } if (OB_SUCC(ret)) { @@ -920,11 +921,11 @@ class ObTableLoadCoordinator::CheckBeginResultTaskProcessor : public ObITableLoa } ObTableLoadIndexLongWait wait_obj(10 * 1000, WAIT_INTERVAL_US); while (OB_SUCC(ret)) { - // 确认状态 + // Confirm status if (OB_FAIL(ctx_->coordinator_ctx_->check_status(ObTableLoadStatusType::INITED))) { LOG_WARN("fail to check coordinator status inited", KR(ret)); } - // 查询合并状态 + // Query merge status else if (OB_FAIL(coordinator.check_peers_begin_result(is_finish))) { LOG_WARN("fail to check peers begin result", KR(ret)); } else if (!is_finish) { @@ -976,19 +977,19 @@ int ObTableLoadCoordinator::add_check_begin_result_task() LOG_WARN("ObTableLoadCoordinator not init", KR(ret), KP(this)); } else { ObTableLoadTask *task = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(ctx_->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor(ctx_))) { LOG_WARN("fail to set check begin result task processor", KR(ret)); } - // 3. 设置callback + // 3. Set callback else if (OB_FAIL(task->set_callback(ctx_))) { LOG_WARN("fail to set check begin result task callback", KR(ret)); } - // 4. 把task放入调度器 + // 4. put task into scheduler else if (OB_FAIL(coordinator_ctx_->task_scheduler_->add_task(0, task))) { LOG_WARN("fail to add task", KR(ret), KPC(task)); } @@ -1025,7 +1026,7 @@ int ObTableLoadCoordinator::pre_merge_peers() } for (int64_t i = 0; OB_SUCC(ret) && i < coordinator_ctx_->store_infos_.count(); ++i) { const ObAddr &addr = coordinator_ctx_->store_infos_.at(i).addr_; - if (ObTableLoadUtils::is_local_addr(addr)) { // 本机 + if (ObTableLoadUtils::is_local_addr(addr)) { // Local machine LOG_INFO("table load local pre merge", K(arg)); ObTableLoadStore store(ctx_); if (OB_FAIL(store.init())) { @@ -1033,7 +1034,7 @@ int ObTableLoadCoordinator::pre_merge_peers() } else if (OB_FAIL(store.pre_merge(arg.committed_trans_id_array_))) { LOG_WARN("fail to store pre merge", KR(ret)); } - } else { // 远端, 发送rpc + } else { // remote, send rpc TABLE_LOAD_CONTROL_RPC_CALL(pre_merge, addr, arg); } } @@ -1051,7 +1052,7 @@ int ObTableLoadCoordinator::start_merge_peers() arg.task_id_ = ctx_->ddl_param_.task_id_; for (int64_t i = 0; OB_SUCC(ret) && i < coordinator_ctx_->store_infos_.count(); ++i) { const ObAddr &addr = coordinator_ctx_->store_infos_.at(i).addr_; - if (ObTableLoadUtils::is_local_addr(addr)) { // 本机 + if (ObTableLoadUtils::is_local_addr(addr)) { // Local machine LOG_INFO("table load local start merge", K(arg)); ObTableLoadStore store(ctx_); if (OB_FAIL(store.init())) { @@ -1059,7 +1060,7 @@ int ObTableLoadCoordinator::start_merge_peers() } else if (OB_FAIL(store.start_merge())) { LOG_WARN("fail to store start merge", KR(ret)); } - } else { // 远端, 发送rpc + } else { // remote, send rpc TABLE_LOAD_CONTROL_RPC_CALL(start_merge, addr, arg); } } @@ -1078,18 +1079,18 @@ int ObTableLoadCoordinator::finish() ObMutexGuard guard(coordinator_ctx_->get_op_lock()); bool active_trans_exist = false; bool committed_trans_eixst = false; - // 1. 冻结状态, 防止后续继续创建trans + // 1. Frozen state, prevent further creation of trans if (OB_FAIL(coordinator_ctx_->set_status_frozen())) { LOG_WARN("fail to set coordinator status frozen", KR(ret)); } - // 2. 检查当前是否还有trans没有结束 + // 2. Check if there are any trans that have not ended yet else if (OB_FAIL(coordinator_ctx_->check_exist_trans(active_trans_exist))) { LOG_WARN("fail to check exist trans", KR(ret)); } else if (OB_UNLIKELY(active_trans_exist)) { ret = OB_ENTRY_EXIST; LOG_WARN("trans already exist", KR(ret)); } else if (!ctx_->param_.px_mode_) { - // 3. 检查是否有数据 + // 3. Check if there is data if (OB_FAIL(coordinator_ctx_->check_exist_committed_trans(committed_trans_eixst))) { LOG_WARN("fail to check exist committed trans", KR(ret)); } else if (OB_UNLIKELY(!committed_trans_eixst)) { @@ -1098,17 +1099,17 @@ int ObTableLoadCoordinator::finish() } } if (OB_SUCC(ret)) { - // 4. 触发数据节点发起合并 + // 4. Trigger data node to initiate merge if (OB_FAIL(pre_merge_peers())) { LOG_WARN("fail to pre merge peers", KR(ret)); } else if (OB_FAIL(start_merge_peers())) { LOG_WARN("fail to start merge peers", KR(ret)); } - // 5. 设置当前状态为合并中 + // 5. Set the current status to merging else if (OB_FAIL(coordinator_ctx_->set_status_merging())) { LOG_WARN("fail to set coordinator status merging", KR(ret)); } - // 6. 添加定时任务检查合并结果 + // 6. Add scheduled task to check merge results else if (OB_FAIL(add_check_merge_result_task())) { LOG_WARN("fail to add check merge result task", KR(ret)); } @@ -1133,14 +1134,14 @@ int ObTableLoadCoordinator::check_peers_merge_result(bool &is_finish) is_finish = true; for (int64_t i = 0; OB_SUCC(ret) && i < coordinator_ctx_->store_infos_.count(); ++i) { const ObAddr &addr = coordinator_ctx_->store_infos_.at(i).addr_; - if (ObTableLoadUtils::is_local_addr(addr)) { // 本机 + if (ObTableLoadUtils::is_local_addr(addr)) { // local address ObTableLoadStore store(ctx_); if (OB_FAIL(store.init())) { LOG_WARN("fail to init store", KR(ret)); } else if (OB_FAIL(store.get_status(res.status_, res.error_code_))) { LOG_WARN("fail to store get status", KR(ret)); } - } else { // 远端, 发送rpc + } else { // remote, send rpc TABLE_LOAD_CONTROL_RPC_CALL(get_status, addr, arg, res); } if (OB_SUCC(ret)) { @@ -1185,11 +1186,11 @@ class ObTableLoadCoordinator::CheckMergeResultTaskProcessor : public ObITableLoa } ObTableLoadIndexLongWait wait_obj(10 * 1000, WAIT_INTERVAL_US); while (OB_SUCC(ret)) { - // 确认状态 + // Confirm status if (OB_FAIL(ctx_->coordinator_ctx_->check_status(ObTableLoadStatusType::MERGING))) { LOG_WARN("fail to check coordinator status merging", KR(ret)); } - // 查询合并状态 + // Query merge status else if (OB_FAIL(coordinator.check_peers_merge_result(is_merge_finish))) { LOG_WARN("fail to check peers merge result", KR(ret)); } else if (!is_merge_finish) { @@ -1241,19 +1242,19 @@ int ObTableLoadCoordinator::add_check_merge_result_task() LOG_WARN("ObTableLoadCoordinator not init", KR(ret), KP(this)); } else { ObTableLoadTask *task = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(ctx_->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor(ctx_))) { LOG_WARN("fail to set check merge result task processor", KR(ret)); } - // 3. 设置callback + // 3. Set callback else if (OB_FAIL(task->set_callback(ctx_))) { LOG_WARN("fail to set check merge result task callback", KR(ret)); } - // 4. 把task放入调度器 + // 4. put task into scheduler else if (OB_FAIL(coordinator_ctx_->task_scheduler_->add_task(0, task))) { LOG_WARN("fail to add task", KR(ret), KPC(task)); } @@ -1287,7 +1288,7 @@ int ObTableLoadCoordinator::commit_peers(ObTableLoadSqlStatistics &sql_statistic for (int64_t i = 0; OB_SUCC(ret) && i < coordinator_ctx_->store_infos_.count(); ++i) { ObTableLoadCoordinatorCtx::StoreInfo &store_info = coordinator_ctx_->store_infos_.at(i); const ObAddr &addr = store_info.addr_; - if (ObTableLoadUtils::is_local_addr(addr)) { // 本机 + if (ObTableLoadUtils::is_local_addr(addr)) { // Local machine LOG_INFO("table load local commit begin", K(arg)); ObTableLoadStore store(ctx_); if (OB_FAIL(store.init())) { @@ -1298,7 +1299,7 @@ int ObTableLoadCoordinator::commit_peers(ObTableLoadSqlStatistics &sql_statistic res.trans_result_))) { LOG_WARN("fail to commit store", KR(ret)); } - } else { // 远端, 发送rpc + } else { // remote, send rpc TABLE_LOAD_CONTROL_RPC_CALL(commit, addr, arg, res); } if (OB_SUCC(ret)) { @@ -1498,14 +1499,14 @@ int ObTableLoadCoordinator::heart_beat_peer() arg.task_id_ = ctx_->ddl_param_.task_id_; for (int64_t i = 0; i < coordinator_ctx_->store_infos_.count(); ++i) { const ObAddr &addr = coordinator_ctx_->store_infos_.at(i).addr_; - if (ObTableLoadUtils::is_local_addr(addr)) { // 本机 + if (ObTableLoadUtils::is_local_addr(addr)) { // local address ObTableLoadStore store(ctx_); if (OB_FAIL(store.init())) { LOG_WARN("fail to init store", KR(ret)); } else if (OB_FAIL(store.heart_beat())) { LOG_WARN("fail to heart beat store", KR(ret)); } - } else { // 远端, 发送rpc + } else { // remote, send rpc const int64_t origin_timeout_ts = THIS_WORKER.get_timeout_ts(); THIS_WORKER.set_timeout_ts(ObTimeUtil::current_time() + HEART_BEAT_RPC_TIMEOUT_US); TABLE_LOAD_CONTROL_RPC_CALL(heart_beat, addr, arg); @@ -1523,7 +1524,7 @@ int ObTableLoadCoordinator::heart_beat() ret = OB_NOT_INIT; LOG_WARN("ObTableLoadCoordinator not init", KR(ret), KP(this)); } else { - // 心跳是为了让数据节点感知控制节点存活, 控制节点不依赖心跳感知数据节点状态, 忽略失败 + // Heartbeat is to let data nodes perceive control node survival, control node does not rely on heartbeat to perceive data node status, ignore failure heart_beat_peer(); } return ret; @@ -1545,14 +1546,14 @@ int ObTableLoadCoordinator::pre_start_trans_peers(ObTableLoadCoordinatorTrans *t arg.trans_id_ = trans_id; for (int64_t i = 0; OB_SUCC(ret) && i < coordinator_ctx_->store_infos_.count(); ++i) { const ObAddr &addr = coordinator_ctx_->store_infos_.at(i).addr_; - if (ObTableLoadUtils::is_local_addr(addr)) { // 本机 + if (ObTableLoadUtils::is_local_addr(addr)) { // local address ObTableLoadStore store(ctx_); if (OB_FAIL(store.init())) { LOG_WARN("fail to init store", KR(ret)); } else if (OB_FAIL(store.pre_start_trans(trans_id))) { LOG_WARN("fail to store pre start trans", KR(ret), K(trans_id)); } - } else { // 远端, 发送rpc + } else { // remote, send rpc TABLE_LOAD_CONTROL_RPC_CALL(pre_start_trans, addr, arg); } } @@ -1572,14 +1573,14 @@ int ObTableLoadCoordinator::confirm_start_trans_peers(ObTableLoadCoordinatorTran arg.trans_id_ = trans_id; for (int64_t i = 0; OB_SUCC(ret) && i < coordinator_ctx_->store_infos_.count(); ++i) { const ObAddr &addr = coordinator_ctx_->store_infos_.at(i).addr_; - if (ObTableLoadUtils::is_local_addr(addr)) { // 本机 + if (ObTableLoadUtils::is_local_addr(addr)) { // local address ObTableLoadStore store(ctx_); if (OB_FAIL(store.init())) { LOG_WARN("fail to init store", KR(ret)); } else if (OB_FAIL(store.confirm_start_trans(trans_id))) { LOG_WARN("fail to store confirm start trans", KR(ret), K(trans_id)); } - } else { // 远端, 发送rpc + } else { // remote, send rpc TABLE_LOAD_CONTROL_RPC_CALL(confirm_start_trans, addr, arg); } } @@ -1610,13 +1611,13 @@ int ObTableLoadCoordinator::start_trans(const ObTableLoadSegmentID &segment_id, ret = OB_SUCCESS; } } - // 2. 同步到对端 + // 2. Synchronize to the peer else if (OB_FAIL(pre_start_trans_peers(trans))) { LOG_WARN("fail to pre start trans peers", KR(ret)); } else if (OB_FAIL(confirm_start_trans_peers(trans))) { LOG_WARN("fail to confirm start trans peers", KR(ret)); } - // 3. 状态设置为running + // 3. Set status to running else if (OB_FAIL(trans->set_trans_status_running())) { LOG_WARN("fail to set trans status running", KR(ret)); } else { @@ -1652,14 +1653,14 @@ int ObTableLoadCoordinator::pre_finish_trans_peers(ObTableLoadCoordinatorTrans * arg.trans_id_ = trans_id; for (int64_t i = 0; OB_SUCC(ret) && i < coordinator_ctx_->store_infos_.count(); ++i) { const ObAddr &addr = coordinator_ctx_->store_infos_.at(i).addr_; - if (ObTableLoadUtils::is_local_addr(addr)) { // 本机 + if (ObTableLoadUtils::is_local_addr(addr)) { // local address ObTableLoadStore store(ctx_); if (OB_FAIL(store.init())) { LOG_WARN("fail to init store", KR(ret)); } else if (OB_FAIL(store.pre_finish_trans(trans_id))) { LOG_WARN("fail to store pre finish trans", KR(ret), K(trans_id)); } - } else { // 远端, 发送rpc + } else { // remote, send rpc TABLE_LOAD_CONTROL_RPC_CALL(pre_finish_trans, addr, arg); } } @@ -1679,14 +1680,14 @@ int ObTableLoadCoordinator::confirm_finish_trans_peers(ObTableLoadCoordinatorTra arg.trans_id_ = trans_id; for (int64_t i = 0; OB_SUCC(ret) && i < coordinator_ctx_->store_infos_.count(); ++i) { const ObAddr &addr = coordinator_ctx_->store_infos_.at(i).addr_; - if (ObTableLoadUtils::is_local_addr(addr)) { // 本机 + if (ObTableLoadUtils::is_local_addr(addr)) { // local address ObTableLoadStore store(ctx_); if (OB_FAIL(store.init())) { LOG_WARN("fail to init store", KR(ret)); } else if (OB_FAIL(store.confirm_finish_trans(trans_id))) { LOG_WARN("fail to store confirm finish trans", KR(ret), K(trans_id)); } - } else { // 远端, 发送rpc + } else { // remote, send rpc TABLE_LOAD_CONTROL_RPC_CALL(confirm_finish_trans, addr, arg); } } @@ -1733,7 +1734,7 @@ int ObTableLoadCoordinator::check_peers_trans_commit(ObTableLoadCoordinatorTrans is_commit = true; for (int64_t i = 0; OB_SUCC(ret) && i < coordinator_ctx_->store_infos_.count(); ++i) { const ObAddr &addr = coordinator_ctx_->store_infos_.at(i).addr_; - if (ObTableLoadUtils::is_local_addr(addr)) { // 本机 + if (ObTableLoadUtils::is_local_addr(addr)) { // local address ObTableLoadStore store(ctx_); if (OB_FAIL(store.init())) { LOG_WARN("fail to init store", KR(ret)); @@ -1741,7 +1742,7 @@ int ObTableLoadCoordinator::check_peers_trans_commit(ObTableLoadCoordinatorTrans res.error_code_))) { LOG_WARN("fail to store get trans status", KR(ret)); } - } else { // 远端, 发送rpc + } else { // remote, send rpc TABLE_LOAD_CONTROL_RPC_CALL(get_trans_status, addr, arg, res); } if (OB_SUCC(ret)) { @@ -1767,11 +1768,11 @@ int ObTableLoadCoordinator::check_trans_commit(ObTableLoadCoordinatorTrans *tran bool is_peers_commit = false; ObTableLoadIndexLongWait wait_obj(10 * 1000, WAIT_INTERVAL_US); while (OB_SUCC(ret)) { - // 确认trans状态为frozen + // Confirm trans status is frozen if (OB_FAIL(trans->check_trans_status(ObTableLoadTransStatusType::FROZEN))) { LOG_WARN("fail to check trans status frozen", KR(ret)); } - // 向对端发送pre finish + // Send pre finish to the remote end else if (OB_FAIL(check_peers_trans_commit(trans, is_peers_commit))) { LOG_WARN("fail to check peers trans commit", KR(ret)); } else if (!is_peers_commit) { @@ -1840,14 +1841,14 @@ int ObTableLoadCoordinator::abandon_trans_peers(ObTableLoadCoordinatorTrans *tra arg.trans_id_ = trans_id; for (int64_t i = 0; OB_SUCC(ret) && i < coordinator_ctx_->store_infos_.count(); ++i) { const ObAddr &addr = coordinator_ctx_->store_infos_.at(i).addr_; - if (ObTableLoadUtils::is_local_addr(addr)) { // 本机 + if (ObTableLoadUtils::is_local_addr(addr)) { // local address ObTableLoadStore store(ctx_); if (OB_FAIL(store.init())) { LOG_WARN("fail to init store", KR(ret)); } else if (OB_FAIL(store.abandon_trans(trans_id))) { LOG_WARN("fail to store abandon trans", KR(ret), K(trans_id)); } - } else { // 远端, 发送rpc + } else { // remote, send rpc TABLE_LOAD_CONTROL_RPC_CALL(abandon_trans, addr, arg); } } @@ -1912,7 +1913,7 @@ class ObTableLoadCoordinator::WriteTaskProcessor : public ObITableLoadTaskProces for (int64_t i = 0; OB_SUCC(ret) && (i < obj_rows.count()); ++i) { const ObTableLoadObjRow &src_obj_row = obj_rows.at(i); ObTableLoadObjRow out_obj_row; - // 对于客户端导入场景, 需要处理多列或者少列 + // For the client import scenario, need to handle multiple columns or fewer columns if (OB_UNLIKELY(src_obj_row.count_ != ctx_->param_.column_count_)) { ret = OB_ERR_COULUMN_VALUE_NOT_MATCH; LOG_WARN("column count doesn't match value count", KR(ret), K(src_obj_row), @@ -1979,7 +1980,7 @@ class ObTableLoadCoordinator::WriteTaskCallback : public ObITableLoadTaskCallbac private: ObTableLoadTableCtx * const ctx_; ObTableLoadCoordinatorTrans * const trans_; - ObTableLoadTransBucketWriter * const bucket_writer_; // 为了保证接收完本次写入结果之后再让bucket_writer的引用归零 + ObTableLoadTransBucketWriter * const bucket_writer_; // To ensure that the reference to bucket_writer is reset only after receiving the result of this write operation }; int ObTableLoadCoordinator::write(const ObTableLoadTransId &trans_id, int32_t session_id, @@ -2000,7 +2001,7 @@ int ObTableLoadCoordinator::write(const ObTableLoadTransId &trans_id, int32_t se LOG_WARN("fail to get trans", KR(ret)); } else if (session_id == 0 && FALSE_IT(session_id = trans->get_default_session_id())) { } - // 取出bucket_writer + // retrieve bucket_writer else if (OB_FAIL(trans->get_bucket_writer_for_write(bucket_writer))) { LOG_WARN("fail to get bucket writer", KR(ret)); // } else if (OB_FAIL(bucket_writer->advance_sequence_no(session_id, sequence_no, guard))) { @@ -2012,11 +2013,11 @@ int ObTableLoadCoordinator::write(const ObTableLoadTransId &trans_id, int32_t se } else { ObTableLoadTask *task = nullptr; WriteTaskProcessor *processor = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(ctx_->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor(ctx_, trans, bucket_writer, session_id))) { LOG_WARN("fail to set write task processor", KR(ret)); } else if (OB_ISNULL(processor = dynamic_cast(task->get_processor()))) { @@ -2025,11 +2026,11 @@ int ObTableLoadCoordinator::write(const ObTableLoadTransId &trans_id, int32_t se } else if (OB_FAIL(processor->set_objs(obj_rows, coordinator_ctx_->idx_array_))) { LOG_WARN("fail to set objs", KR(ret), K(coordinator_ctx_->idx_array_)); } - // 3. 设置callback + // 3. Set callback else if (OB_FAIL(task->set_callback(ctx_, trans, bucket_writer))) { LOG_WARN("fail to set write task callback", KR(ret)); } - // 4. 把task放入调度器 + // 4. Put task into scheduler else if (OB_FAIL(coordinator_ctx_->task_scheduler_->add_task(session_id - 1, task))) { LOG_WARN("fail to add task", KR(ret), K(session_id), KPC(task)); } @@ -2124,7 +2125,7 @@ class ObTableLoadCoordinator::FlushTaskCallback : public ObITableLoadTaskCallbac private: ObTableLoadTableCtx * const ctx_; ObTableLoadCoordinatorTrans * const trans_; - ObTableLoadTransBucketWriter * const bucket_writer_; // 为了保证接收完本次写入结果之后再让bucket_writer的引用归零 + ObTableLoadTransBucketWriter * const bucket_writer_; // To ensure that the reference to bucket_writer is reset only after receiving the result of this write operation }; int ObTableLoadCoordinator::flush(ObTableLoadCoordinatorTrans *trans) @@ -2136,7 +2137,7 @@ int ObTableLoadCoordinator::flush(ObTableLoadCoordinatorTrans *trans) } else { LOG_DEBUG("coordinator flush"); ObTableLoadTransBucketWriter *bucket_writer = nullptr; - // 取出bucket_writer + // retrieve bucket_writer if (OB_FAIL(trans->get_bucket_writer_for_flush(bucket_writer))) { LOG_WARN("fail to get bucket writer", KR(ret)); } else if (OB_FAIL(trans->set_trans_status_frozen())) { @@ -2144,20 +2145,20 @@ int ObTableLoadCoordinator::flush(ObTableLoadCoordinatorTrans *trans) } else { for (int32_t session_id = 1; OB_SUCC(ret) && session_id <= param_.write_session_count_; ++session_id) { ObTableLoadTask *task = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(ctx_->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor(ctx_, trans, bucket_writer, session_id))) { LOG_WARN("fail to set flush task processor", KR(ret)); } - // 3. 设置callback + // 3. Set callback else if (OB_FAIL(task->set_callback(ctx_, trans, bucket_writer))) { LOG_WARN("fail to set flush task callback", KR(ret)); } - // 4. 把task放入调度器 + // 4. put task into scheduler else if (OB_FAIL(coordinator_ctx_->task_scheduler_->add_task(session_id - 1, task))) { LOG_WARN("fail to add task", KR(ret), K(session_id), KPC(task)); } @@ -2190,14 +2191,14 @@ int ObTableLoadCoordinator::write_peer_leader(const ObTableLoadTransId &trans_id LOG_WARN("invalid args", KR(ret)); } else { LOG_DEBUG("coordinator write peer leader", K(addr)); - if (ObTableLoadUtils::is_local_addr(addr)) { // 本机 + if (ObTableLoadUtils::is_local_addr(addr)) { // local address ObTableLoadStore store(ctx_); if (OB_FAIL(store.init())) { LOG_WARN("fail to init store", KR(ret)); } else if (OB_FAIL(store.write(trans_id, session_id, sequence_no, tablet_obj_rows))) { LOG_WARN("fail to store write", KR(ret), K(trans_id)); } - } else { // 远端, 发送rpc + } else { // remote, send rpc common::ObArenaAllocator allocator("TLD_Coord"); allocator.set_tenant_id(MTL_ID()); int64_t pos = 0; diff --git a/src/observer/table_load/ob_table_load_coordinator.h b/src/observer/table_load/ob_table_load_coordinator.h index efca9dc33..7cf4a104e 100644 --- a/src/observer/table_load/ob_table_load_coordinator.h +++ b/src/observer/table_load/ob_table_load_coordinator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -41,7 +45,7 @@ class ObTableLoadCoordinator static const int64_t WAIT_INTERVAL_US = 1 * 1000 * 1000; // 1s static const int64_t DEFAULT_TIMEOUT_US = 10LL * 1000 * 1000; // 10s static const int64_t HEART_BEAT_RPC_TIMEOUT_US = 1LL * 1000 * 1000; // 1s - // 申请和释放资源失败等待间隔时间 + // Application and resource release failure wait interval time static const int64_t RESOURCE_OP_WAIT_INTERVAL_US = 5 * 1000LL * 1000LL; // 5s static const int64_t SSTABLE_BUFFER_SIZE = 68 * 1024LL;; // 64K + 4K static const int64_t MACROBLOCK_BUFFER_SIZE = 10 * 1024LL * 1024LL; // 10MB @@ -126,9 +130,9 @@ class ObTableLoadCoordinator private: int pre_start_trans_peers(ObTableLoadCoordinatorTrans *trans); int confirm_start_trans_peers(ObTableLoadCoordinatorTrans *trans); - // - OB_SUCCESS: 成功 - // - OB_EAGAIN: 重试 - // - else: 失败 + // - OB_SUCCESS: Success + // - OB_EAGAIN: retry + // - else: failure int pre_finish_trans_peers(ObTableLoadCoordinatorTrans *trans); int confirm_finish_trans_peers(ObTableLoadCoordinatorTrans *trans); int abandon_trans_peers(ObTableLoadCoordinatorTrans *trans); @@ -144,7 +148,7 @@ class ObTableLoadCoordinator const table::ObTableLoadObjRowArray &obj_rows); // for client int flush(ObTableLoadCoordinatorTrans *trans); - // 只写到主节点 + // Only write to the leader node int write_peer_leader(const table::ObTableLoadTransId &trans_id, int32_t session_id, uint64_t sequence_no, const table::ObTableLoadTabletObjRowArray &tablet_obj_rows, const common::ObAddr &addr); diff --git a/src/observer/table_load/ob_table_load_coordinator_ctx.cpp b/src/observer/table_load/ob_table_load_coordinator_ctx.cpp index 054c4ca90..9fbc39fac 100644 --- a/src/observer/table_load/ob_table_load_coordinator_ctx.cpp +++ b/src/observer/table_load/ob_table_load_coordinator_ctx.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -285,12 +289,12 @@ int ObTableLoadCoordinatorCtx::alloc_trans_ctx(const ObTableLoadTransId &trans_i { int ret = OB_SUCCESS; trans_ctx = nullptr; - // 分配trans_ctx + // allocate trans_ctx if (OB_ISNULL(trans_ctx = ctx_->alloc_trans_ctx(trans_id))) { ret = OB_ALLOCATE_MEMORY_FAILED; LOG_WARN("fail to alloc trans ctx", KR(ret), K(trans_id)); } - // 把trans_ctx插入map + // Insert trans_ctx into map else if (OB_FAIL(trans_ctx_map_.set_refactored(trans_ctx->trans_id_, trans_ctx))) { LOG_WARN("fail to set trans ctx", KR(ret), K(trans_ctx->trans_id_)); } @@ -313,11 +317,11 @@ int ObTableLoadCoordinatorCtx::alloc_trans(const ObTableLoadSegmentID &segment_i (ATOMIC_FAA(&next_session_id_, 1) % ctx_->param_.write_session_count_) + 1; ObTableLoadTransId trans_id(segment_id, trans_gid); ObTableLoadTransCtx *trans_ctx = nullptr; - // 分配trans_ctx + // allocate trans_ctx if (OB_FAIL(alloc_trans_ctx(trans_id, trans_ctx))) { LOG_WARN("fail to alloc trans ctx", KR(ret), K(trans_id)); } - // 构造trans + // construct trans else if (OB_ISNULL(trans = trans_allocator_.alloc(trans_ctx, default_session_id))) { ret = OB_ALLOCATE_MEMORY_FAILED; LOG_WARN("fail to alloc ObTableLoadCoordinatorTrans", KR(ret)); @@ -344,7 +348,7 @@ int ObTableLoadCoordinatorCtx::init_column_idxs(const ObIArray &column const ObColDesc &col_desc = column_descs.at(i); bool found_column = (ctx_->schema_.is_table_with_hidden_pk_column_ && i == 0); // skip hidden pk in heap table // todo@lanyi find the pk column using column id - // 在源数据的列数组中找到对应的列 + // Find the corresponding column in the source data's column array for (int64_t j = 0; OB_SUCC(ret) && OB_LIKELY(!found_column) && j < column_ids.count(); ++j) { const uint64_t column_id = column_ids.at(j); if (col_desc.col_id_ == column_id) { @@ -381,7 +385,7 @@ int ObTableLoadCoordinatorCtx::generate_autoinc_params(AutoincParam &autoinc_par ret = OB_TABLE_NOT_EXIST; LOG_WARN("table not exist", KR(ret), K(ctx_->param_.tenant_id_), K(ctx_->param_.table_id_)); } else { - //ddl对于auto increment是最后进行自增值同步,对于autoinc_param参数初始化得使用原表table id的table schema + //ddl for auto increment synchronizes the auto-increment value last, and the initialization of the autoinc_param parameter should use the table schema of the original table's table id ObColumnSchemaV2 *autoinc_column_schema = nullptr; uint64_t column_id = 0; for (ObTableSchema::const_column_iterator iter = table_schema->column_begin(); @@ -443,7 +447,7 @@ int ObTableLoadCoordinatorCtx::init_sequence() target_table_schema))) { LOG_WARN("fail to get table schema", KR(ret), K(tenant_id), K(table_id)); } else { - //ddl对于identity是建表的时候进行自增值同步,对于sequence参数初始化得用隐藏表table id的table schema + //ddl for identity is to synchronize the auto-increment value when creating a table, for sequence parameter initialization must use the hidden table id's table schema for (ObTableSchema::const_column_iterator iter = target_table_schema->column_begin(); OB_SUCC(ret) && iter != target_table_schema->column_end(); ++iter) { ObColumnSchemaV2 *column_schema = *iter; diff --git a/src/observer/table_load/ob_table_load_coordinator_ctx.h b/src/observer/table_load/ob_table_load_coordinator_ctx.h index 9f5f16c8f..abe915abb 100644 --- a/src/observer/table_load/ob_table_load_coordinator_ctx.h +++ b/src/observer/table_load/ob_table_load_coordinator_ctx.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -189,7 +193,7 @@ class ObTableLoadCoordinatorCtx TransCtxMap; typedef common::ObLinkHashMap SegmentCtxMap; private: - ObTableLoadObjectAllocator trans_allocator_; // 多线程安全 + ObTableLoadObjectAllocator trans_allocator_; // thread-safe uint64_t last_trans_gid_ CACHE_ALIGNED; uint64_t next_session_id_ CACHE_ALIGNED; lib::ObMutex op_lock_; diff --git a/src/observer/table_load/ob_table_load_coordinator_trans.cpp b/src/observer/table_load/ob_table_load_coordinator_trans.cpp index 90b5b827d..1b338ca64 100644 --- a/src/observer/table_load/ob_table_load_coordinator_trans.cpp +++ b/src/observer/table_load/ob_table_load_coordinator_trans.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_coordinator_trans.h b/src/observer/table_load/ob_table_load_coordinator_trans.h index d3b780454..8f9436baa 100644 --- a/src/observer/table_load/ob_table_load_coordinator_trans.h +++ b/src/observer/table_load/ob_table_load_coordinator_trans.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_data_row_ack_handler.h b/src/observer/table_load/ob_table_load_data_row_ack_handler.h index 974ca40e5..2dab0c73f 100644 --- a/src/observer/table_load/ob_table_load_data_row_ack_handler.h +++ b/src/observer/table_load/ob_table_load_data_row_ack_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_data_row_delete_handler.cpp b/src/observer/table_load/ob_table_load_data_row_delete_handler.cpp index 37cf6c1a5..abb92aef9 100644 --- a/src/observer/table_load/ob_table_load_data_row_delete_handler.cpp +++ b/src/observer/table_load/ob_table_load_data_row_delete_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -87,4 +91,4 @@ int ObTableLoadDataRowDeleteHandler::handle_delete_row(const ObTabletID &tablet_ } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/ob_table_load_data_row_delete_handler.h b/src/observer/table_load/ob_table_load_data_row_delete_handler.h index 2cca884b1..7355fb2ba 100644 --- a/src/observer/table_load/ob_table_load_data_row_delete_handler.h +++ b/src/observer/table_load/ob_table_load_data_row_delete_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_data_row_insert_handler.cpp b/src/observer/table_load/ob_table_load_data_row_insert_handler.cpp index fb4cc96d6..d5b05aee6 100644 --- a/src/observer/table_load/ob_table_load_data_row_insert_handler.cpp +++ b/src/observer/table_load/ob_table_load_data_row_insert_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -65,7 +69,7 @@ int ObTableLoadDataRowInsertHandler::handle_insert_row(const ObTabletID &tablet_ LOG_WARN("ObTableLoadDataRowInsertHandler not init", KR(ret), KP(this)); } else { if (ObDirectLoadMethod::is_incremental(store_ctx_->ctx_->param_.method_)) { - // 构造索引数据 + // Construct index data for (int64_t i = 0; OB_SUCC(ret) && i < store_ctx_->index_store_table_ctxs_.count(); ++i) { ObTableLoadStoreIndexTableCtx *index_table_ctx = store_ctx_->index_store_table_ctxs_.at(i); ObTableLoadIndexTableBuilder *index_builder = nullptr; @@ -90,7 +94,7 @@ int ObTableLoadDataRowInsertHandler::handle_insert_row(const ObTabletID &tablet_ LOG_WARN("ObTableLoadDataRowInsertHandler not init", KR(ret), KP(this)); } else { if (ObDirectLoadMethod::is_incremental(store_ctx_->ctx_->param_.method_)) { - // 构造索引数据 + // Construct index data for (int64_t i = 0; OB_SUCC(ret) && i < store_ctx_->index_store_table_ctxs_.count(); ++i) { ObTableLoadStoreIndexTableCtx *index_table_ctx = store_ctx_->index_store_table_ctxs_.at(i); ObTableLoadIndexTableBuilder *index_builder = nullptr; @@ -117,7 +121,7 @@ int ObTableLoadDataRowInsertHandler::handle_insert_batch(const ObTabletID &table // do nothing } else { if (ObDirectLoadMethod::is_incremental(store_ctx_->ctx_->param_.method_)) { - // 构造索引数据 + // Construct index data for (int64_t i = 0; OB_SUCC(ret) && i < store_ctx_->index_store_table_ctxs_.count(); ++i) { ObTableLoadStoreIndexTableCtx *index_table_ctx = store_ctx_->index_store_table_ctxs_.at(i); ObTableLoadIndexTableBuilder *index_builder = nullptr; @@ -279,9 +283,9 @@ int ObTableLoadDataRowInsertHandler::handle_update_row(const ObTabletID &tablet_ LOG_WARN("unexpected dup action", KR(ret), K_(dup_action)); } if (OB_SUCC(ret) && result_row == &new_row) { - // 发生replace + // replace occurs if (ObDirectLoadMethod::is_incremental(store_ctx_->ctx_->param_.method_)) { - // 删除旧行的lob + // Delete the lob of the old row if (nullptr != store_ctx_->data_store_table_ctx_->lob_table_ctx_) { ObTableLoadStoreLobTableCtx *lob_table_ctx = store_ctx_->data_store_table_ctx_->lob_table_ctx_; @@ -292,7 +296,7 @@ int ObTableLoadDataRowInsertHandler::handle_update_row(const ObTabletID &tablet_ LOG_WARN("fail to append delete row", KR(ret), K(tablet_id), K(old_row)); } } - // 删除旧行的索引, 插入新行的索引 + // Delete the index of the old row, insert the index of the new row for (int64_t i = 0; OB_SUCC(ret) && i < store_ctx_->index_store_table_ctxs_.count(); ++i) { ObTableLoadStoreIndexTableCtx *index_table_ctx = store_ctx_->index_store_table_ctxs_.at(i); diff --git a/src/observer/table_load/ob_table_load_data_row_insert_handler.h b/src/observer/table_load/ob_table_load_data_row_insert_handler.h index 9f45dfe5d..3d14b71ed 100644 --- a/src/observer/table_load/ob_table_load_data_row_insert_handler.h +++ b/src/observer/table_load/ob_table_load_data_row_insert_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -91,4 +95,4 @@ class ObTableLoadDataRowInsertHandler : public storage::ObDirectLoadDMLRowHandle }; } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/ob_table_load_data_table_builder.cpp b/src/observer/table_load/ob_table_load_data_table_builder.cpp index 932f756b8..436876a60 100644 --- a/src/observer/table_load/ob_table_load_data_table_builder.cpp +++ b/src/observer/table_load/ob_table_load_data_table_builder.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -190,4 +194,4 @@ int ObTableLoadDataTableBuilder::get_tables(ObDirectLoadTableHandleArray &table_ } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/ob_table_load_data_table_builder.h b/src/observer/table_load/ob_table_load_data_table_builder.h index 58cd2c78f..0bc0a10a1 100644 --- a/src/observer/table_load/ob_table_load_data_table_builder.h +++ b/src/observer/table_load/ob_table_load_data_table_builder.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -67,4 +71,4 @@ class ObTableLoadDataTableBuilder }; } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/ob_table_load_empty_insert_tablet_ctx_manager.cpp b/src/observer/table_load/ob_table_load_empty_insert_tablet_ctx_manager.cpp index 827535acf..f45927207 100644 --- a/src/observer/table_load/ob_table_load_empty_insert_tablet_ctx_manager.cpp +++ b/src/observer/table_load/ob_table_load_empty_insert_tablet_ctx_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_empty_insert_tablet_ctx_manager.h b/src/observer/table_load/ob_table_load_empty_insert_tablet_ctx_manager.h index fbaaccab4..5f245a7a5 100644 --- a/src/observer/table_load/ob_table_load_empty_insert_tablet_ctx_manager.h +++ b/src/observer/table_load/ob_table_load_empty_insert_tablet_ctx_manager.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_LOAD_EMPTY_INSERT_TABLET_CTX_MANAGER_H_ @@ -63,4 +67,4 @@ class ObTableLoadEmptyInsertTabletCtxManager } // namespace observer } // namespace oceanbase -#endif // _OB_TABLE_LOAD_EMPTY_INSERT_TABLET_CTX_MANAGER_H_ \ No newline at end of file +#endif // _OB_TABLE_LOAD_EMPTY_INSERT_TABLET_CTX_MANAGER_H_ diff --git a/src/observer/table_load/ob_table_load_error_row_handler.cpp b/src/observer/table_load/ob_table_load_error_row_handler.cpp index 709551051..a4a6220db 100644 --- a/src/observer/table_load/ob_table_load_error_row_handler.cpp +++ b/src/observer/table_load/ob_table_load_error_row_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_error_row_handler.h b/src/observer/table_load/ob_table_load_error_row_handler.h index 9e9c8e9c7..6f17b407d 100644 --- a/src/observer/table_load/ob_table_load_error_row_handler.h +++ b/src/observer/table_load/ob_table_load_error_row_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_exec_ctx.cpp b/src/observer/table_load/ob_table_load_exec_ctx.cpp index 33a7c09f8..7f05f583c 100644 --- a/src/observer/table_load/ob_table_load_exec_ctx.cpp +++ b/src/observer/table_load/ob_table_load_exec_ctx.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -103,4 +107,4 @@ void ObTableLoadClientExecCtx::heart_beat() } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/ob_table_load_exec_ctx.h b/src/observer/table_load/ob_table_load_exec_ctx.h index bfb94e8a7..80bcf646a 100644 --- a/src/observer/table_load/ob_table_load_exec_ctx.h +++ b/src/observer/table_load/ob_table_load_exec_ctx.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_index_long_wait.h b/src/observer/table_load/ob_table_load_index_long_wait.h index 6f9e33ab1..e54edbb73 100644 --- a/src/observer/table_load/ob_table_load_index_long_wait.h +++ b/src/observer/table_load/ob_table_load_index_long_wait.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_TABLE_LOAD_INDEX_LONG_WAIT_H_ diff --git a/src/observer/table_load/ob_table_load_index_row_handler.h b/src/observer/table_load/ob_table_load_index_row_handler.h index d7b11a724..9b832ca6b 100644 --- a/src/observer/table_load/ob_table_load_index_row_handler.h +++ b/src/observer/table_load/ob_table_load_index_row_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_index_table_builder.cpp b/src/observer/table_load/ob_table_load_index_table_builder.cpp index bb47eb52f..a2931e199 100644 --- a/src/observer/table_load/ob_table_load_index_table_builder.cpp +++ b/src/observer/table_load/ob_table_load_index_table_builder.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -113,7 +117,7 @@ int ObTableLoadIndexTableBuilder::append_insert_row(const ObTabletID &tablet_id, ret = OB_NOT_INIT; LOG_WARN("ObTableLoadIndexTableBuilder not init", KR(ret), KP(this)); } else { - insert_row_.seq_no_ = 0; // seq_no丢失 + insert_row_.seq_no_ = 0; // seq_no lost ObTabletID index_tablet_id; if (OB_FAIL(project_->projector(tablet_id, datum_row, index_tablet_id, insert_row_))) { LOG_WARN("fail to projector", KR(ret), K(tablet_id), K(datum_row)); @@ -132,7 +136,7 @@ int ObTableLoadIndexTableBuilder::append_insert_batch(const ObTabletID &tablet_i ret = OB_NOT_INIT; LOG_WARN("ObTableLoadIndexTableBuilder not init", KR(ret), KP(this)); } else { - insert_row_.seq_no_ = 0; // seq_no丢失 + insert_row_.seq_no_ = 0; // seq_no lost ObTabletID index_tablet_id; if (OB_FAIL(project_->get_dest_tablet_id(tablet_id, index_tablet_id))) { LOG_WARN("fail to get index tablet id", KR(ret)); diff --git a/src/observer/table_load/ob_table_load_index_table_builder.h b/src/observer/table_load/ob_table_load_index_table_builder.h index c72e98938..f000f0ddc 100644 --- a/src/observer/table_load/ob_table_load_index_table_builder.h +++ b/src/observer/table_load/ob_table_load_index_table_builder.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_instance.cpp b/src/observer/table_load/ob_table_load_instance.cpp index 86bd08ee9..4c2f74abb 100644 --- a/src/observer/table_load/ob_table_load_instance.cpp +++ b/src/observer/table_load/ob_table_load_instance.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -595,7 +599,7 @@ int ObTableLoadInstance::start_direct_load(const ObTableLoadParam ¶m, table_ctx_ = table_ctx; } if (OB_FAIL(ret)) { - // table_ctx没有初始化成功不能赋值给table_ctx_ + // table_ctx was not initialized successfully and cannot be assigned to table_ctx_ if (nullptr != table_ctx) { ObTableLoadService::put_ctx(table_ctx); table_ctx = nullptr; @@ -861,7 +865,7 @@ int ObTableLoadInstance::write_trans(TransCtx &trans_ctx, int32_t session_id, ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid args", KR(ret), K(session_id), K(obj_rows.count())); } else { - // TODO(suzhi.yt): java客户端调用的时候, 对于相同session_id可能会并发 + // TODO(suzhi.yt): java client call when, for the same session_id may be concurrent uint64_t &next_sequence_no = trans_ctx.next_sequence_no_array_[session_id - 1]; ObTableLoadCoordinator coordinator(table_ctx_); if (OB_FAIL(coordinator.init())) { diff --git a/src/observer/table_load/ob_table_load_instance.h b/src/observer/table_load/ob_table_load_instance.h index cf9fa2df9..2666f6256 100644 --- a/src/observer/table_load/ob_table_load_instance.h +++ b/src/observer/table_load/ob_table_load_instance.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -37,7 +41,7 @@ class ObTableLoadInstance ObTableLoadInstance(); ~ObTableLoadInstance(); void destroy(); - // column_ids不包含堆表的hidden pk + // column_ids does not include the hidden pk of the heap table int init(ObTableLoadParam ¶m, const common::ObIArray &column_ids, const common::ObIArray &tablet_ids, diff --git a/src/observer/table_load/ob_table_load_lob_row_delete_handler.h b/src/observer/table_load/ob_table_load_lob_row_delete_handler.h index c51ff914c..88b186e88 100644 --- a/src/observer/table_load/ob_table_load_lob_row_delete_handler.h +++ b/src/observer/table_load/ob_table_load_lob_row_delete_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_lob_table_builder.cpp b/src/observer/table_load/ob_table_load_lob_table_builder.cpp index 8a1cc13e8..6c202ba7d 100644 --- a/src/observer/table_load/ob_table_load_lob_table_builder.cpp +++ b/src/observer/table_load/ob_table_load_lob_table_builder.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_lob_table_builder.h b/src/observer/table_load/ob_table_load_lob_table_builder.h index fb8c5ebf6..4f408e363 100644 --- a/src/observer/table_load/ob_table_load_lob_table_builder.h +++ b/src/observer/table_load/ob_table_load_lob_table_builder.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_manager.cpp b/src/observer/table_load/ob_table_load_manager.cpp index 24e6609de..defe20f0d 100644 --- a/src/observer/table_load/ob_table_load_manager.cpp +++ b/src/observer/table_load/ob_table_load_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_manager.h b/src/observer/table_load/ob_table_load_manager.h index fe01a58bd..4e022538e 100644 --- a/src/observer/table_load/ob_table_load_manager.h +++ b/src/observer/table_load/ob_table_load_manager.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -290,14 +294,12 @@ class ObTableLoadManager ObjAllocator table_ctx_alloc_; ObjAllocator client_task_alloc_; ObjAllocator client_task_brief_alloc_; - - // map会持有对象的引用计数 + // map will hold a reference count of the object ObTableLoadTableCtxMap table_ctx_map_; ObTableLoadClientTaskMap client_task_map_; ObTableLoadClientTaskBriefMap client_task_brief_map_; - - // 对象的引用计数归0后, 放入gc队列 - // client_task_brief的引用计数归0后直接释放 + // After the reference count of the object is reduced to 0, it is placed in the gc queue + // client_task_brief's reference count drops to 0 and is released directly mutable common::ObSpinLock gc_list_lock_; ObArray table_ctx_gc_list_; ObArray client_task_gc_list_; diff --git a/src/observer/table_load/ob_table_load_mem_chunk_manager.cpp b/src/observer/table_load/ob_table_load_mem_chunk_manager.cpp index e9bb44dc4..3b87d8db2 100644 --- a/src/observer/table_load/ob_table_load_mem_chunk_manager.cpp +++ b/src/observer/table_load/ob_table_load_mem_chunk_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -75,7 +79,7 @@ int ObTableLoadMemChunkManager::get_chunk(int64_t &chunk_node_id, ChunkType *&ch LOG_WARN("pre sort has error, task canceled", KR(ret)); } else if (!chunk_node.is_used() && chunk_node.set_used()) { if (nullptr == chunk_node.chunk_) { - // 等待内存空出 + // wait for memory to be available if (OB_FAIL(mem_ctx_->acquire_chunk(chunk_node.chunk_))) { LOG_WARN("fail to acquire chunk", KR(ret)); } else { diff --git a/src/observer/table_load/ob_table_load_mem_chunk_manager.h b/src/observer/table_load/ob_table_load_mem_chunk_manager.h index be7061e30..c2cc54c09 100644 --- a/src/observer/table_load/ob_table_load_mem_chunk_manager.h +++ b/src/observer/table_load/ob_table_load_mem_chunk_manager.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_mem_compactor.cpp b/src/observer/table_load/ob_table_load_mem_compactor.cpp index 24dce3ea9..3b9e1fb41 100644 --- a/src/observer/table_load/ob_table_load_mem_compactor.cpp +++ b/src/observer/table_load/ob_table_load_mem_compactor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -222,7 +226,7 @@ ObTableLoadMemCompactor::~ObTableLoadMemCompactor() { reset(); } void ObTableLoadMemCompactor::reset() { is_inited_ = false; - // 先把sample线程停了 + // First stop the sample thread mem_ctx_.has_error_ = true; if (nullptr != task_scheduler_) { task_scheduler_->stop(); @@ -236,7 +240,7 @@ void ObTableLoadMemCompactor::reset() op_ = nullptr; mem_ctx_.reset(); finish_thread_cnt_ = 0; - // 分配器最后reset + // dispatcher final reset allocator_.reset(); } @@ -255,7 +259,7 @@ int ObTableLoadMemCompactor::init(ObTableLoadMergeMemSortOp *op) op_ = op; if (OB_UNLIKELY(store_ctx_->thread_cnt_ < 2)) { - // 排序至少需要两个线程 + // Sorting requires at least two threads ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid args", KR(ret), K(store_ctx_->thread_cnt_)); } else { @@ -274,7 +278,7 @@ int ObTableLoadMemCompactor::init(ObTableLoadMergeMemSortOp *op) mem_ctx_.total_thread_cnt_ = store_ctx_->thread_cnt_; mem_ctx_.dump_thread_cnt_ = - MAX(mem_ctx_.total_thread_cnt_ / 3, 1); //暂时先写成1/3,后续再优化 + MAX(mem_ctx_.total_thread_cnt_ / 3, 1); // temporarily write as 1/3, optimize later mem_ctx_.load_thread_cnt_ = mem_ctx_.total_thread_cnt_ - mem_ctx_.dump_thread_cnt_; } @@ -300,7 +304,7 @@ int ObTableLoadMemCompactor::init(ObTableLoadMergeMemSortOp *op) int ObTableLoadMemCompactor::init_scheduler() { int ret = OB_SUCCESS; - // 初始化task_scheduler_ + // Initialize task_scheduler_ if (OB_ISNULL(task_scheduler_ = OB_NEWx(ObTableLoadTaskThreadPoolScheduler, (&allocator_), 1 /*thread_count*/, store_ctx_->ctx_->param_.table_id_, "MemSample", store_ctx_->ctx_->session_info_))) { @@ -338,7 +342,7 @@ int ObTableLoadMemCompactor::construct_compactors() ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected not external table", KR(ret), KPC(table_store)); } else { - // 根据table_store构造任务 + // Construct task according to table_store FOREACH_X(it, *table_store, OB_SUCC(ret)) { ObDirectLoadTableHandleArray *table_handle_array = it->second; @@ -349,7 +353,7 @@ int ObTableLoadMemCompactor::construct_compactors() } } if (OB_SUCC(ret)) { - // 清空table_store, 以便在排序过程中能释放磁盘空间 + // Clear table_store to release disk space during sorting process table_store->clear(); } } @@ -390,19 +394,19 @@ int ObTableLoadMemCompactor::start_load() ObTableLoadTableCtx *ctx = store_ctx_->ctx_; for (int64_t i = 0; OB_SUCC(ret) && i < mem_ctx_.load_thread_cnt_; ++i) { ObTableLoadTask *task = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(ctx->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor(ctx, &mem_ctx_))) { LOG_WARN("fail to set load task processor", KR(ret)); } - // 3. 设置callback + // 3. Set callback else if (OB_FAIL(task->set_callback(ctx, this))) { LOG_WARN("fail to set compact task callback", KR(ret)); } - // 4. 把task放入调度器 + // 4. put task into scheduler else if (OB_FAIL(store_ctx_->task_scheduler_->add_task(i, task))) { LOG_WARN("fail to add task", KR(ret), KPC(task)); } @@ -422,19 +426,19 @@ int ObTableLoadMemCompactor::start_dump() const int64_t dump_thread_start_idx = mem_ctx_.load_thread_cnt_; for (int64_t i = 0; OB_SUCC(ret) && i < mem_ctx_.dump_thread_cnt_; ++i) { ObTableLoadTask *task = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(ctx->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor(ctx, &mem_ctx_))) { LOG_WARN("fail to set dump task processor", KR(ret)); } - // 3. 设置callback + // 3. Set callback else if (OB_FAIL(task->set_callback(ctx, this))) { LOG_WARN("fail to set compactor task callback", KR(ret)); } - // 4. 把task放入调度器 + // 4. put task into scheduler else if (OB_FAIL(store_ctx_->task_scheduler_->add_task(dump_thread_start_idx + i, task))) { LOG_WARN("fail to add task", KR(ret), KPC(task)); } @@ -452,19 +456,19 @@ int ObTableLoadMemCompactor::start_sample() int ret = OB_SUCCESS; ObTableLoadTableCtx *ctx = store_ctx_->ctx_; ObTableLoadTask *task = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(ctx->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor(ctx, &mem_ctx_))) { LOG_WARN("fail to set sample task processor", KR(ret)); } - // 3. 设置callback + // 3. Set callback else if (OB_FAIL(task->set_callback(ctx, this))) { LOG_WARN("fail to set compactor task callback", KR(ret)); } - // 4. 把task放入调度器 + // 4. Put task into scheduler else if (OB_FAIL(task_scheduler_->add_task(0, task))) { LOG_WARN("fail to add task", KR(ret), KPC(task)); } @@ -481,19 +485,19 @@ int ObTableLoadMemCompactor::start_finish() int ret = OB_SUCCESS; ObTableLoadTableCtx *ctx = store_ctx_->ctx_; ObTableLoadTask *task = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(ctx->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor(ctx, this))) { LOG_WARN("fail to set finish task processor", KR(ret)); } - // 3. 设置callback + // 3. Set callback else if (OB_FAIL(task->set_callback(ctx))) { LOG_WARN("fail to set finish task callback", KR(ret)); } - // 4. 把task放入调度器 + // 4. Put task into scheduler else if (OB_FAIL(store_ctx_->task_scheduler_->add_task(0, task))) { LOG_WARN("fail to add task", KR(ret), KPC(task)); } @@ -523,7 +527,7 @@ int ObTableLoadMemCompactor::start_compact() void ObTableLoadMemCompactor::stop() { - set_has_error(); //先设置为error,因为stop的场景就是error + set_has_error(); //Set to error first, because the stop scenario is an error if (nullptr != task_scheduler_) { task_scheduler_->stop(); } diff --git a/src/observer/table_load/ob_table_load_mem_compactor.h b/src/observer/table_load/ob_table_load_mem_compactor.h index 47104eea6..9400fc885 100644 --- a/src/observer/table_load/ob_table_load_mem_compactor.h +++ b/src/observer/table_load/ob_table_load_mem_compactor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -61,7 +65,7 @@ class ObTableLoadMemCompactor ObTableLoadStoreCtx *store_ctx_; ObTableLoadStoreTableCtx *store_table_ctx_; ObTableLoadMergeMemSortOp *op_; - common::ObArenaAllocator allocator_; //需要最后析构 + common::ObArenaAllocator allocator_; // needs to be destructed last ObDirectLoadMemContext mem_ctx_; ObITableLoadTaskScheduler *task_scheduler_; int64_t finish_thread_cnt_ CACHE_ALIGNED; diff --git a/src/observer/table_load/ob_table_load_merge_compact_table_op.cpp b/src/observer/table_load/ob_table_load_merge_compact_table_op.cpp index 04ef82780..93325d703 100644 --- a/src/observer/table_load/ob_table_load_merge_compact_table_op.cpp +++ b/src/observer/table_load/ob_table_load_merge_compact_table_op.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_merge_compact_table_op.h b/src/observer/table_load/ob_table_load_merge_compact_table_op.h index 628009464..b95f4910e 100644 --- a/src/observer/table_load/ob_table_load_merge_compact_table_op.h +++ b/src/observer/table_load/ob_table_load_merge_compact_table_op.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_merge_data_op.cpp b/src/observer/table_load/ob_table_load_merge_data_op.cpp index 79614c6c6..c2848ef93 100644 --- a/src/observer/table_load/ob_table_load_merge_data_op.cpp +++ b/src/observer/table_load/ob_table_load_merge_data_op.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_merge_data_op.h b/src/observer/table_load/ob_table_load_merge_data_op.h index c90237274..5c60ea918 100644 --- a/src/observer/table_load/ob_table_load_merge_data_op.h +++ b/src/observer/table_load/ob_table_load_merge_data_op.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_merge_data_table_op.cpp b/src/observer/table_load/ob_table_load_merge_data_table_op.cpp index 7f5087ffe..85b6aadc1 100644 --- a/src/observer/table_load/ob_table_load_merge_data_table_op.cpp +++ b/src/observer/table_load/ob_table_load_merge_data_table_op.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -83,7 +87,7 @@ int ObTableLoadMergeDataTableOp::inner_init() // merge_mode_ if (OB_SUCC(ret)) { switch (ctx_->param_.method_) { - // 全量 + // full amount case ObDirectLoadMethod::FULL: switch (ctx_->param_.insert_mode_) { case ObDirectLoadInsertMode::NORMAL: @@ -99,7 +103,7 @@ int ObTableLoadMergeDataTableOp::inner_init() break; } break; - // 增量 + // Incremental case ObDirectLoadMethod::INCREMENTAL: if (store_table_ctx->schema_->is_table_without_pk_) { inner_ctx_.merge_mode_ = ObDirectLoadMergeMode::NORMAL; @@ -109,7 +113,7 @@ int ObTableLoadMergeDataTableOp::inner_init() inner_ctx_.merge_mode_ = ObDirectLoadMergeMode::MERGE_WITH_CONFLICT_CHECK; break; case ObDirectLoadInsertMode::INC_REPLACE: - // 有lob或索引的时候还是需要进行冲突检测 + // Conflict detection is still required when there are lobs or indexes if (!store_table_ctx->schema_->lob_column_idxs_.empty() || !store_table_ctx->schema_->index_table_ids_.empty()) { inner_ctx_.merge_mode_ = ObDirectLoadMergeMode::MERGE_WITH_CONFLICT_CHECK; @@ -155,7 +159,7 @@ int ObTableLoadMergeDataTableOp::inner_close() LOG_WARN("fail to close build index table", KR(ret)); } } - // 关闭insert_table_ctx + // close insert_table_ctx if (OB_SUCC(ret)) { if (OB_FAIL(merge_table_ctx_->insert_table_ctx_->collect_sql_stats(store_ctx_->dml_stats_, store_ctx_->sql_stats_))) { @@ -248,7 +252,7 @@ int ObTableLoadMergeDeletePhaseDataTableOp::inner_close() LOG_WARN("fail to close build index table", KR(ret)); } } - // 关闭insert_table_ctx + // close insert_table_ctx if (OB_SUCC(ret)) { if (OB_FAIL(store_ctx_->data_store_table_ctx_->close_insert_table_ctx())) { LOG_WARN("fail to close insert table ctx", KR(ret)); @@ -312,7 +316,7 @@ int ObTableLoadMergeAckPhaseDataTableOp::inner_close() { int ret = OB_SUCCESS; FLOG_INFO("ObTableLoadMergeAckPhaseDataTableOp FINISH"); - // 关闭insert_table_ctx + // close insert_table_ctx if (OB_FAIL(store_ctx_->data_store_table_ctx_->close_insert_table_ctx())) { LOG_WARN("fail to close insert table ctx", KR(ret)); } @@ -322,4 +326,4 @@ int ObTableLoadMergeAckPhaseDataTableOp::inner_close() } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/ob_table_load_merge_data_table_op.h b/src/observer/table_load/ob_table_load_merge_data_table_op.h index 0157c9d19..14d9c5121 100644 --- a/src/observer/table_load/ob_table_load_merge_data_table_op.h +++ b/src/observer/table_load/ob_table_load_merge_data_table_op.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -52,4 +56,4 @@ class ObTableLoadMergeAckPhaseDataTableOp final : public ObTableLoadMergeTableOp }; } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/ob_table_load_merge_del_lob_op.cpp b/src/observer/table_load/ob_table_load_merge_del_lob_op.cpp index bf7eef82a..e82bbf5ca 100644 --- a/src/observer/table_load/ob_table_load_merge_del_lob_op.cpp +++ b/src/observer/table_load/ob_table_load_merge_del_lob_op.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -34,7 +38,7 @@ int ObTableLoadMergeDelLobOp::inner_init() { int ret = OB_SUCCESS; ObTableLoadStoreLobTableCtx *store_table_ctx = store_ctx_->data_store_table_ctx_->lob_table_ctx_; - // 重设merge_table_ctx_ + // Reset merge_table_ctx_ inner_ctx_.store_table_ctx_ = store_table_ctx; inner_ctx_.insert_table_ctx_ = store_table_ctx->insert_table_ctx_; if (ObTableLoadMergerPhaseType::INSERT == merge_phase_ctx_->phase_ || diff --git a/src/observer/table_load/ob_table_load_merge_del_lob_op.h b/src/observer/table_load/ob_table_load_merge_del_lob_op.h index 1deee27e1..432467469 100644 --- a/src/observer/table_load/ob_table_load_merge_del_lob_op.h +++ b/src/observer/table_load/ob_table_load_merge_del_lob_op.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_merge_insert_sstable_op.cpp b/src/observer/table_load/ob_table_load_merge_insert_sstable_op.cpp index 0ed341f9f..b3d8216cf 100644 --- a/src/observer/table_load/ob_table_load_merge_insert_sstable_op.cpp +++ b/src/observer/table_load/ob_table_load_merge_insert_sstable_op.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_merge_insert_sstable_op.h b/src/observer/table_load/ob_table_load_merge_insert_sstable_op.h index 6b26a9071..ca0287bed 100644 --- a/src/observer/table_load/ob_table_load_merge_insert_sstable_op.h +++ b/src/observer/table_load/ob_table_load_merge_insert_sstable_op.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_merge_mem_sort_op.cpp b/src/observer/table_load/ob_table_load_merge_mem_sort_op.cpp index 6ce0a632e..79d01640e 100644 --- a/src/observer/table_load/ob_table_load_merge_mem_sort_op.cpp +++ b/src/observer/table_load/ob_table_load_merge_mem_sort_op.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -69,7 +73,7 @@ int ObTableLoadMergeMemSortOp::switch_next_op(bool is_parent_called) ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected table store", KR(ret), KPC(merge_table_ctx_->table_store_)); } else if (merge_table_ctx_->table_store_->get_table_data_desc() - .row_flag_.uncontain_hidden_pk_) { // 不带主键 + .row_flag_.uncontain_hidden_pk_) { // without primary key if (OB_ISNULL(multiple_heap_table_compactor_ = OB_NEWx(ObTableLoadMultipleHeapTableCompactor, allocator_))) { ret = OB_ALLOCATE_MEMORY_FAILED; diff --git a/src/observer/table_load/ob_table_load_merge_mem_sort_op.h b/src/observer/table_load/ob_table_load_merge_mem_sort_op.h index 3e9b7ae28..0f7e8736b 100644 --- a/src/observer/table_load/ob_table_load_merge_mem_sort_op.h +++ b/src/observer/table_load/ob_table_load_merge_mem_sort_op.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_merge_op.cpp b/src/observer/table_load/ob_table_load_merge_op.cpp index f79b6c804..1a5e6a284 100644 --- a/src/observer/table_load/ob_table_load_merge_op.cpp +++ b/src/observer/table_load/ob_table_load_merge_op.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_merge_op.h b/src/observer/table_load/ob_table_load_merge_op.h index 52accc4d0..7b06ffba5 100644 --- a/src/observer/table_load/ob_table_load_merge_op.h +++ b/src/observer/table_load/ob_table_load_merge_op.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -66,9 +70,8 @@ struct ObTableLoadMergeOpType #define OB_TABLE_LOAD_MERGE_OP_DEF(DEF) \ DEF(ObTableLoadMergeOpType::ROOT, ObTableLoadMergeRootOp) \ OB_TABLE_LOAD_MERGE_CHILD_OP_DEF(DEF) - -// switch_next_op只能在op内部调用 -// 所有op的生命周期由root_op保证 +// switch_next_op can only be called within op +// The lifecycle of all ops is guaranteed by root_op class ObTableLoadMergeOp { diff --git a/src/observer/table_load/ob_table_load_merge_phase_op.cpp b/src/observer/table_load/ob_table_load_merge_phase_op.cpp index 00f79b559..b72df6775 100644 --- a/src/observer/table_load/ob_table_load_merge_phase_op.cpp +++ b/src/observer/table_load/ob_table_load_merge_phase_op.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -303,4 +307,4 @@ int ObTableLoadMergeAckPhaseOp::switch_next_op(bool is_parent_called) } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/ob_table_load_merge_phase_op.h b/src/observer/table_load/ob_table_load_merge_phase_op.h index 437dcf05c..d1679f8e7 100644 --- a/src/observer/table_load/ob_table_load_merge_phase_op.h +++ b/src/observer/table_load/ob_table_load_merge_phase_op.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -106,4 +110,4 @@ class ObTableLoadMergeAckPhaseOp : public ObTableLoadMergePhaseOp }; } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/ob_table_load_merge_rescan_op.cpp b/src/observer/table_load/ob_table_load_merge_rescan_op.cpp index 63a2ac264..d0acbd559 100644 --- a/src/observer/table_load/ob_table_load_merge_rescan_op.cpp +++ b/src/observer/table_load/ob_table_load_merge_rescan_op.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -53,7 +57,7 @@ int ObTableLoadMergeRescanOp::switch_next_op(bool is_parent_called) ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected merge table ctx is null", KR(ret)); } else { - // 重设merge_table_ctx_ + // Reset merge_table_ctx_ inner_ctx_.store_table_ctx_ = merge_table_ctx_->store_table_ctx_; inner_ctx_.insert_table_ctx_ = merge_table_ctx_->insert_table_ctx_; inner_ctx_.table_store_ = nullptr; diff --git a/src/observer/table_load/ob_table_load_merge_rescan_op.h b/src/observer/table_load/ob_table_load_merge_rescan_op.h index 18cab6489..e2e9173ea 100644 --- a/src/observer/table_load/ob_table_load_merge_rescan_op.h +++ b/src/observer/table_load/ob_table_load_merge_rescan_op.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_merge_table_op.cpp b/src/observer/table_load/ob_table_load_merge_table_op.cpp index 2e4d505fa..92e426add 100644 --- a/src/observer/table_load/ob_table_load_merge_table_op.cpp +++ b/src/observer/table_load/ob_table_load_merge_table_op.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -110,7 +114,7 @@ int ObTableLoadMergeTableOp::switch_next_op(bool is_parent_called) child_op_type = ObTableLoadMergeOpType::RESCAN; break; } else if (need_del_lob_) { - // del_lob需要用到lob数据, 不能在inner_close的时候才close + // del_lob needs lob data, cannot be closed at inner_close time if (ObTableLoadMergerPhaseType::INSERT == merge_phase_ctx_->phase_) { if (OB_FAIL( store_ctx_->data_store_table_ctx_->lob_table_ctx_->close_build_delete_table())) { @@ -341,4 +345,4 @@ int ObTableLoadMergeIndexesTableOp::acquire_child_op(ObTableLoadMergeOpType::Typ } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/ob_table_load_merge_table_op.h b/src/observer/table_load/ob_table_load_merge_table_op.h index 21dd59674..ec7cf794f 100644 --- a/src/observer/table_load/ob_table_load_merge_table_op.h +++ b/src/observer/table_load/ob_table_load_merge_table_op.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -43,11 +47,11 @@ class ObTableLoadMergeTableCtx storage::ObDirectLoadTableStore *table_store_; storage::ObDirectLoadDMLRowHandler *dml_row_handler_; ObDirectLoadMergeMode::Type merge_mode_; - bool use_batch_mode_; // 全量 + 列存表 - // 合并任务结束要做的事情 - bool need_calc_range_; // rescan的前置 - bool need_close_insert_tablet_ctx_; // 本次合并是否需要关闭insert_table_ctx - // 特殊合并任务标记 + bool use_batch_mode_; // full + columnar table + // Things to do when the merge task is finished + bool need_calc_range_; // precondition for rescan + bool need_close_insert_tablet_ctx_; // Does this merge need to close insert_table_ctx + // special merge task marker bool is_del_lob_; }; diff --git a/src/observer/table_load/ob_table_load_multiple_heap_table_compactor.cpp b/src/observer/table_load/ob_table_load_multiple_heap_table_compactor.cpp index 2d6e04310..38cdbb09a 100644 --- a/src/observer/table_load/ob_table_load_multiple_heap_table_compactor.cpp +++ b/src/observer/table_load/ob_table_load_multiple_heap_table_compactor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -352,7 +356,7 @@ int ObTableLoadMultipleHeapTableCompactor::construct_compactors() ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected not external table", KR(ret), KPC(table_store)); } else { - // 根据table_store构造任务 + // Construct task based on table_store FOREACH_X(it, *table_store, OB_SUCC(ret)) { ObDirectLoadTableHandleArray *table_handle_array = it->second; @@ -363,7 +367,7 @@ int ObTableLoadMultipleHeapTableCompactor::construct_compactors() } } if (OB_SUCC(ret)) { - // 清空table_store, 以便在排序过程中能释放磁盘空间 + // Clear table_store to release disk space during sorting process table_store->clear(); } } @@ -405,19 +409,19 @@ int ObTableLoadMultipleHeapTableCompactor::start_sort() ObTableLoadTableCtx *ctx = store_ctx_->ctx_; for (int64_t i = 0; OB_SUCC(ret) && i < mem_ctx_.load_thread_cnt_; ++i) { ObTableLoadTask *task = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(ctx->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor(ctx, &mem_ctx_))) { LOG_WARN("fail to set compact task processor", KR(ret)); } - // 3. 设置callback + // 3. Set callback else if (OB_FAIL(task->set_callback(ctx, this))) { LOG_WARN("fail to set compact task callback", KR(ret)); } - // 4. 把task放入调度器 + // 4. Put task into scheduler else if (OB_FAIL(store_ctx_->task_scheduler_->add_task(i, task))) { LOG_WARN("fail to add task", KR(ret), K(i), KPC(task)); } @@ -432,7 +436,7 @@ int ObTableLoadMultipleHeapTableCompactor::start_sort() void ObTableLoadMultipleHeapTableCompactor::stop() { - set_has_error(); //先设置为error,因为stop的场景就是error + set_has_error(); //Set to error first, because the stop scenario is an error } int ObTableLoadMultipleHeapTableCompactor::handle_compact_task_finish(int ret_code) @@ -455,7 +459,7 @@ int ObTableLoadMultipleHeapTableCompactor::finish() { int ret = OB_SUCCESS; ObDirectLoadTableStore *table_store = op_->merge_table_ctx_->table_store_; - // 将排序后的数据保存到table_store + // Save the sorted data to table_store table_store->clear(); table_store->set_table_data_desc(mem_ctx_.table_data_desc_); table_store->set_multiple_heap_table(); diff --git a/src/observer/table_load/ob_table_load_multiple_heap_table_compactor.h b/src/observer/table_load/ob_table_load_multiple_heap_table_compactor.h index a55fc2b0c..16b358822 100644 --- a/src/observer/table_load/ob_table_load_multiple_heap_table_compactor.h +++ b/src/observer/table_load/ob_table_load_multiple_heap_table_compactor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -67,7 +71,7 @@ class ObTableLoadMultipleHeapTableCompactor ObTableLoadStoreCtx *store_ctx_; ObTableLoadStoreTableCtx *store_table_ctx_; ObTableLoadMergeMemSortOp *op_; - common::ObArenaAllocator allocator_; //需要最后析构 + common::ObArenaAllocator allocator_; // needs to be destructed last storage::ObDirectLoadMemContext mem_ctx_; bool is_inited_; }; diff --git a/src/observer/table_load/ob_table_load_obj_cast.cpp b/src/observer/table_load/ob_table_load_obj_cast.cpp index f105bd902..96b3336e7 100644 --- a/src/observer/table_load/ob_table_load_obj_cast.cpp +++ b/src/observer/table_load/ob_table_load_obj_cast.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -72,7 +76,7 @@ int ObTableLoadObjCaster::cast_obj(ObTableLoadCastObjCtx &cast_obj_ctx, const ObObjType expect_type = column_schema->get_meta_type().get_type(); const ObAccuracy &accuracy = column_schema->get_accuracy(); if (column_schema->is_unused()) { - // 快速删除列, 直接填充null + // Fast delete column, directly fill with null if (OB_UNLIKELY(!src.is_nop_value())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected insert specify deleted column", KR(ret), K(src), KPC(column_schema)); @@ -80,7 +84,7 @@ int ObTableLoadObjCaster::cast_obj(ObTableLoadCastObjCtx &cast_obj_ctx, dst.set_null(); } } else if (src.is_nop_value()) { - // 默认值是表达式 + // Default value is expression if (lib::is_mysql_mode() && column_schema->get_cur_default_value().is_ext()) { ret = OB_NOT_SUPPORTED; LOG_WARN("column default value is ext", KR(ret), KPC(column_schema)); @@ -88,8 +92,8 @@ int ObTableLoadObjCaster::cast_obj(ObTableLoadCastObjCtx &cast_obj_ctx, ret = OB_NOT_SUPPORTED; LOG_WARN("column default value is expr", KR(ret), KPC(column_schema)); } - // 没有默认值, 且为NOT NULL - // 例外:枚举类型默认为第一个 + // No default value, and is NOT NULL + // Exception: Enum type defaults to the first one else if (column_schema->is_not_null_for_write() && column_schema->get_cur_default_value().is_null()) { if (column_schema->get_meta_type().is_enum()) { @@ -100,17 +104,17 @@ int ObTableLoadObjCaster::cast_obj(ObTableLoadCastObjCtx &cast_obj_ctx, LOG_WARN("column can not be null", KR(ret), KPC(column_schema)); } } - // mysql模式 + // mysql mode else if (lib::is_mysql_mode()) { - // char,nchar,binary需要转换 + // char,nchar,binary need conversion if (column_schema->get_meta_type().is_fixed_len_char_type() || column_schema->get_meta_type().is_binary()) { convert_src_obj = &(column_schema->get_cur_default_value()); } else { - // 直接用default value + // directly use default value dst = column_schema->get_cur_default_value(); } } - // oracle模式需要转换 + // Oracle mode needs conversion else { convert_src_obj = &(column_schema->get_cur_default_value()); } @@ -316,7 +320,7 @@ int ObTableLoadObjCaster::string_to_set(ObIAllocator &alloc, const ObObj &src, LOG_WARN("data truncate", K(pos), K(val_str), K(in_str), K(ret)); } } else { - pos %= 64; // MySQL中,如果value存在重复,则value_count可以大于64 + pos %= 64; // In MySQL, if value exists duplicate, then value_count can be greater than 64 value |= (1ULL << pos); } } while (OB_SUCC(ret) && !is_last_value); diff --git a/src/observer/table_load/ob_table_load_obj_cast.h b/src/observer/table_load/ob_table_load_obj_cast.h index 68d97d0e2..db988a85f 100644 --- a/src/observer/table_load/ob_table_load_obj_cast.h +++ b/src/observer/table_load/ob_table_load_obj_cast.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -242,22 +246,22 @@ class ObTableLoadObjCaster } const int32_t decimal_len = precision - scale; - // precision-scale>0时,整数部分的位数不能超过precision-scale - // precision-scale<=0时,整数部分必须为0,小数点后-(precision-scale)位也必须为0 + // when precision-scale>0, the number of digits in the integer part cannot exceed precision-scale + // when precision-scale<=0, the integer part must be 0, and the -(precision-scale) digits after the decimal point must also be 0 if ((decimal_len > 0 && integer_count <= decimal_len) || (decimal_len <= 0 && n1 == 0 && n2 / ROUND_POWS[(number::ObNumber::DIGIT_LEN + decimal_len)] == 0)) { - // scale>0时,精度限制在小数点后scale位 + // when scale>0, precision is limited to scale decimal places if (scale > 0) { if (n2 > 0 && decimal_count > scale) { return OB_EAGAIN; } - // scale=0时,小数部分被舍去 + // scale=0 when, the fractional part is discarded } else if (scale == 0) { if (n2 > 0) { return OB_EAGAIN; } - // scale<0时,小数部分被舍去且精度限制在小数点前-scale位 + // when scale<0, the fractional part is discarded and precision is limited to -scale digits before the decimal point } else { if (n2 > 0 || -scale >= number::ObNumber::DIGIT_LEN || n1 % ROUND_POWS[-scale] == 0) { return OB_EAGAIN; diff --git a/src/observer/table_load/ob_table_load_object_allocator.h b/src/observer/table_load/ob_table_load_object_allocator.h index f3b5cb8de..6c711c3d6 100644 --- a/src/observer/table_load/ob_table_load_object_allocator.h +++ b/src/observer/table_load/ob_table_load_object_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_parallel_merger.cpp b/src/observer/table_load/ob_table_load_parallel_merger.cpp index a34f34055..ab627914e 100644 --- a/src/observer/table_load/ob_table_load_parallel_merger.cpp +++ b/src/observer/table_load/ob_table_load_parallel_merger.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -90,7 +94,7 @@ int ObTableLoadParallelMerger::init_merge_task(ObTableLoadMergeTableBaseOp *op) if (OB_FAIL(task_iter_.init(&merge_ctx_))) { LOG_WARN("fail to init task iter", KR(ret)); } else { - // merge_task会持有table的引用计数, 这里可以先清空 + // merge_task will hold a reference count to the table, so we can clear it here table_store->clear(); store_ctx_ = op->store_ctx_; op_ = op; @@ -139,19 +143,19 @@ int ObTableLoadParallelMerger::start() running_thread_cnt_ = thread_count; for (int64_t i = 0; OB_SUCC(ret) && i < thread_count; ++i) { ObTableLoadTask *task = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(ctx->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor(ctx, this))) { LOG_WARN("fail to set merge task processor", KR(ret)); } - // 3. 设置callback + // 3. Set callback else if (OB_FAIL(task->set_callback(ctx, this))) { LOG_WARN("fail to set merge task callback", KR(ret)); } - // 4. 把task放入调度器 + // 4. Put task into scheduler else if (OB_FAIL(store_ctx_->task_scheduler_->add_task(i, task))) { LOG_WARN("fail to add task", KR(ret), K(i), KPC(task)); } @@ -200,12 +204,12 @@ int ObTableLoadParallelMerger::handle_merge_task_finish(ObDirectLoadIMergeTask * int ret_code) { int ret = OB_SUCCESS; - // 先把任务从running队列移除 + // First remove the task from the running queue { ObMutexGuard guard(mutex_); abort_unless(OB_NOT_NULL(running_task_list_.remove(merge_task))); } - // 任务可能执行成功或失败 + // The task may succeed or fail ObDirectLoadTabletMergeCtx *tablet_merge_ctx = merge_task->get_merge_ctx(); bool is_ready = false; if (OB_ISNULL(tablet_merge_ctx)) { @@ -222,7 +226,7 @@ int ObTableLoadParallelMerger::handle_merge_task_finish(ObDirectLoadIMergeTask * OB_FAIL(insert_tablet_ctx->close())) { LOG_WARN("fail to close", KR(ret)); } else { - // 清理 + // cleanup tablet_merge_ctx->reset(); } } diff --git a/src/observer/table_load/ob_table_load_parallel_merger.h b/src/observer/table_load/ob_table_load_parallel_merger.h index 786d3f3d0..a9baf853e 100644 --- a/src/observer/table_load/ob_table_load_parallel_merger.h +++ b/src/observer/table_load/ob_table_load_parallel_merger.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_parallel_table_compactor.cpp b/src/observer/table_load/ob_table_load_parallel_table_compactor.cpp index 844a7f1e9..de2a36048 100644 --- a/src/observer/table_load/ob_table_load_parallel_table_compactor.cpp +++ b/src/observer/table_load/ob_table_load_parallel_table_compactor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -597,7 +601,7 @@ int ObTableLoadParallelTableCompactor::construct_compactors() ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected not multiple sstable", KR(ret), KPC(table_store)); } else { - // 根据table_store构造tablet_ctx + // Construct tablet_ctx based on table_store FOREACH_X(it, *table_store, OB_SUCC(ret)) { const ObTabletID &tablet_id = it->first; @@ -621,7 +625,7 @@ int ObTableLoadParallelTableCompactor::construct_compactors() } } if (OB_SUCC(ret)) { - // 清空table_store, 以便在compact过程中能释放磁盘空间 + // Clear table_store, so that disk space can be released during the compact process table_store->clear(); } } @@ -695,12 +699,12 @@ int ObTableLoadParallelTableCompactor::schedule_merge_unlock() } else if (OB_FAIL(idle_thread_list_.pop_back(thread_idx))) { LOG_WARN("fail to pop back thread idx", KR(ret)); } - // 设置task的callback + // Set the callback for task else if (OB_FAIL( task->set_callback(store_ctx_->ctx_, this, thread_idx))) { LOG_WARN("fail to set task callback", KR(ret)); } - // 把task放入调度器 + // put task into scheduler else if (OB_FAIL(store_ctx_->task_scheduler_->add_task(thread_idx, task))) { LOG_WARN("fail to add task", KR(ret), K(thread_idx), KPC(task)); } @@ -718,16 +722,16 @@ int ObTableLoadParallelTableCompactor::construct_split_range_task( { int ret = OB_SUCCESS; ObTableLoadTask *task = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(store_ctx_->ctx_->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL( task->set_processor(store_ctx_->ctx_, this, tablet_ctx))) { LOG_WARN("fail to set split range task processor", KR(ret)); } - // 3. 添加到任务队列 + // 3. Add to task queue else if (OB_FAIL(add_light_task(task))) { LOG_WARN("fail to add light task", KR(ret)); } @@ -744,16 +748,16 @@ int ObTableLoadParallelTableCompactor::construct_merge_range_task( { int ret = OB_SUCCESS; ObTableLoadTask *task = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(store_ctx_->ctx_->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor(store_ctx_->ctx_, this, tablet_ctx, range_idx))) { LOG_WARN("fail to set merge range task processor", KR(ret)); } - // 3. 添加到任务队列 + // 3. Add to task queue else if (OB_FAIL(add_heavy_task(task))) { LOG_WARN("fail to add heavy task", KR(ret)); } @@ -770,16 +774,16 @@ int ObTableLoadParallelTableCompactor::construct_compact_sstable_task( { int ret = OB_SUCCESS; ObTableLoadTask *task = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(store_ctx_->ctx_->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor(store_ctx_->ctx_, this, tablet_ctx))) { LOG_WARN("fail to set compact sstable task processor", KR(ret)); } - // 3. 添加到任务队列 + // 3. Add to task queue else if (OB_FAIL(add_light_task(task))) { LOG_WARN("fail to add light task", KR(ret)); } diff --git a/src/observer/table_load/ob_table_load_parallel_table_compactor.h b/src/observer/table_load/ob_table_load_parallel_table_compactor.h index 3b5aaa838..dba17c8b4 100644 --- a/src/observer/table_load/ob_table_load_parallel_table_compactor.h +++ b/src/observer/table_load/ob_table_load_parallel_table_compactor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_partition_calc.cpp b/src/observer/table_load/ob_table_load_partition_calc.cpp index a501fdf46..1d30401d5 100644 --- a/src/observer/table_load/ob_table_load_partition_calc.cpp +++ b/src/observer/table_load/ob_table_load_partition_calc.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -71,18 +75,18 @@ int ObTableLoadPartitionCalc::init(const ObTableLoadParam ¶m, LOG_WARN("fail to get table schema", KR(ret), K(tenant_id), K(table_id)); } else { const bool is_partitioned = table_schema->is_partitioned_table(); - if (!is_partitioned) { // 非分区表 + if (!is_partitioned) { // non-partitioned table if (OB_FAIL(table_schema->get_tablet_and_object_id(partition_id_.tablet_id_, partition_id_.partition_id_))) { LOG_WARN("fail to get tablet and object", KR(ret)); } - } else { // 分区表 - // 初始化table_location_ + } else { // partition table + // Initialize table_location_ if (OB_FAIL( table_location_.init_partition_ids_by_rowkey2(exec_ctx_, *session_info, schema_guard_, table_id))) { LOG_WARN("fail to init table location", KR(ret)); } - // 获取part_key_obj_index_ + // get part_key_obj_index_ else if (OB_FAIL(init_part_key_index(table_schema, allocator_))) { LOG_WARN("fail to get rowkey index", KR(ret)); } else if (ObDirectLoadLevel::PARTITION == param.load_level_) { diff --git a/src/observer/table_load/ob_table_load_partition_calc.h b/src/observer/table_load/ob_table_load_partition_calc.h index 4702dd779..9d228a4ac 100644 --- a/src/observer/table_load/ob_table_load_partition_calc.h +++ b/src/observer/table_load/ob_table_load_partition_calc.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -65,9 +69,9 @@ class ObTableLoadPartitionCalc const ObTableLoadParam *param_; // data members bool is_partitioned_; - // 非分区表 + // Non-partitioned table table::ObTableLoadPartitionId partition_id_; - // 分区表 + // partition table common::ObArenaAllocator allocator_; sql::ObSqlCtx sql_ctx_; sql::ObExecContext exec_ctx_; diff --git a/src/observer/table_load/ob_table_load_partition_location.cpp b/src/observer/table_load/ob_table_load_partition_location.cpp index 69c43dc09..05bf57d89 100644 --- a/src/observer/table_load/ob_table_load_partition_location.cpp +++ b/src/observer/table_load/ob_table_load_partition_location.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -261,7 +265,7 @@ int ObTableLoadPartitionLocation::init_all_leader_info() ObHashMap *>::const_iterator addr_iter; int64_t pos = 0; tmp_allocator.set_tenant_id(MTL_ID()); - // 将所有addr存到set中 + // Store all addr in the set if (OB_FAIL(addr_map.create(64, "TLD_PL_Tmp", "TLD_PL_Tmp"))) { LOG_WARN("fail to create hashmap", KR(ret)); } else { @@ -307,7 +311,7 @@ int ObTableLoadPartitionLocation::init_all_leader_info() } } } - // 将set中的addr存到array中 + // Store the addr in set to array if (OB_SUCC(ret)) { if (OB_FAIL(all_leader_addr_array_.create(addr_map.size(), allocator_))) { LOG_WARN("fail to create leader addr array", KR(ret)); diff --git a/src/observer/table_load/ob_table_load_partition_location.h b/src/observer/table_load/ob_table_load_partition_location.h index 70b340515..34890f16e 100644 --- a/src/observer/table_load/ob_table_load_partition_location.h +++ b/src/observer/table_load/ob_table_load_partition_location.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -81,7 +85,7 @@ class ObTableLoadPartitionLocation const ObIArray &target_partition_ids, ObTableLoadPartitionLocation &partition_location, ObTableLoadPartitionLocation &target_partition_location); - // 通过tablet_id获取 + // Get through tablet_id static int fetch_ls_id(uint64_t tenant_id, const common::ObTabletID &tablet_id, share::ObLSID &ls_id); static int fetch_ls_location(uint64_t tenant_id, const common::ObTabletID &tablet_id, @@ -98,7 +102,7 @@ class ObTableLoadPartitionLocation const common::ObIArray &partition_ids); private: common::ObArenaAllocator allocator_; - common::ObArray tablet_ids_; //保证遍历partition_map_的时候顺序不变 + common::ObArray tablet_ids_; // Ensure the order remains unchanged when traversing partition_map_ common::hash::ObHashMap partition_map_; table::ObTableLoadArray all_leader_addr_array_; table::ObTableLoadArray all_leader_info_array_; diff --git a/src/observer/table_load/ob_table_load_pre_sort_writer.cpp b/src/observer/table_load/ob_table_load_pre_sort_writer.cpp index c7c888df1..09a4ec045 100644 --- a/src/observer/table_load/ob_table_load_pre_sort_writer.cpp +++ b/src/observer/table_load/ob_table_load_pre_sort_writer.cpp @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. -*/ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_pre_sort_writer.h b/src/observer/table_load/ob_table_load_pre_sort_writer.h index a77a57f91..34f48ad92 100644 --- a/src/observer/table_load/ob_table_load_pre_sort_writer.h +++ b/src/observer/table_load/ob_table_load_pre_sort_writer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_TABLE_PRE_SORT_WRITER_ diff --git a/src/observer/table_load/ob_table_load_pre_sorter.cpp b/src/observer/table_load/ob_table_load_pre_sorter.cpp index b062c48e4..8c5ee0f3c 100644 --- a/src/observer/table_load/ob_table_load_pre_sorter.cpp +++ b/src/observer/table_load/ob_table_load_pre_sorter.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -78,7 +82,7 @@ int ObTableLoadPreSorter::ChunkSorter::work() LOG_WARN("fail to sort chunk", KR(ret), K(chunk_node_id_)); } else if (0 == pre_sorter_->dec_sort_chunk_task_cnt() && ATOMIC_LOAD(&pre_sorter_->all_trans_finished_)) { - mem_ctx_->load_thread_cnt_ = 0; // 用于让sample线程退出 + mem_ctx_->load_thread_cnt_ = 0; // used to let the sample thread exit } return ret; } @@ -106,7 +110,7 @@ ObTableLoadPreSorter::~ObTableLoadPreSorter() void ObTableLoadPreSorter::reset() { is_inited_ = false; - // 先把sample线程停下来 + // First stop the sample thread mem_ctx_.has_error_ = true; if (OB_NOT_NULL(sample_task_scheduler_)) { sample_task_scheduler_->stop(); @@ -127,7 +131,7 @@ void ObTableLoadPreSorter::reset() finish_thread_cnt_ = 0; sort_chunk_task_cnt_ = 0; all_trans_finished_ = false; - // 分配器最后reset + // dispatcher final reset allocator_.reset(); } @@ -321,19 +325,19 @@ int ObTableLoadPreSorter::start_finish() { int ret = OB_SUCCESS; ObTableLoadTask *task = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(ctx_->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor(ctx_, this))) { LOG_WARN("fail to set finish task processor", KR(ret)); } - // 3. 设置callback + // 3. Set callback else if (OB_FAIL(task->set_callback(ctx_))) { LOG_WARN("fail to set finish task callback", KR(ret)); } - // 4. 把task放入调度器 + // 4. Put task into scheduler else if (OB_FAIL(store_ctx_->task_scheduler_->add_task(0, task))) { LOG_WARN("fail to add task", KR(ret), KPC(task)); } diff --git a/src/observer/table_load/ob_table_load_pre_sorter.h b/src/observer/table_load/ob_table_load_pre_sorter.h index bcf7506d9..673231f1c 100644 --- a/src/observer/table_load/ob_table_load_pre_sorter.h +++ b/src/observer/table_load/ob_table_load_pre_sorter.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_px_batch_rows.cpp b/src/observer/table_load/ob_table_load_px_batch_rows.cpp index bb64c6cfb..38a92af05 100644 --- a/src/observer/table_load/ob_table_load_px_batch_rows.cpp +++ b/src/observer/table_load/ob_table_load_px_batch_rows.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_px_batch_rows.h b/src/observer/table_load/ob_table_load_px_batch_rows.h index 1602032e6..80c69825c 100644 --- a/src/observer/table_load/ob_table_load_px_batch_rows.h +++ b/src/observer/table_load/ob_table_load_px_batch_rows.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -27,20 +31,19 @@ class ObTableLoadPXBatchRows void reuse(); int init(const common::ObIArray &px_col_descs, const common::ObIArray &px_col_accuracys, - const common::ObIArray &px_column_project_idxs, // px列对应哪个store列 + const common::ObIArray &px_column_project_idxs, // px column corresponds to which store column const common::ObIArray &col_descs, const sql::ObBitVector *col_nullables, const ObDirectLoadRowFlag &row_flag, const int64_t max_batch_size, - // 为了老路径farm能过 + // For old path farm to pass const bool need_reshape); - // 深拷贝 + // Deep copy int append_selective(const IVectorPtrs &vectors, const uint16_t *selector, int64_t size); int append_selective(const ObIArray &datum_vectors, const uint16_t *selector, int64_t size); int append_row(const ObDirectLoadDatumRow &datum_row); - - // 浅拷贝 + // Shallow copy int shallow_copy(const IVectorPtrs &vectors, const int64_t batch_size); int shallow_copy(const ObIArray &datum_vectors, const int64_t batch_size); diff --git a/src/observer/table_load/ob_table_load_redef_table.cpp b/src/observer/table_load/ob_table_load_redef_table.cpp index 564301ab6..8a25aecc5 100644 --- a/src/observer/table_load/ob_table_load_redef_table.cpp +++ b/src/observer/table_load/ob_table_load_redef_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_redef_table.h b/src/observer/table_load/ob_table_load_redef_table.h index 636980f19..7d3a91abc 100644 --- a/src/observer/table_load/ob_table_load_redef_table.h +++ b/src/observer/table_load/ob_table_load_redef_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -145,7 +149,7 @@ class ObTableLoadRedefTable static int finish(const ObTableLoadRedefTableFinishArg &arg, sql::ObSQLSessionInfo &session_info); static int abort(const ObTableLoadRedefTableAbortArg &arg, sql::ObSQLSessionInfo &session_info); private: - // 检查原表和隐藏表是否一致 + // Check if the original table and the hidden table are consistent static int check_table_consistency(const uint64_t tenant_id, const uint64_t table_id, const uint64_t dest_table_id, diff --git a/src/observer/table_load/ob_table_load_row_projector.cpp b/src/observer/table_load/ob_table_load_row_projector.cpp index 6b077afe2..9128a5fc2 100644 --- a/src/observer/table_load/ob_table_load_row_projector.cpp +++ b/src/observer/table_load/ob_table_load_row_projector.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/src/observer/table_load/ob_table_load_row_projector.h b/src/observer/table_load/ob_table_load_row_projector.h index eeb997e68..e76c5a590 100644 --- a/src/observer/table_load/ob_table_load_row_projector.h +++ b/src/observer/table_load/ob_table_load_row_projector.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_rpc_executor.h b/src/observer/table_load/ob_table_load_rpc_executor.h index 6f03b6468..5473806e7 100644 --- a/src/observer/table_load/ob_table_load_rpc_executor.h +++ b/src/observer/table_load/ob_table_load_rpc_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_rpc_processor.cpp b/src/observer/table_load/ob_table_load_rpc_processor.cpp index e3a0c00a8..fceeb4edd 100644 --- a/src/observer/table_load/ob_table_load_rpc_processor.cpp +++ b/src/observer/table_load/ob_table_load_rpc_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_rpc_processor.h b/src/observer/table_load/ob_table_load_rpc_processor.h index 003ec00a1..8f97530c5 100644 --- a/src/observer/table_load/ob_table_load_rpc_processor.h +++ b/src/observer/table_load/ob_table_load_rpc_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_schema.cpp b/src/observer/table_load/ob_table_load_schema.cpp index fb2fc79ca..a18f4d1ab 100644 --- a/src/observer/table_load/ob_table_load_schema.cpp +++ b/src/observer/table_load/ob_table_load_schema.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -162,13 +166,13 @@ int ObTableLoadSchema::get_user_column_schemas(const ObTableSchema *table_schema ret = OB_ERR_UNEXPECTED; LOG_WARN("The column is null", KR(ret)); } else if (column_schema->is_hidden()) { - // 不显示隐藏列(堆表隐藏主键列,快速删除列,?) + // Do not display hidden columns (heap table hidden primary key column, quick delete column, ?) } else if (column_schema->is_unused()) { - // 不显示快速删除列 + // Do not display the quick delete column } else if (column_schema->is_invisible_column() && !contain_invisible_column) { - // 不显示invisible列 + // Do not display invisible column } else if (column_schema->is_shadow_column()) { - // 不显示shadow列 + // Do not display the shadow column } else if (OB_FAIL(column_schemas.push_back(column_schema))) { LOG_WARN("fail to push back column schema", KR(ret)); } @@ -329,7 +333,7 @@ int ObTableLoadSchema::get_tenant_optimizer_gather_stats_on_load(const uint64_t SMART_VAR(ObMySQLProxy::MySQLResult, res) { sqlclient::ObMySQLResult *result = nullptr; - // TODO(suzhi.yt) 这里为啥是带zone纬度的? 如果查询结果中有多个zone的, 选哪个作为返回值呢? + // TODO(suzhi.yt) Why is it with zone dimension? If there are multiple zones in the query results, which one should be returned? if (OB_FAIL(sql.assign_fmt( "SELECT value FROM %s WHERE tenant_id = %ld and (zone, name, schema_version) in (select " "zone, name, max(schema_version) FROM %s group by zone, name) and name = '%s'", diff --git a/src/observer/table_load/ob_table_load_schema.h b/src/observer/table_load/ob_table_load_schema.h index 228d5a757..557099322 100644 --- a/src/observer/table_load/ob_table_load_schema.h +++ b/src/observer/table_load/ob_table_load_schema.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -36,11 +40,11 @@ class ObTableLoadSchema uint64_t database_id, const common::ObString &table_name, const share::schema::ObTableSchema *&table_schema); - // 获取最新schema_guard和table_schema + // Get the latest schema_guard and table_schema static int get_table_schema(uint64_t tenant_id, uint64_t table_id, share::schema::ObSchemaGetterGuard &schema_guard, const share::schema::ObTableSchema *&table_schema); - // 指定schema_guard获取table_schema + // Specify schema_guard to obtain table_schema static int get_table_schema(share::schema::ObSchemaGetterGuard &schema_guard, uint64_t tenant_id, uint64_t table_id, const share::schema::ObTableSchema *&table_schema); diff --git a/src/observer/table_load/ob_table_load_service.cpp b/src/observer/table_load/ob_table_load_service.cpp index c19403e70..326a62e70 100644 --- a/src/observer/table_load/ob_table_load_service.cpp +++ b/src/observer/table_load/ob_table_load_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -623,7 +627,7 @@ int ObTableLoadService::check_support_direct_load_for_columns( ret = OB_ERR_UNEXPECTED; LOG_WARN("invalid column schema", KR(ret), KP(column_schema)); } else if (column_schema->is_unused()) { - // 快速删除列, 仍然需要写宏块, 直接填null + // Fast delete column, still need to write macro block, directly fill null } else if ((!ObDirectLoadMethod::is_full(method) || !ObDirectLoadMode::is_insert_into(load_mode)) && column_schema->is_generated_column()) { ret = OB_NOT_SUPPORTED; LOG_WARN("direct-load does not support table has generated column", KR(ret), KPC(column_schema), K(method), K(load_mode)); @@ -677,15 +681,15 @@ int ObTableLoadService::check_support_direct_load_for_default_value( ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected null column schema", KR(ret), K(col_desc)); } - // 快速删除列 - // 对于insert into, sql会填充null - // 对于load data和java api, 用户无法指定被删除的列写数据, 旁路导入在类型转换时直接填充null + // Quick delete column + // For insert into, SQL will fill null + // For load data and java api, the user cannot specify writing data to deleted columns, bypass import directly fills null during type conversion else if (column_schema->is_unused()) { } - // 自增列 + // auto-increment column else if (column_schema->is_autoincrement() || column_schema->is_identity_column()) { } - // 默认值是表达式 + // Default value is expression else if (OB_UNLIKELY(lib::is_mysql_mode() && column_schema->get_cur_default_value().is_ext())) { ret = OB_NOT_SUPPORTED; LOG_WARN("direct-load does not support column default value is ext", KR(ret), KPC(column_schema)); @@ -695,8 +699,8 @@ int ObTableLoadService::check_support_direct_load_for_default_value( LOG_WARN("direct-load does not support column default value is expr", KR(ret), KPC(column_schema)); FORWARD_USER_ERROR_MSG(ret, "direct-load does not support column default value is expr"); } - // 没有默认值, 且为NOT NULL - // 例外:枚举类型默认为第一个 + // No default value, and is NOT NULL + // Exception: Enum type defaults to the first one else if (OB_UNLIKELY(column_schema->is_not_null_for_write() && column_schema->get_cur_default_value().is_null() && !column_schema->get_meta_type().is_enum())) { @@ -963,11 +967,10 @@ void ObTableLoadService::release_all_ctx() // 1. check all obj removed bool all_removed = false; do { - // 通知后台线程快速退出 + // Notify the background thread to exit quickly abort_all_client_task(OB_CANCELED); fail_all_ctx(OB_CANCELED); - - // 移除对象 + // Remove object manager_.remove_inactive_table_ctx(); manager_.remove_inactive_client_task(); manager_.remove_all_client_task_brief(); @@ -980,7 +983,7 @@ void ObTableLoadService::release_all_ctx() // 2. check all obj released bool all_released = false; do { - // 释放对象 + // Release object manager_.gc_table_ctx_in_list(); manager_.gc_client_task_in_list(); @@ -1045,7 +1048,7 @@ int ObTableLoadService::delete_assigned_task(ObDirectLoadResourceReleaseArg &arg LOG_WARN("fail to delete_assigned_task", KR(ret), K(arg.task_key_)); } else if (OB_FAIL(ObTableLoadResourceService::release_resource(arg))) { LOG_WARN("fail to release resource", KR(ret)); - ret = OB_SUCCESS; // 允许失败,资源管理模块可以回收 + ret = OB_SUCCESS; // Allow failure, the resource management module can reclaim } } diff --git a/src/observer/table_load/ob_table_load_service.h b/src/observer/table_load/ob_table_load_service.h index f92072c45..42e09bfac 100644 --- a/src/observer/table_load/ob_table_load_service.h +++ b/src/observer/table_load/ob_table_load_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -38,14 +42,14 @@ class ObTableLoadService static int mtl_new(ObTableLoadService *&service); static void mtl_destroy(ObTableLoadService *&service); static int check_tenant(); - // 旁路导入内核获取加表锁后的schema进行检查 + // Bypass import kernel to get the schema after acquiring the add table lock for checking static int check_support_direct_load(uint64_t table_id, const storage::ObDirectLoadMethod::Type method, const storage::ObDirectLoadInsertMode::Type insert_mode, const storage::ObDirectLoadMode::Type load_mode, const storage::ObDirectLoadLevel::Type load_level, const common::ObIArray &column_ids); - // 业务层指定schema_guard进行检查 + // Business layer specifies schema_guard for check static int check_support_direct_load(share::schema::ObSchemaGetterGuard &schema_guard, uint64_t table_id, const storage::ObDirectLoadMethod::Type method, diff --git a/src/observer/table_load/ob_table_load_stat.cpp b/src/observer/table_load/ob_table_load_stat.cpp index f71df7d3e..7632916a1 100644 --- a/src/observer/table_load/ob_table_load_stat.cpp +++ b/src/observer/table_load/ob_table_load_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/table_load/ob_table_load_stat.h" diff --git a/src/observer/table_load/ob_table_load_stat.h b/src/observer/table_load/ob_table_load_stat.h index 939119966..b23f5a93e 100644 --- a/src/observer/table_load/ob_table_load_stat.h +++ b/src/observer/table_load/ob_table_load_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_store.cpp b/src/observer/table_load/ob_table_load_store.cpp index 8b287df4f..e43aab636 100644 --- a/src/observer/table_load/ob_table_load_store.cpp +++ b/src/observer/table_load/ob_table_load_store.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -262,18 +266,18 @@ int ObTableLoadStore::pre_merge( bool trans_exist = false; ObTableLoadArray store_committed_trans_id_array; allocator.set_tenant_id(MTL_ID()); - // 1. 冻结状态, 防止后续继续创建trans + // 1. Frozen state, prevent further creation of trans if (OB_FAIL(store_ctx_->set_status_frozen())) { LOG_WARN("fail to set store status frozen", KR(ret)); } - // 2. 检查当前是否还有trans没有结束 + // 2. Check if there are any trans that have not ended yet else if (OB_FAIL(store_ctx_->check_exist_trans(trans_exist))) { LOG_WARN("fail to check exist trans", KR(ret)); } else if (OB_UNLIKELY(trans_exist)) { ret = OB_ENTRY_EXIST; LOG_WARN("trans already exist", KR(ret)); } else if (!ctx_->param_.px_mode_) { - // 3. 检查数据一致性 + // 3. Check data consistency if (OB_FAIL( store_ctx_->get_committed_trans_ids(store_committed_trans_id_array, allocator))) { LOG_WARN("fail to get committed trans ids", KR(ret)); @@ -320,19 +324,19 @@ int ObTableLoadStore::start_merge() } } else { ObTableLoadTask *task = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(ctx_->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor(ctx_))) { LOG_WARN("fail to set merge task processor", KR(ret)); } - // 3. 设置callback + // 3. Set callback else if (OB_FAIL(task->set_callback(ctx_))) { LOG_WARN("fail to set merge task callback", KR(ret)); } - // 4. 把task放入调度器 + // 4. put task into scheduler else if (OB_FAIL(store_ctx_->task_scheduler_->add_task(0, task))) { LOG_WARN("fail to add task", KR(ret), KPC(task)); } @@ -374,8 +378,8 @@ int ObTableLoadStore::commit(ObTableLoadResultInfo &result_info, } else if (OB_FAIL(sql_statistics.merge(store_ctx_->sql_stats_))) { LOG_WARN("fail to merge sql stats", KR(ret)); } - // 全量旁路导入的dml_stat在执行节点更新 - // 增量旁路导入的dml_stat收集到协调节点在事务中更新 + // Full bypass import dml_stat is updated at the execution node + // Incremental bypass import's dml_stat collected on the coordinator node is updated in the transaction else if (ObDirectLoadMethod::is_full(param_.method_) && OB_FAIL(ObOptStatMonitorManager::update_dml_stat_info_from_direct_load(dml_stats.dml_stat_array_))) { LOG_WARN("fail to update dml stat info", KR(ret)); @@ -604,27 +608,27 @@ int ObTableLoadStore::clean_up_trans(ObTableLoadStoreTrans *trans) int ret = OB_SUCCESS; LOG_DEBUG("store clean up trans"); ObTableLoadTransStoreWriter *store_writer = nullptr; - // 取出当前store_writer + // Retrieve the current store_writer if (OB_FAIL(trans->get_store_writer(store_writer))) { LOG_WARN("fail to get store writer", KR(ret)); } else { for (int32_t session_id = 1; OB_SUCC(ret) && session_id <= param_.write_session_count_; ++session_id) { ObTableLoadTask *task = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(ctx_->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor(ctx_, trans, store_writer, session_id))) { LOG_WARN("fail to set clean up task processor", KR(ret)); } - // 3. 设置callback + // 3. Set callback else if (OB_FAIL(task->set_callback(ctx_))) { LOG_WARN("fail to set clean up task callback", KR(ret)); } - // 4. 把task放入调度器 + // 4. Put task into the scheduler else if (OB_FAIL(store_ctx_->task_scheduler_->add_task(session_id - 1, task))) { LOG_WARN("fail to add task", KR(ret), K(session_id), KPC(task)); } @@ -747,7 +751,7 @@ class ObTableLoadStore::WriteTaskCallback : public ObITableLoadTaskCallback private: ObTableLoadTableCtx * const ctx_; ObTableLoadStoreTrans * const trans_; - ObTableLoadTransStoreWriter * const store_writer_; // 为了保证接收完本次写入结果之后再让store的引用归零 + ObTableLoadTransStoreWriter * const store_writer_; // To ensure that the store's reference is reset only after receiving the result of this write operation }; int ObTableLoadStore::write(const ObTableLoadTransId &trans_id, int32_t session_id, @@ -762,14 +766,14 @@ int ObTableLoadStore::write(const ObTableLoadTransId &trans_id, int32_t session_ ObTableLoadStoreTrans *trans = nullptr; ObTableLoadTransStoreWriter *store_writer = nullptr; ObTableLoadMutexGuard guard; - // 取出当前trans + // Retrieve the current trans if (OB_FAIL(store_ctx_->get_trans(trans_id, trans))) { LOG_WARN("fail to get trans", KR(ret)); } else if (OB_FAIL(trans->check_trans_status(ObTableLoadTransStatusType::RUNNING))) { LOG_WARN("fail to check trans status", KR(ret)); } - // 取出store_writer + // retrieve store_writer else if (OB_FAIL(trans->get_store_writer(store_writer))) { LOG_WARN("fail to get store writer", KR(ret)); //} else if (OB_FAIL(store_writer->advance_sequence_no(session_id, partition_id, sequence_no, guard))) { @@ -794,11 +798,11 @@ int ObTableLoadStore::write(const ObTableLoadTransId &trans_id, int32_t session_ } else { ObTableLoadTask *task = nullptr; WriteTaskProcessor *processor = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(ctx_->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor(ctx_, trans, store_writer, session_id))) { LOG_WARN("fail to set write task processor", KR(ret)); @@ -808,11 +812,11 @@ int ObTableLoadStore::write(const ObTableLoadTransId &trans_id, int32_t session_ } else if (OB_FAIL(processor->set_row_array(row_array))) { LOG_WARN("fail to set objs", KR(ret)); } - // 3. 设置callback + // 3. Set callback else if (OB_FAIL(task->set_callback(ctx_, trans, store_writer))) { LOG_WARN("fail to set write task callback", KR(ret)); } - // 4. 把task放入调度器 + // 4. put task into scheduler else if (OB_FAIL(store_ctx_->task_scheduler_->add_task(session_id - 1, task))) { LOG_WARN("fail to add task", KR(ret), K(session_id), KPC(task)); } @@ -906,7 +910,7 @@ class ObTableLoadStore::FlushTaskCallback : public ObITableLoadTaskCallback private: ObTableLoadTableCtx * const ctx_; ObTableLoadStoreTrans * const trans_; - ObTableLoadTransStoreWriter * const store_writer_; // 为了保证接收完本次写入结果之后再让store的引用归零 + ObTableLoadTransStoreWriter * const store_writer_; // To ensure that the reference to store is reset only after receiving the result of this write operation }; int ObTableLoadStore::flush(ObTableLoadStoreTrans *trans) @@ -918,7 +922,7 @@ int ObTableLoadStore::flush(ObTableLoadStoreTrans *trans) } else { LOG_DEBUG("store flush"); ObTableLoadTransStoreWriter *store_writer = nullptr; - // 取出当前store_writer + // Retrieve the current store_writer if (OB_FAIL(trans->get_store_writer(store_writer))) { LOG_WARN("fail to get store writer", KR(ret)); } @@ -930,20 +934,20 @@ int ObTableLoadStore::flush(ObTableLoadStoreTrans *trans) } else { for (int32_t session_id = 1; OB_SUCC(ret) && session_id <= param_.write_session_count_; ++session_id) { ObTableLoadTask *task = nullptr; - // 1. 分配task + // 1. assign task if (OB_FAIL(ctx_->alloc_task(task))) { LOG_WARN("fail to alloc task", KR(ret)); } - // 2. 设置processor + // 2. Set processor else if (OB_FAIL(task->set_processor( ctx_, trans, store_writer, session_id))) { LOG_WARN("fail to set flush task processor", KR(ret)); } - // 3. 设置callback + // 3. Set callback else if (OB_FAIL(task->set_callback(ctx_, trans, store_writer))) { LOG_WARN("fail to set flush task callback", KR(ret)); } - // 4. 把task放入调度器 + // 4. put task into scheduler else if (OB_FAIL(store_ctx_->task_scheduler_->add_task(session_id - 1, task))) { LOG_WARN("fail to add task", KR(ret), K(session_id), KPC(task)); } diff --git a/src/observer/table_load/ob_table_load_store.h b/src/observer/table_load/ob_table_load_store.h index b27ac51a4..7407a6852 100644 --- a/src/observer/table_load/ob_table_load_store.h +++ b/src/observer/table_load/ob_table_load_store.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_store_ctx.cpp b/src/observer/table_load/ob_table_load_store_ctx.cpp index 78b13c297..6b703fa23 100644 --- a/src/observer/table_load/ob_table_load_store_ctx.cpp +++ b/src/observer/table_load/ob_table_load_store_ctx.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -92,7 +96,7 @@ ObTableLoadStoreCtx::~ObTableLoadStoreCtx() void ObTableLoadStoreCtx::destroy() { - // 先让工作线程停下来 + // First let the worker thread stop if (nullptr != write_ctx_.pre_sorter_) { write_ctx_.pre_sorter_->stop(); } @@ -111,7 +115,7 @@ void ObTableLoadStoreCtx::destroy() if (OB_NOT_NULL(dag_task_scheduler_)) { dag_task_scheduler_->wait(); } - // 按顺序析构对象, 被依赖的最后析构 + // Destruct objects in order, dependencies are destructed last if (nullptr != dag_exec_ctx_.dag_) { dag_exec_ctx_.dag_->~ObTableLoadDag(); allocator_.free(dag_exec_ctx_.dag_); @@ -530,7 +534,7 @@ int ObTableLoadStoreCtx::init_sort_param() // sort params int64_t wa_mem_limit = 0; if (ctx_->param_.exe_mode_ == ObTableLoadExeMode::MAX_TYPE) { - // 无资源控制模式 + // No resource control mode if (OB_FAIL(ObTableLoadService::get_memory_limit(wa_mem_limit))) { LOG_WARN("fail to get memory limit", KR(ret)); } else if (wa_mem_limit < ObDirectLoadMemContext::MIN_MEM_LIMIT) { @@ -550,7 +554,7 @@ int ObTableLoadStoreCtx::init_sort_param() heap_table_mem_chunk_size_ = wa_mem_limit / thread_cnt_; } } else { - // 资源控制模式 + // Resource control mode wa_mem_limit = ctx_->param_.avail_memory_; merge_count_per_round_ = min(wa_mem_limit / basic_table_data_desc_.sstable_data_block_size_ / thread_cnt_, @@ -595,20 +599,20 @@ int ObTableLoadStoreCtx::init_write_ctx() } // is_fast_heap_table_, is_multiple_mode_ switch (ctx_->param_.exe_mode_) { - // 堆表快速写入 + // Heap table fast write case ObTableLoadExeMode::FAST_HEAP_TABLE: write_ctx_.is_fast_heap_table_ = true; break; - // 有主键表不排序 + // Table with primary key does not need sorting case ObTableLoadExeMode::GENERAL_TABLE_COMPACT: break; - // 堆表排序 + // heap table sort case ObTableLoadExeMode::MULTIPLE_HEAP_TABLE_COMPACT: - // 有主键表排序 + // Table with primary key sorting case ObTableLoadExeMode::MEM_COMPACT: write_ctx_.is_multiple_mode_ = true; break; - // 无资源控制 + // No resource control case ObTableLoadExeMode::MAX_TYPE: { const int64_t part_cnt = data_store_table_ctx_->ls_partition_ids_.count(); int64_t wa_mem_limit = 0; @@ -621,18 +625,18 @@ int ObTableLoadStoreCtx::init_write_ctx() int64_t part_mem_size = 0; if (!data_store_table_ctx_->schema_->is_column_store() || ObDirectLoadMethod::is_incremental(ctx_->param_.method_)) { - // 行存 + // row storage part_mem_size = MACRO_BLOCK_WRITER_MEM_SIZE; } else { - // 列存 + // column store part_mem_size = data_store_table_ctx_->schema_->cg_cnt_ * cg_chunk_mem_limit * 10; } const int64_t bucket_cnt = MAX(1, wa_mem_limit / (thread_cnt_ * part_mem_size)); if (part_cnt <= bucket_cnt || !ctx_->param_.need_sort_) { - // 堆表快速写入 + // Fast write to heap table write_ctx_.is_fast_heap_table_ = true; } else { - // 堆表排序 + // heap table sort write_ctx_.is_multiple_mode_ = true; } } else { @@ -675,7 +679,7 @@ int ObTableLoadStoreCtx::init_write_ctx() table_schema))) { LOG_WARN("fail to get table schema", KR(ret), K(ctx_->param_)); } - // mysql模式下SQL执行计划会包含虚拟生成列 + // In MySQL mode, the SQL execution plan will include virtual generated columns else if (OB_FAIL(table_schema->get_column_ids(col_descs, lib::is_oracle_mode()/*no_virtual*/))) { LOG_WARN("fail to get column ids", KR(ret)); } else if (OB_FAIL(ObTableLoadSchema::prepare_col_descs(table_schema, col_descs))) { @@ -693,19 +697,19 @@ int ObTableLoadStoreCtx::init_write_ctx() ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected col schema is null", KR(ret), K(col_desc)); } - // SQL执行计划包含隐藏主键列、虚拟生成列以及其他普通列 + // SQL execution plan includes hidden primary key columns, virtual generated columns, and other ordinary columns else if (OB_FAIL(write_ctx_.px_column_descs_.push_back(col_desc))) { LOG_WARN("fail to push back", KR(ret)); } else if (OB_FAIL(write_ctx_.px_column_accuracys_.push_back(col_schema->get_accuracy()))) { LOG_WARN("fail to push back", KR(ret)); } - // 存储层不写虚拟生成列 + // Storage layer does not write virtual generated columns else if (col_schema->is_virtual_generated_column()) { if (OB_FAIL(write_ctx_.px_column_project_idxs_.push_back(-1))) { LOG_WARN("fail to push back", KR(ret)); } } else { - // 旁路不接收隐藏主键列 + // Bypass does not receive hidden primary key column if (ObColumnSchemaV2::is_hidden_pk_column_id(col_desc.col_id_)) { if (OB_FAIL(write_ctx_.px_column_project_idxs_.push_back(-1))) { LOG_WARN("fail to push back", KR(ret)); @@ -749,7 +753,7 @@ int ObTableLoadStoreCtx::init_write_ctx() } } } - // 堆表快速写入需要提前创建insert_table_ctx + // Heap table fast write requires pre-creating insert_table_ctx if (OB_SUCC(ret) && write_ctx_.is_fast_heap_table_) { if (ObDirectLoadMethod::is_incremental(ctx_->param_.method_) && OB_FAIL(init_trans_param(write_ctx_.trans_param_))) { @@ -778,20 +782,20 @@ int ObTableLoadStoreCtx::init_write_ctx_for_dag() static const int64_t cg_chunk_mem_limit = 64 * 1024L; // 64K // is_fast_heap_table_, is_multiple_mode_ switch (ctx_->param_.exe_mode_) { - // 堆表快速写入 + // Fast heap table write case ObTableLoadExeMode::FAST_HEAP_TABLE: write_ctx_.is_fast_heap_table_ = true; break; - // 有主键表不排序 + // Primary key table without sorting case ObTableLoadExeMode::GENERAL_TABLE_COMPACT: break; - // 堆表排序 + // Heap table sorting case ObTableLoadExeMode::MULTIPLE_HEAP_TABLE_COMPACT: - // 有主键表排序 + // Primary key table sorting case ObTableLoadExeMode::MEM_COMPACT: write_ctx_.is_multiple_mode_ = true; break; - // 无资源控制 + // No resource control case ObTableLoadExeMode::MAX_TYPE: { const int64_t part_cnt = data_store_table_ctx_->ls_partition_ids_.count(); int64_t wa_mem_limit = 0; @@ -804,18 +808,18 @@ int ObTableLoadStoreCtx::init_write_ctx_for_dag() int64_t part_mem_size = 0; if (!data_store_table_ctx_->schema_->is_column_store() || ObDirectLoadMethod::is_incremental(ctx_->param_.method_)) { - // 行存 + // Row storage part_mem_size = MACRO_BLOCK_WRITER_MEM_SIZE; } else { - // 列存 + // Column storage part_mem_size = data_store_table_ctx_->schema_->cg_cnt_ * cg_chunk_mem_limit * 10; } const int64_t bucket_cnt = MAX(1, wa_mem_limit / (thread_cnt_ * part_mem_size)); if (part_cnt <= bucket_cnt || !ctx_->param_.need_sort_) { - // 堆表快速写入 + // Fast heap table write write_ctx_.is_fast_heap_table_ = true; } else { - // 堆表排序 + // Heap table sorting write_ctx_.is_multiple_mode_ = true; } } else { @@ -845,7 +849,7 @@ int ObTableLoadStoreCtx::init_write_ctx_for_dag() schema_guard, table_schema))) { LOG_WARN("fail to get table schema", KR(ret), K(ctx_->param_)); } - // mysql模式下SQL执行计划会包含虚拟生成列 + // In MySQL mode, SQL execution plan includes virtual generated columns else if (OB_FAIL( table_schema->get_column_ids(col_descs, lib::is_oracle_mode() /*no_virtual*/))) { LOG_WARN("fail to get column ids", KR(ret)); @@ -864,19 +868,19 @@ int ObTableLoadStoreCtx::init_write_ctx_for_dag() ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected col schema is null", KR(ret), K(col_desc)); } - // SQL执行计划包含隐藏主键列、虚拟生成列以及其他普通列 + // SQL execution plan includes hidden primary key columns, virtual generated columns and other normal columns else if (OB_FAIL(write_ctx_.px_column_descs_.push_back(col_desc))) { LOG_WARN("fail to push back", KR(ret)); } else if (OB_FAIL(write_ctx_.px_column_accuracys_.push_back(col_schema->get_accuracy()))) { LOG_WARN("fail to push back", KR(ret)); } - // 存储层不写虚拟生成列 + // Storage layer does not write virtual generated columns else if (col_schema->is_virtual_generated_column()) { if (OB_FAIL(write_ctx_.px_column_project_idxs_.push_back(-1))) { LOG_WARN("fail to push back", KR(ret)); } } else { - // 旁路不接收隐藏主键列 + // Bypass does not accept hidden primary key columns if (ObColumnSchemaV2::is_hidden_pk_column_id(col_desc.col_id_)) { if (OB_FAIL(write_ctx_.px_column_project_idxs_.push_back(-1))) { LOG_WARN("fail to push back", KR(ret)); @@ -929,7 +933,7 @@ int ObTableLoadStoreCtx::init_dag() if (OB_FAIL(ObTableLoadPlan::create_plan(this, allocator_, dag_exec_ctx_.plan_))) { LOG_WARN("fail to create plan", KR(ret)); } - // 依赖write_ctx_里的信息 + // Depends on information in write_ctx_ else if (OB_FAIL(dag_exec_ctx_.plan_->generate())) { LOG_WARN("fail to generate plan", KR(ret)); } @@ -960,7 +964,7 @@ int ObTableLoadStoreCtx::generate_autoinc_params(AutoincParam &autoinc_param) ret = OB_TABLE_NOT_EXIST; LOG_WARN("table not exist", KR(ret), K(ctx_->param_.tenant_id_), K(ctx_->param_.table_id_)); } else { - //ddl对于auto increment是最后进行自增值同步,对于autoinc_param参数初始化得使用原表table id的table schema + //ddl for auto increment synchronizes the auto-increment value last, and the initialization of the autoinc_param parameter should use the table schema of the original table's table id ObColumnSchemaV2 *autoinc_column_schema = nullptr; uint64_t column_id = 0; for (ObTableSchema::const_column_iterator iter = table_schema->column_begin(); @@ -1022,7 +1026,7 @@ int ObTableLoadStoreCtx::init_sequence() target_table_schema))) { LOG_WARN("fail to get table schema", KR(ret), K(tenant_id), K(table_id)); } else { - //ddl对于identity是建表的时候进行自增值同步,对于sequence参数初始化得用隐藏表table id的table schema + //ddl for identity is to synchronize the auto-increment value when creating a table, for sequence parameter initialization must use the hidden table's table schema of table id for (ObTableSchema::const_column_iterator iter = target_table_schema->column_begin(); OB_SUCC(ret) && iter != target_table_schema->column_end(); ++iter) { ObColumnSchemaV2 *column_schema = *iter; @@ -1100,12 +1104,12 @@ int ObTableLoadStoreCtx::alloc_trans_ctx(const ObTableLoadTransId &trans_id, { int ret = OB_SUCCESS; trans_ctx = nullptr; - // 分配trans_ctx + // allocate trans_ctx if (OB_ISNULL(trans_ctx = ctx_->alloc_trans_ctx(trans_id))) { ret = OB_ALLOCATE_MEMORY_FAILED; LOG_WARN("fail to alloc trans ctx", KR(ret), K(trans_id)); } - // 把trans_ctx插入map + // Insert trans_ctx into map else if (OB_FAIL(trans_ctx_map_.set_refactored(trans_ctx->trans_id_, trans_ctx))) { LOG_WARN("fail to set trans ctx", KR(ret), K(trans_ctx->trans_id_)); } @@ -1124,11 +1128,11 @@ int ObTableLoadStoreCtx::alloc_trans(const ObTableLoadTransId &trans_id, int ret = OB_SUCCESS; trans = nullptr; ObTableLoadTransCtx *trans_ctx = nullptr; - // 分配trans_ctx + // allocate trans_ctx if (OB_FAIL(alloc_trans_ctx(trans_id, trans_ctx))) { LOG_WARN("fail to alloc trans ctx", KR(ret), K(trans_id)); } - // 构造trans + // construct trans else if (OB_ISNULL(trans = trans_allocator_.alloc(trans_ctx))) { ret = OB_ALLOCATE_MEMORY_FAILED; LOG_WARN("fail to alloc ObTableLoadStoreTrans", KR(ret)); @@ -1179,8 +1183,8 @@ int ObTableLoadStoreCtx::start_trans(const ObTableLoadTransId &trans_id, if (OB_FAIL(alloc_trans(trans_id, trans))) { LOG_WARN("fail to alloc trans", KR(ret)); } - // trans初始化会创建后台pipeline, pipeline通过持有trans的引用计数来保证channel的生命周期 - // 初始化失败场景, pipeline可能被创建出来, trans不能立即释放 + // Trans initialization creates background pipeline, pipeline ensures channel lifecycle through holding trans reference count + // In initialization failure scenario, pipeline may be created, trans cannot be released immediately else if (OB_FAIL(trans->init())) { LOG_WARN("fail to init trans", KR(ret), K(trans_id)); } else { @@ -1439,13 +1443,13 @@ int ObTableLoadStoreCtx::get_table_store_from_committed_trans_stores(ObDirectLoa table_store.clear(); table_store.set_table_data_desc(write_ctx_.table_data_desc_); if (write_ctx_.is_fast_heap_table_) { - // 堆表快速路径, 空数据, 随便填一个类型 + // Heap table fast path, empty data, just fill in a type table_store.set_external_table(); } else if (ctx_->param_.need_sort_) { - // 排序路径, 有主键表现在走pre_sort了 + // Sort path, if there is a primary key, it now goes through pre_sort table_store.set_external_table(); } else { - // 有主键表不排序路径 + // Table with primary key does not sort path table_store.set_multiple_sstable(); } obsys::ObRLockGuard guard(rwlock_); @@ -1467,10 +1471,10 @@ int ObTableLoadStoreCtx::get_table_store_for_store_write(ObDirectLoadTableStore int ret = OB_SUCCESS; table_store.clear(); if (write_ctx_.is_multiple_mode_) { - // 排序路径, 写出的是未排序数据 + // Sorting path, writes unsorted data table_store.set_external_table(); } else { - // 有主键表不排序路径 + // Primary key table non-sorting path table_store.set_multiple_sstable(); } obsys::ObRLockGuard guard(rwlock_); @@ -1513,7 +1517,7 @@ int ObTableLoadStoreCtx::start_merge() } else if (OB_FAIL(start_merge_op())) { LOG_WARN("fail to start merge op", KR(ret)); } else { - // 清空trans store, 以便在合并过程中释放磁盘空间 + // Clear trans store, in order to release disk space during the merge process clear_committed_trans_stores(); } return ret; @@ -1531,7 +1535,7 @@ int ObTableLoadStoreCtx::handle_pre_sort_success() } else if (OB_FAIL(start_merge_op())) { LOG_WARN("fail to start merge op", KR(ret)); } else { - // 清空trans store, 释放内存, 里面也没啥东西 + // Clear trans store, release memory, there's nothing much in it clear_committed_trans_stores(); } return ret; diff --git a/src/observer/table_load/ob_table_load_store_ctx.h b/src/observer/table_load/ob_table_load_store_ctx.h index 6a596387e..d7262b85a 100644 --- a/src/observer/table_load/ob_table_load_store_ctx.h +++ b/src/observer/table_load/ob_table_load_store_ctx.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -103,10 +107,10 @@ struct ObTableLoadStoreWriteCtx bool enable_pre_sort_; ObTableLoadPreSorter *pre_sorter_; int64_t px_writer_cnt_; - // px写入的列(包含隐藏主键列) + // px written columns (including hidden primary key column) ObArray px_column_descs_; ObArray px_column_accuracys_; - // px写入的列到写入旁路导入列的映射 + // Mapping from px write columns to bypass import columns ObArray px_column_project_idxs_; ObTabletID single_tablet_id_; ObIVector *single_tablet_id_vector_; @@ -246,8 +250,8 @@ class ObTableLoadStoreCtx storage::ObDirectLoadTableDataDesc basic_table_data_desc_; int64_t merge_count_per_round_; int64_t max_mem_chunk_count_; - int64_t mem_chunk_size_; // 在资源控制模式下, 动态获取 - int64_t heap_table_mem_chunk_size_; // 在资源控制模式下, 动态获取 + int64_t mem_chunk_size_; // Dynamically obtained in resource control mode + int64_t heap_table_mem_chunk_size_; // Dynamically obtained in resource control mode // dag ObTableLoadDagExecCtx dag_exec_ctx_; bool enable_dag_; @@ -280,7 +284,7 @@ class ObTableLoadStoreCtx TransCtxMap; typedef common::ObLinkHashMap SegmentCtxMap; private: - ObTableLoadObjectAllocator trans_allocator_; // 多线程安全 + ObTableLoadObjectAllocator trans_allocator_; // thread-safe lib::ObMutex op_lock_; mutable obsys::ObRWLock status_lock_; table::ObTableLoadStatusType status_; diff --git a/src/observer/table_load/ob_table_load_store_table_ctx.cpp b/src/observer/table_load/ob_table_load_store_table_ctx.cpp index f450da8ac..2826c3e96 100644 --- a/src/observer/table_load/ob_table_load_store_table_ctx.cpp +++ b/src/observer/table_load/ob_table_load_store_table_ctx.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -415,14 +419,14 @@ int ObTableLoadStoreDataTableCtx::init_insert_table_ctx(const ObDirectLoadTransP LOG_WARN("unexpected insert table ctx not null", KR(ret)); } else { ObDirectLoadInsertTableParam insert_table_param; - // 目标表table_id, 目前只用于填充统计信息收集结果 + // target table table_id, currently only used for filling statistical information collection results insert_table_param.table_id_ = store_ctx_->ctx_->ddl_param_.dest_table_id_; insert_table_param.schema_version_ = store_ctx_->ctx_->ddl_param_.schema_version_; insert_table_param.snapshot_version_ = store_ctx_->ctx_->ddl_param_.snapshot_version_; insert_table_param.ddl_task_id_ = store_ctx_->ctx_->ddl_param_.task_id_; insert_table_param.data_version_ = store_ctx_->ctx_->ddl_param_.data_version_; insert_table_param.parallel_ = store_ctx_->thread_cnt_; - // 全量在快速堆表路径需要为存量数据预留parallel + // Full scan on the fast heap table path needs to reserve parallel for existing data insert_table_param.reserved_parallel_ = store_ctx_->write_ctx_.is_fast_heap_table_ ? store_ctx_->thread_cnt_ : 0; insert_table_param.rowkey_column_count_ = schema_->rowkey_column_count_; @@ -761,14 +765,14 @@ int ObTableLoadStoreLobTableCtx::init_insert_table_ctx(const ObDirectLoadTransPa LOG_WARN("unexpected insert table ctx not null", KR(ret)); } else { ObDirectLoadInsertTableParam insert_table_param; - // TODO 目标表table_id, lob依附于数据表并不创建真正的ddl对象, 先填数据表的table_id + // TODO target table table_id, lob is attached to the data table and does not create a real ddl object, fill in the table_id of the data table first insert_table_param.table_id_ = store_ctx_->ctx_->ddl_param_.dest_table_id_; insert_table_param.schema_version_ = store_ctx_->ctx_->ddl_param_.schema_version_; insert_table_param.snapshot_version_ = store_ctx_->ctx_->ddl_param_.snapshot_version_; insert_table_param.ddl_task_id_ = store_ctx_->ctx_->ddl_param_.task_id_; insert_table_param.data_version_ = store_ctx_->ctx_->ddl_param_.data_version_; insert_table_param.parallel_ = store_ctx_->thread_cnt_; - // 增量需要为del_lob预留parallel + // Increment needs to reserve parallel for del_lob insert_table_param.reserved_parallel_ = ObDirectLoadMethod::is_incremental(store_ctx_->ctx_->param_.method_) ? store_ctx_->thread_cnt_ : 0; @@ -1078,7 +1082,7 @@ int ObTableLoadStoreIndexTableCtx::init_insert_table_ctx(const ObDirectLoadTrans LOG_WARN("unexpected insert table ctx not null", KR(ret)); } else { ObDirectLoadInsertTableParam insert_table_param; - // TODO 目标表table_id, 索引只在增量场景, 目标表和原表是同一个 + // TODO target table table_id, index is only in incremental scenarios, the target table and source table are the same insert_table_param.table_id_ = table_id_; insert_table_param.schema_version_ = store_ctx_->ctx_->ddl_param_.schema_version_; insert_table_param.snapshot_version_ = store_ctx_->ctx_->ddl_param_.snapshot_version_; diff --git a/src/observer/table_load/ob_table_load_store_table_ctx.h b/src/observer/table_load/ob_table_load_store_table_ctx.h index 4f0b08a0c..abc332fd8 100644 --- a/src/observer/table_load/ob_table_load_store_table_ctx.h +++ b/src/observer/table_load/ob_table_load_store_table_ctx.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_store_trans.cpp b/src/observer/table_load/ob_table_load_store_trans.cpp index e6320db60..43f04d416 100644 --- a/src/observer/table_load/ob_table_load_store_trans.cpp +++ b/src/observer/table_load/ob_table_load_store_trans.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_store_trans.h b/src/observer/table_load/ob_table_load_store_trans.h index c4b26be9a..59f66c075 100644 --- a/src/observer/table_load/ob_table_load_store_trans.h +++ b/src/observer/table_load/ob_table_load_store_trans.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -68,7 +72,7 @@ struct ObTableLoadStoreTrans public: int get_store_writer(ObTableLoadTransStoreWriter *&store_writer) const; void put_store_writer(ObTableLoadTransStoreWriter *store_writer); - // 取出store + // retrieve store int output_store(ObTableLoadTransStore *&trans_store); private: int handle_write_done(); diff --git a/src/observer/table_load/ob_table_load_store_trans_px_writer.cpp b/src/observer/table_load/ob_table_load_store_trans_px_writer.cpp index 1362f0fe7..adb076d8d 100644 --- a/src/observer/table_load/ob_table_load_store_trans_px_writer.cpp +++ b/src/observer/table_load/ob_table_load_store_trans_px_writer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -118,7 +122,7 @@ int ObTableLoadStoreTransPXWriter::init(ObTableLoadStoreCtx *store_ctx, single_tablet_id_ = store_ctx_->write_ctx_.single_tablet_id_; single_tablet_id_vector_ = store_ctx_->write_ctx_.single_tablet_id_vector_; } - // dag路径统一通过store_writer写 + // DAG path uniformly writes through store_writer if (!store_ctx_->enable_dag_ && store_ctx_->write_ctx_.enable_pre_sort_) { if (OB_ISNULL(pre_sort_writer_ = OB_NEWx(ObTableLoadPreSortWriter, &allocator_))) { ret = OB_ALLOCATE_MEMORY_FAILED; @@ -145,8 +149,8 @@ int ObTableLoadStoreTransPXWriter::prepare_write(const ObIArray &colum ret = OB_NOT_INIT; LOG_WARN("ObTableLoadStoreTransPXWriter not init", KR(ret), KP(this)); } - // 不要在这里检查column_ids.count()与column_count_的关系 - // 旁路导入与DDL并发的场景, 两个值就是可能不一样的 + // Do not check the relationship between column_ids.count() and column_count_ here + // Bypass import and DDL concurrent scenario, the two values may be different else if (OB_UNLIKELY(column_ids.empty())) { ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid args", KR(ret), K(column_ids)); @@ -292,18 +296,18 @@ int ObTableLoadStoreTransPXWriter::write_vector(ObIVector *tablet_id_vector, const bool all_rows_active = (brs.all_rows_active_ || 0 == brs.skip_->accumulate_bit_cnt(brs.size_)); if (all_rows_active) { - // 单分区场景, 检查分区是否一致 + // Single partition scenario, check if the partition is consistent if (is_single_part_ && OB_UNLIKELY(!ObDirectLoadVectorUtils::check_is_same_tablet_id( single_tablet_id_, tablet_id_vector, brs.size_))) { ret = OB_TABLET_NOT_EXIST; LOG_WARN("unexpected tablet id not same", KR(ret), K(single_tablet_id_), KPC(tablet_id_vector)); } - // buffer不为空则先刷下去 + // if buffer is not empty, flush it first else if (!batch_ctx_->batch_rows_.empty() && OB_FAIL(flush_buffer())) { LOG_WARN("fail to flush buffer", KR(ret)); } - // 浅拷贝数据直接刷下去 + // Shallow copy data and flush directly else if (!is_single_part_ && OB_FAIL(batch_ctx_->tablet_id_vector_->shallow_copy(tablet_id_vector, brs.size_))) { LOG_WARN("fail to shallow copy", KR(ret)); @@ -318,7 +322,7 @@ int ObTableLoadStoreTransPXWriter::write_vector(ObIVector *tablet_id_vector, uint16_t *selector = batch_ctx_->selector_; int64_t size = 0; make_selector(brs, batch_ctx_->selector_, size); - // 单分区场景, 检查分区是否一致 + // Single partition scenario, check if the partitions are consistent if (is_single_part_ && OB_UNLIKELY(!ObDirectLoadVectorUtils::check_is_same_tablet_id( single_tablet_id_, tablet_id_vector, selector, size))) { ret = OB_TABLET_NOT_EXIST; @@ -377,18 +381,18 @@ int ObTableLoadStoreTransPXWriter::write_batch(const ObDatumVector &tablet_id_da const bool all_rows_active = brs.all_rows_active_ || 0 == brs.skip_->accumulate_bit_cnt(brs.size_); if (all_rows_active) { - // 单分区场景, 检查分区是否一致 + // Single partition scenario, check if the partition is consistent if (is_single_part_ && OB_UNLIKELY(!ObDirectLoadVectorUtils::check_is_same_tablet_id( single_tablet_id_, tablet_id_datum_vector, brs.size_))) { ret = OB_TABLET_NOT_EXIST; LOG_WARN("unexpected tablet id not same", KR(ret), K(single_tablet_id_), K(tablet_id_datum_vector)); } - // buffer不为空则先刷下去 + // if buffer is not empty, flush it first else if (!batch_ctx_->batch_rows_.empty() && OB_FAIL(flush_buffer())) { LOG_WARN("fail to flush buffer", KR(ret)); } - // 浅拷贝数据直接刷下去 + // Shallow copy data and flush directly else if (!is_single_part_ && OB_FAIL(batch_ctx_->tablet_id_vector_->shallow_copy(tablet_id_datum_vector, brs.size_))) { LOG_WARN("fail to shallow copy", KR(ret)); @@ -403,7 +407,7 @@ int ObTableLoadStoreTransPXWriter::write_batch(const ObDatumVector &tablet_id_da uint16_t *selector = batch_ctx_->selector_; int64_t size = 0; make_selector(brs, batch_ctx_->selector_, size); - // 单分区场景, 检查分区是否一致 + // Single partition scenario, check if the partitions are consistent if (is_single_part_ && OB_UNLIKELY(!ObDirectLoadVectorUtils::check_is_same_tablet_id( single_tablet_id_, tablet_id_datum_vector, selector, size))) { ret = OB_TABLET_NOT_EXIST; @@ -529,11 +533,11 @@ int ObTableLoadStoreTransPXWriter::flush_buffer() } else if (OB_FAIL(pre_sort_writer_->px_write(tablet_id_vector, batch_rows))) { LOG_WARN("fail to px write", KR(ret)); } - } else if (is_single_part_) { // 单分区场景 + } else if (is_single_part_) { // single partition scenario if (OB_FAIL(writer_->px_write(single_tablet_id_, batch_rows))) { LOG_WARN("fail to px write", KR(ret)); } - } else { // 多分区场景 + } else { // multi-partition scenario const ObTableLoadStoreWriteCtx::TabletIdxMap &tablet_idx_map = store_ctx_->write_ctx_.tablet_idx_map_; const int64_t size = batch_rows.size(); @@ -541,7 +545,7 @@ int ObTableLoadStoreTransPXWriter::flush_buffer() static_cast(batch_ctx_->tablet_id_vector_->get_vector())->get_data()); const bool all_tablet_id_is_same = ObDirectLoadVectorUtils::check_all_tablet_id_is_same(tablet_ids, size); - if (all_tablet_id_is_same) { // 数据属于同一个分区 + if (all_tablet_id_is_same) { // Data belongs to the same partition const uint64_t tablet_id = tablet_ids[0]; const int64_t *tablet_idx = tablet_idx_map.get(tablet_id); if (OB_ISNULL(tablet_idx)) { @@ -550,7 +554,7 @@ int ObTableLoadStoreTransPXWriter::flush_buffer() } else if (OB_FAIL(writer_->px_write(ObTabletID(tablet_id), batch_rows))) { LOG_WARN("fail to px write", KR(ret)); } - } else { // 数据属于多个分区 + } else { // Data belongs to multiple partitions const int64_t tablet_cnt = tablet_idx_map.size(); uint16_t *selector = batch_ctx_->selector_; uint16_t *tablet_offsets = batch_ctx_->tablet_offsets_; diff --git a/src/observer/table_load/ob_table_load_store_trans_px_writer.h b/src/observer/table_load/ob_table_load_store_trans_px_writer.h index 91e4c16ea..b5bc086a1 100644 --- a/src/observer/table_load/ob_table_load_store_trans_px_writer.h +++ b/src/observer/table_load/ob_table_load_store_trans_px_writer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_struct.cpp b/src/observer/table_load/ob_table_load_struct.cpp index 893c00aa2..e95bac9a0 100644 --- a/src/observer/table_load/ob_table_load_struct.cpp +++ b/src/observer/table_load/ob_table_load_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_struct.h b/src/observer/table_load/ob_table_load_struct.h index 046a1cccd..1f52491f8 100644 --- a/src/observer/table_load/ob_table_load_struct.h +++ b/src/observer/table_load/ob_table_load_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -85,10 +89,10 @@ struct ObTableLoadUniqueKey }; enum class ObTableLoadExeMode { - FAST_HEAP_TABLE = 0, //快速堆表 - GENERAL_TABLE_COMPACT = 1, // 非堆表不排序 - MULTIPLE_HEAP_TABLE_COMPACT = 2, //堆表排序 - MEM_COMPACT = 3, //非堆表排序 + FAST_HEAP_TABLE = 0, //fast heap table + GENERAL_TABLE_COMPACT = 1, // Non-heap table is not sorted + MULTIPLE_HEAP_TABLE_COMPACT = 2, //heap table sorting + MEM_COMPACT = 3, //non-heap table sorting MAX_TYPE }; @@ -137,7 +141,7 @@ struct ObTableLoadParam int ret = common::OB_SUCCESS; if (need_sort_) { if (session_count_ < 2) { - session_count_ = 2; //排序至少要两个线程才能工作 + session_count_ = 2; // sorting requires at least two threads to work } } return ret; @@ -200,7 +204,7 @@ struct ObTableLoadParam uint64_t max_error_row_count_; uint64_t sql_mode_; // unused int32_t column_count_; - bool need_sort_; // 表示主表是否要排序 + bool need_sort_; // indicates whether the main table needs to be sorted bool px_mode_; bool online_opt_stat_gather_; sql::ObLoadDupActionType dup_action_; @@ -213,7 +217,7 @@ struct ObTableLoadParam ObCompressorType compressor_type_; double online_sample_percent_; storage::ObDirectLoadLevel::Type load_level_; - bool task_need_sort_; // 表示导入任务是否会走到排序流程 + bool task_need_sort_; // indicates whether the import task will go through the sorting process }; struct ObTableLoadDDLParam diff --git a/src/observer/table_load/ob_table_load_table_ctx.cpp b/src/observer/table_load/ob_table_load_table_ctx.cpp index 84b15d782..30703a858 100644 --- a/src/observer/table_load/ob_table_load_table_ctx.cpp +++ b/src/observer/table_load/ob_table_load_table_ctx.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -177,7 +181,7 @@ void ObTableLoadTableCtx::unregister_job_stat() ret = OB_ERR_UNEXPECTED; LOG_ERROR("unexpected null job stat", KR(ret), K_(gid)); } else { - // 可能还有其他地方在引用这个对象, 等待释放引用 + // There may still be other places referencing this object, wait for the references to be released int64_t log_print_cnt = 0; int64_t ref_cnt = 0; while ((ref_cnt = job_stat->get_ref_cnt()) > 0) { diff --git a/src/observer/table_load/ob_table_load_table_ctx.h b/src/observer/table_load/ob_table_load_table_ctx.h index 986e8e7fc..2c7f43f9f 100644 --- a/src/observer/table_load/ob_table_load_table_ctx.h +++ b/src/observer/table_load/ob_table_load_table_ctx.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -88,18 +92,18 @@ class ObTableLoadTableCtx : public common::ObDLinkBase ObTableLoadParam param_; ObTableLoadDDLParam ddl_param_; ObTableLoadSchema schema_; // origin table load schema - ObTableLoadCoordinatorCtx *coordinator_ctx_; // 只在控制节点构造 - ObTableLoadStoreCtx *store_ctx_; // 只在数据节点构造 + ObTableLoadCoordinatorCtx *coordinator_ctx_; // Only constructed on the control node + ObTableLoadStoreCtx *store_ctx_; // Only constructed on data nodes sql::ObLoadDataGID gid_; sql::ObLoadDataStat *job_stat_; sql::ObSQLSessionInfo *session_info_; sql::ObExecContext *exec_ctx_; sql::ObFreeSessionCtx free_session_ctx_; private: - // 只在初始化的时候使用, 线程不安全 + // Only used during initialization, thread unsafe common::ObArenaAllocator allocator_; - ObTableLoadObjectAllocator task_allocator_; // 多线程安全 - ObTableLoadObjectAllocator trans_ctx_allocator_; // 多线程安全 + ObTableLoadObjectAllocator task_allocator_; // thread-safe + ObTableLoadObjectAllocator trans_ctx_allocator_; // thread-safe int64_t ref_count_ CACHE_ALIGNED; volatile bool is_in_map_; bool is_assigned_resource_; diff --git a/src/observer/table_load/ob_table_load_task.cpp b/src/observer/table_load/ob_table_load_task.cpp index 2ca286b24..a1ee924c4 100644 --- a/src/observer/table_load/ob_table_load_task.cpp +++ b/src/observer/table_load/ob_table_load_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_task.h b/src/observer/table_load/ob_table_load_task.h index a0744edf5..69541722f 100644 --- a/src/observer/table_load/ob_table_load_task.h +++ b/src/observer/table_load/ob_table_load_task.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_task_scheduler.cpp b/src/observer/table_load/ob_table_load_task_scheduler.cpp index fe42d0acb..f5257e3d0 100644 --- a/src/observer/table_load/ob_table_load_task_scheduler.cpp +++ b/src/observer/table_load/ob_table_load_task_scheduler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -41,7 +45,7 @@ void ObTableLoadTaskThreadPoolScheduler::MyThreadPool::run1() OB_ASSERT(OB_NOT_NULL(scheduler_)); const int64_t thread_count = get_thread_count(); // LOG_INFO("table load task thread start", KP(this), "pid", get_tid_cache(), "thread_idx", get_thread_idx()); - // 启动成功的线程数+1 + // The number of successfully started threads + 1 if (thread_count == ATOMIC_AAF(&running_thread_count_, 1)) { scheduler_->before_running(); ObThreadCondGuard guard(pool_cond_); @@ -52,7 +56,7 @@ void ObTableLoadTaskThreadPoolScheduler::MyThreadPool::run1() (void) pool_cond_.wait(DEFAULT_TIMEOUT_MS); } while (!has_set_stop()) { - // 等待所有线程起来 + // Wait for all threads to start if (!scheduler_->is_running()) { usleep(100); } else { @@ -60,7 +64,7 @@ void ObTableLoadTaskThreadPoolScheduler::MyThreadPool::run1() break; } } - // 启动成功的线程数-1 + // The number of successfully started threads minus 1 if (0 == ATOMIC_AAF(&running_thread_count_, -1)) { scheduler_->after_running(); } @@ -186,12 +190,12 @@ void ObTableLoadTaskThreadPoolScheduler::stop() if (state_ == STATE_ZERO) { state_ = STATE_STOPPED_NO_WAIT; } else if (STATE_STARTING == state_) { - ret = OB_ERR_UNEXPECTED; //因为加锁了,这种情况不能出现 + ret = OB_ERR_UNEXPECTED; // Because locking was performed, this situation should not occur LOG_WARN("state cann't be starting here", KR(ret)); } else if (STATE_RUNNING == state_) { thread_pool_.stop(); state_ = STATE_STOPPING; - // 唤醒所有线程 + // Wake up all threads for (int64_t i = 0; i < thread_count_; ++i) { WorkerContext &worker_ctx = worker_ctx_array_[i]; ObThreadCondGuard guard(worker_ctx.cond_); @@ -200,8 +204,7 @@ void ObTableLoadTaskThreadPoolScheduler::stop() } } } - -//调用wait前,必须保证之前调用过stop +//Before calling wait, it must be ensured that stop has been called previously void ObTableLoadTaskThreadPoolScheduler::wait() { int ret = OB_SUCCESS; @@ -278,11 +281,9 @@ void ObTableLoadTaskThreadPoolScheduler::run(uint64_t thread_idx) } } } - - // 为了保证在abort场景, clean_up_task能在工作线程执行 + // To ensure that clean_up_task can be executed on the worker thread in an abort scenario execute_worker_tasks(worker_ctx); - - // 线程非正常结束, 设置全局状态, 阻止其他线程继续执行 + // Thread abnormal termination, set global status, prevent other threads from continuing execution if (STATE_RUNNING == state_) { state_ = STATE_STOPPING; } @@ -316,7 +317,7 @@ int ObTableLoadTaskThreadPoolScheduler::add_task(int64_t thread_idx, ObTableLoad LOG_WARN("fail to push task into queue", KR(ret), KPC(task)); } } else { - // 唤醒线程 + // Wake up thread ObThreadCondGuard guard(worker_ctx.cond_); // LOG_WARN("table load add task end", KP(this), K(thread_idx), "size", worker_ctx.task_queue_.size(), "need_signal", worker_ctx.need_signal_); if (worker_ctx.need_signal_) { @@ -338,7 +339,7 @@ int ObTableLoadTaskThreadPoolScheduler::execute_worker_tasks(WorkerContext &work if (OB_FAIL(worker_ctx.task_queue_.pop(tmp))) { LOG_WARN("fail to pop queue", KR(ret), K(worker_ctx.worker_id_)); } else { - // 任务的运行结果不影响工作线程的运行 + // The task's execution result does not affect the operation of the worker thread ObTableLoadTask *task = (ObTableLoadTask *)tmp; ObTraceIdGuard trace_id_guard(task->get_trace_id()); int task_ret = task->do_work(); @@ -366,7 +367,7 @@ void ObTableLoadTaskThreadPoolScheduler::clear_all_task() if (OB_FAIL(worker_ctx.task_queue_.pop(tmp))) { LOG_WARN("fail to pop queue", KR(ret), K(i)); } else { - // 触发task回调 + // trigger task callback ObTableLoadTask *task = (ObTableLoadTask *)tmp; ObTraceIdGuard trace_id_guard(task->get_trace_id()); task->callback(OB_CANCELED); diff --git a/src/observer/table_load/ob_table_load_task_scheduler.h b/src/observer/table_load/ob_table_load_task_scheduler.h index cb5760cf2..910379688 100644 --- a/src/observer/table_load/ob_table_load_task_scheduler.h +++ b/src/observer/table_load/ob_table_load_task_scheduler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -45,7 +49,7 @@ class ObITableLoadTaskScheduler class ObTableLoadTaskThreadPoolScheduler final : public ObITableLoadTaskScheduler { static const int64_t DEFAULT_TIMEOUT_US = 10LL * 1000 * 1000; // 10s - // 运行状态 + // Running status static const int STATE_ZERO = 0; static const int STATE_STARTING = 1; static const int STATE_RUNNING = 2; @@ -76,9 +80,9 @@ class ObTableLoadTaskThreadPoolScheduler final : public ObITableLoadTaskSchedule { return state_ == STATE_RUNNING; } - // 启动成功才会调用 + // Will be called only if startup is successful void before_running(); - // 启动失败也可能调用 + // Startup failure may also call void after_running(); void clear_all_task(); private: @@ -101,7 +105,7 @@ class ObTableLoadTaskThreadPoolScheduler final : public ObITableLoadTaskSchedule int64_t worker_id_; common::ObThreadCond cond_; bool need_signal_; - common::LightyQueue task_queue_; // 多线程安全 + common::LightyQueue task_queue_; // thread-safe }; int execute_worker_tasks(WorkerContext &worker_ctx); private: diff --git a/src/observer/table_load/ob_table_load_time_convert.cpp b/src/observer/table_load/ob_table_load_time_convert.cpp index 466877a85..132ac49aa 100644 --- a/src/observer/table_load/ob_table_load_time_convert.cpp +++ b/src/observer/table_load/ob_table_load_time_convert.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -103,4 +107,4 @@ int ObTableLoadTimeConverter::str_to_ob_time(const ObString &str, const ObTimeCo } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/ob_table_load_time_convert.h b/src/observer/table_load/ob_table_load_time_convert.h index 022558f25..991bd0bf7 100644 --- a/src/observer/table_load/ob_table_load_time_convert.h +++ b/src/observer/table_load/ob_table_load_time_convert.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -44,4 +48,4 @@ class ObTableLoadTimeConverter }; } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/ob_table_load_trans_bucket_writer.cpp b/src/observer/table_load/ob_table_load_trans_bucket_writer.cpp index 00138bf4f..60047d2dc 100644 --- a/src/observer/table_load/ob_table_load_trans_bucket_writer.cpp +++ b/src/observer/table_load/ob_table_load_trans_bucket_writer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -213,7 +217,7 @@ int ObTableLoadTransBucketWriter::handle_partition_with_autoinc_identity( ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected obj index", KR(ret), K(index_and_type), K(column_count_)); } else if (column_schema->is_autoincrement()) { - // mysql模式还不支持快速删列, 先加个拦截 + // mysql mode does not yet support quick column deletion, add an interception first if (OB_UNLIKELY(column_schema->is_unused())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected unused identity column", KR(ret), KPC(column_schema)); @@ -235,12 +239,12 @@ int ObTableLoadTransBucketWriter::handle_partition_with_autoinc_identity( } } } else if (column_schema->is_identity_column()) { - // identity列在快速删除的时候会抹去identity属性 + // the identity column will erase the identity attribute during fast delete if (OB_UNLIKELY(column_schema->is_unused())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected unused identity column", KR(ret), KPC(column_schema)); } - // 生成的seq_value是number, 可能需要转换成decimal int + // The generated seq_value is a number, may need to convert to decimal int else if (OB_FAIL(handle_identity_column(column_schema, obj, tmp_obj, autoinc_allocator))) { LOG_WARN("fail to handle identity column", KR(ret), K(obj)); } else if (OB_FAIL(ObTableLoadObjCaster::cast_obj(cast_obj_ctx, @@ -289,9 +293,9 @@ int ObTableLoadTransBucketWriter::handle_identity_column(const ObColumnSchemaV2 ObArenaAllocator &cast_allocator) { int ret = OB_SUCCESS; - // 1. generated always as identity : 不能指定此列导入 - // 2. generated by default as identity : 不指定时自动生成, 不能导入null - // 3. generated by default on null as identity : 不指定或者指定null会自动生成 + // 1. generated always as identity : cannot specify this column for import + // 2. generated by default as identity : auto-generated if not specified, cannot import null + // 3. generated by default on null as identity : unspecified or specified as null will be generated by default if (OB_UNLIKELY(column_schema->is_always_identity_column() && !obj.is_nop_value())) { ret = OB_ERR_INSERT_INTO_GENERATED_ALWAYS_IDENTITY_COLUMN; LOG_USER_ERROR(OB_ERR_INSERT_INTO_GENERATED_ALWAYS_IDENTITY_COLUMN); @@ -299,8 +303,8 @@ int ObTableLoadTransBucketWriter::handle_identity_column(const ObColumnSchemaV2 ret = OB_BAD_NULL_ERROR; LOG_WARN("default identity column cannot insert null", KR(ret)); } else { - // 不论用户有没有指定自增列的值, 都取一个seq_value, 行为与insert into保持一致 - // 取seq_value的性能受表的参数cache影响 + // Regardless of whether the user has specified a value for the auto-increment column, take a seq_value, behavior consistent with insert into + // The performance of retrieving seq_value is affected by the table's cache parameter ObSequenceValue seq_value; if (OB_FAIL(ObSequenceCache::get_instance().nextval(coordinator_ctx_->sequence_schema_, cast_allocator, diff --git a/src/observer/table_load/ob_table_load_trans_bucket_writer.h b/src/observer/table_load/ob_table_load_trans_bucket_writer.h index df269bf77..cd3e8c38b 100644 --- a/src/observer/table_load/ob_table_load_trans_bucket_writer.h +++ b/src/observer/table_load/ob_table_load_trans_bucket_writer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -34,7 +38,7 @@ class ObTableLoadTransBucketWriter ObTableLoadTransBucketWriter(ObTableLoadTransCtx *trans_ctx); ~ObTableLoadTransBucketWriter(); int init(); - // 只在对应工作线程中调用, 串行执行 + // Only called in the corresponding worker thread, executed serially int write(int32_t session_id, table::ObTableLoadObjRowArray &obj_rows); int flush(int32_t session_id); public: @@ -58,10 +62,10 @@ class ObTableLoadTransBucketWriter const common::ObObj &obj, common::ObObj &out_obj, common::ObArenaAllocator &cast_allocator); - // 非分区表 + // Non-partitioned table int write_for_non_partitioned(SessionContext &session_ctx, const table::ObTableLoadObjRowArray &obj_rows); - // 分区表 + // partition table int write_for_partitioned(SessionContext &session_ctx, const table::ObTableLoadObjRowArray &obj_rows); int get_load_bucket(SessionContext &session_ctx, const table::ObTableLoadPartitionId &partition_id, @@ -82,7 +86,7 @@ class ObTableLoadTransBucketWriter ~SessionContext(); void reset(); int32_t session_id_; - // 以下参数只在对应工作线程中访问 + // The following parameters are only accessed in the corresponding worker thread common::ObArenaAllocator allocator_; // for non-partitioned table table::ObTableLoadPartitionId partition_id_; @@ -90,7 +94,7 @@ class ObTableLoadTransBucketWriter // for partitioned table common::hash::ObHashMap load_bucket_map_; common::ObArray load_bucket_array_; - // 以下参数加锁访问 + // The following parameters are accessed with a lock lib::ObMutex mutex_; uint64_t last_receive_sequence_no_; }; diff --git a/src/observer/table_load/ob_table_load_trans_ctx.cpp b/src/observer/table_load/ob_table_load_trans_ctx.cpp index e8e04263f..978c2d268 100644 --- a/src/observer/table_load/ob_table_load_trans_ctx.cpp +++ b/src/observer/table_load/ob_table_load_trans_ctx.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -49,7 +53,7 @@ int ObTableLoadTransCtx::advance_trans_status(ObTableLoadTransStatusType trans_s ret = OB_CANCELED; LOG_WARN("trans is abort", KR(ret)); } - // 正常运行阶段, 状态是一步步推进的 + // Normal operation phase, the state progresses step by step else if (OB_UNLIKELY(static_cast(trans_status) != static_cast(trans_status_) + 1)) { ret = OB_STATE_NOT_MATCH; diff --git a/src/observer/table_load/ob_table_load_trans_ctx.h b/src/observer/table_load/ob_table_load_trans_ctx.h index 839a09d50..0707028de 100644 --- a/src/observer/table_load/ob_table_load_trans_ctx.h +++ b/src/observer/table_load/ob_table_load_trans_ctx.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/ob_table_load_trans_store.cpp b/src/observer/table_load/ob_table_load_trans_store.cpp index d524fb5d9..3447529b9 100644 --- a/src/observer/table_load/ob_table_load_trans_store.cpp +++ b/src/observer/table_load/ob_table_load_trans_store.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -228,7 +232,7 @@ int ObTableLoadTransStoreWriter::StoreWriter::append_batch(const ObTabletID &tab ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid args", KR(ret), K(tablet_id), K(batch_rows)); } else { - // TODO(suzhi.yt) 这一期只有px_write会走append_batch, 这里先写死seq_no + // TODO(suzhi.yt) This period only px_write will go through append_batch, here we hardcode seq_no datum_row_.seq_no_ = 0; ObIDirectLoadPartitionTableBuilder *table_builder = nullptr; if (OB_FAIL(get_table_builder(tablet_id, table_builder))) { @@ -263,7 +267,7 @@ int ObTableLoadTransStoreWriter::StoreWriter::append_selective( ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid args", KR(ret), K(tablet_id), K(batch_rows), KP(selector), K(size)); } else { - // TODO(suzhi.yt) 这一期只有px_write会走append_selective, 这里先写死seq_no + // TODO(suzhi.yt) This period only px_write will go through append_selective, here we hardcode seq_no datum_row_.seq_no_ = 0; ObIDirectLoadPartitionTableBuilder *table_builder = nullptr; if (OB_FAIL(get_table_builder(tablet_id, table_builder))) { @@ -316,7 +320,7 @@ int ObTableLoadTransStoreWriter::StoreWriter::new_table_builder( int ret = OB_SUCCESS; table_builder = nullptr; if (store_ctx_->write_ctx_.is_multiple_mode_) { - // 排序路径 + // sort path ObDirectLoadExternalMultiPartitionTableBuildParam param; param.table_data_desc_ = store_ctx_->write_ctx_.table_data_desc_; param.file_mgr_ = store_ctx_->tmp_file_mgr_; @@ -331,7 +335,7 @@ int ObTableLoadTransStoreWriter::StoreWriter::new_table_builder( LOG_WARN("fail to init external multi partition table builder", KR(ret)); } } else { - // 有主键表不排序路径 + // Table with primary key does not sort path abort_unless(!store_ctx_->data_store_table_ctx_->schema_->is_table_without_pk_); ObDirectLoadMultipleSSTableBuildParam param; param.tablet_id_ = tablet_id; @@ -1025,7 +1029,7 @@ int ObTableLoadTransStoreWriter::cast_column( cast_ctx.exec_ctx_ = trans_ctx_->ctx_->exec_ctx_; ObObj out_obj; if (column_schema->is_autoincrement()) { - // mysql模式还不支持快速删列, 先加个拦截 + // mysql mode does not yet support quick column deletion, add an interception first if (OB_UNLIKELY(column_schema->is_unused())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected unused identity column", KR(ret), KPC(column_schema)); @@ -1043,15 +1047,15 @@ int ObTableLoadTransStoreWriter::cast_column( } } } else if (column_schema->is_identity_column()) { - // identity列在快速删除的时候会抹去identity属性 + // The identity column will erase the identity attribute during fast delete if (OB_UNLIKELY(column_schema->is_unused())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected unused identity column", KR(ret), KPC(column_schema)); } else if (column_schema->is_tbl_part_key_column()) { - // 自增列是分区键, 在分区计算的时候就已经确定值了 + // Auto-increment column is the partition key, the value is determined during partition calculation out_obj = obj; } else { - // 生成的seq_value是number, 可能需要转换成decimal int + // The generated seq_value is a number, may need to convert to decimal int ObObj tmp_obj; if (OB_FAIL(handle_identity_column(column_schema, obj, tmp_obj, cast_allocator))) { LOG_WARN("fail to handle identity column", KR(ret), K(obj)); @@ -1065,7 +1069,7 @@ int ObTableLoadTransStoreWriter::cast_column( } } } else { - // 普通列 + // ordinary column if (OB_FAIL(ObTableLoadObjCaster::cast_obj(cast_obj_ctx, column_schema, obj, out_obj))) { LOG_WARN("fail to cast obj and check", KR(ret), K(obj)); } else if (OB_FAIL(datum.from_obj_enhance(out_obj))) { @@ -1106,9 +1110,9 @@ int ObTableLoadTransStoreWriter::handle_identity_column(const ObColumnSchemaV2 * ObArenaAllocator &cast_allocator) { int ret = OB_SUCCESS; - // 1. generated always as identity : 不能指定此列导入 - // 2. generated by default as identity : 不指定时自动生成, 不能导入null - // 3. generated by default on null as identity : 不指定或者指定null会自动生成 + // 1. generated always as identity : cannot specify this column for import + // 2. generated by default as identity : auto-generated if not specified, cannot import null + // 3. generated by default on null as identity : unspecified or specified as null will be generated by default if (OB_UNLIKELY(column_schema->is_always_identity_column() && !obj.is_nop_value())) { ret = OB_ERR_INSERT_INTO_GENERATED_ALWAYS_IDENTITY_COLUMN; LOG_USER_ERROR(OB_ERR_INSERT_INTO_GENERATED_ALWAYS_IDENTITY_COLUMN); @@ -1116,8 +1120,8 @@ int ObTableLoadTransStoreWriter::handle_identity_column(const ObColumnSchemaV2 * ret = OB_BAD_NULL_ERROR; LOG_WARN("default identity column cannot insert null", KR(ret)); } else { - // 不论用户有没有指定自增列的值, 都取一个seq_value, 行为与insert into保持一致 - // 取seq_value的性能受表的参数cache影响 + // Regardless of whether the user has specified a value for the auto-increment column, take a seq_value, behavior consistent with insert into + // The performance of retrieving seq_value is affected by the table's cache parameter ObSequenceValue seq_value; if (OB_FAIL(ObSequenceCache::get_instance().nextval(trans_ctx_->ctx_->store_ctx_->sequence_schema_, cast_allocator, diff --git a/src/observer/table_load/ob_table_load_trans_store.h b/src/observer/table_load/ob_table_load_trans_store.h index fd7ccb17c..a9ce93d5c 100644 --- a/src/observer/table_load/ob_table_load_trans_store.h +++ b/src/observer/table_load/ob_table_load_trans_store.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -75,7 +79,7 @@ class ObTableLoadTransStoreWriter int init(); TO_STRING_KV(KP_(trans_ctx)); public: - // 只在对应工作线程中调用, 串行执行 + // Only called in the corresponding worker thread, serial execution int write(int32_t session_id, const table::ObTableLoadTabletObjRowArray &row_array); int px_write(common::ObIVector *tablet_id_vector, const storage::ObDirectLoadBatchRows &batch_rows); diff --git a/src/observer/table_load/ob_table_load_unique_index_row_handler.cpp b/src/observer/table_load/ob_table_load_unique_index_row_handler.cpp index d9462cff5..221a5688c 100644 --- a/src/observer/table_load/ob_table_load_unique_index_row_handler.cpp +++ b/src/observer/table_load/ob_table_load_unique_index_row_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -89,7 +93,7 @@ int ObTableLoadUniqueIndexRowHandler::handle_update_row(const ObTabletID &tablet LOG_WARN("fail to handle error row", KR(ret)); } else { ATOMIC_DEC(&result_info_->rows_affected_); // delete one row in load data - // 需要删除数据行 + // Need to delete data row ObTableLoadDataTableBuilder *data_builder = nullptr; if (OB_FAIL(store_ctx_->data_store_table_ctx_->get_delete_table_builder(data_builder))) { LOG_WARN("fail to get delete table builder", KR(ret)); @@ -99,7 +103,7 @@ int ObTableLoadUniqueIndexRowHandler::handle_update_row(const ObTabletID &tablet } } else if (ObLoadDupActionType::LOAD_REPLACE == dup_action_) { ATOMIC_DEC(&result_info_->rows_affected_); // delete one row in data tablex - // 需要删除数据行 + // Need to delete data row ObTableLoadDataTableBuilder *data_builder = nullptr; if (OB_FAIL(store_ctx_->data_store_table_ctx_->get_delete_table_builder(data_builder))) { LOG_WARN("fail to get delete table builder", KR(ret)); @@ -109,7 +113,7 @@ int ObTableLoadUniqueIndexRowHandler::handle_update_row(const ObTabletID &tablet } else if (ObLoadDupActionType::LOAD_IGNORE == dup_action_) { ATOMIC_INC(&result_info_->skipped_); ATOMIC_DEC(&result_info_->rows_affected_); // delete one row in load data - // 需要删除数据行 + // Need to delete data row ObTableLoadDataTableBuilder *data_builder = nullptr; if (OB_FAIL(store_ctx_->data_store_table_ctx_->get_delete_table_builder(data_builder))) { LOG_WARN("fail to get delete table builder", KR(ret)); @@ -169,7 +173,7 @@ int ObTableLoadUniqueIndexRowHandler::handle_update_row( } // mark result row is ack const_cast(result_row)->is_ack_ = true; - // 删除其他行 + // Delete other lines for (int64_t i = 0; OB_SUCC(ret) && i < rows.count(); i++) { const ObDirectLoadExternalRow *row = rows.at(i); ObTableLoadDataTableBuilder *data_builder = nullptr; @@ -229,7 +233,7 @@ int ObTableLoadUniqueIndexRowHandler::handle_update_row( } // mark result row is ack const_cast(result_row)->is_ack_ = true; - // 删除其他行 + // Delete other lines for (int64_t i = 0; OB_SUCC(ret) && i < rows.count(); i++) { const ObDirectLoadMultipleDatumRow *row = rows.at(i); ObTableLoadDataTableBuilder *data_builder = nullptr; diff --git a/src/observer/table_load/ob_table_load_unique_index_row_handler.h b/src/observer/table_load/ob_table_load_unique_index_row_handler.h index 2f512cea8..c2c471a8a 100644 --- a/src/observer/table_load/ob_table_load_unique_index_row_handler.h +++ b/src/observer/table_load/ob_table_load_unique_index_row_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -93,4 +97,4 @@ class ObTableLoadUniqueIndexRowHandler : public storage::ObDirectLoadDMLRowHandl }; } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/ob_table_load_utils.cpp b/src/observer/table_load/ob_table_load_utils.cpp index 94dc2203a..7948f1c7e 100644 --- a/src/observer/table_load/ob_table_load_utils.cpp +++ b/src/observer/table_load/ob_table_load_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/ob_table_load_utils.h b/src/observer/table_load/ob_table_load_utils.h index a0f00f06f..794cd4867 100644 --- a/src/observer/table_load/ob_table_load_utils.h +++ b/src/observer/table_load/ob_table_load_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_data_channel.cpp b/src/observer/table_load/plan/ob_table_load_data_channel.cpp index 2d7dc7a36..599d01758 100644 --- a/src/observer/table_load/plan/ob_table_load_data_channel.cpp +++ b/src/observer/table_load/plan/ob_table_load_data_channel.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_data_channel.h b/src/observer/table_load/plan/ob_table_load_data_channel.h index ff9a69858..310504138 100644 --- a/src/observer/table_load/plan/ob_table_load_data_channel.h +++ b/src/observer/table_load/plan/ob_table_load_data_channel.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_data_table_row_handler.cpp b/src/observer/table_load/plan/ob_table_load_data_table_row_handler.cpp index 8d172a599..e0dce1645 100644 --- a/src/observer/table_load/plan/ob_table_load_data_table_row_handler.cpp +++ b/src/observer/table_load/plan/ob_table_load_data_table_row_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_data_table_row_handler.h b/src/observer/table_load/plan/ob_table_load_data_table_row_handler.h index f5baaa516..4adb6a691 100644 --- a/src/observer/table_load/plan/ob_table_load_data_table_row_handler.h +++ b/src/observer/table_load/plan/ob_table_load_data_table_row_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_data_to_index_table_channel.cpp b/src/observer/table_load/plan/ob_table_load_data_to_index_table_channel.cpp index b698949a2..e0760c4e9 100644 --- a/src/observer/table_load/plan/ob_table_load_data_to_index_table_channel.cpp +++ b/src/observer/table_load/plan/ob_table_load_data_to_index_table_channel.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_data_to_index_table_channel.h b/src/observer/table_load/plan/ob_table_load_data_to_index_table_channel.h index 70a63b4ee..8f6cee804 100644 --- a/src/observer/table_load/plan/ob_table_load_data_to_index_table_channel.h +++ b/src/observer/table_load/plan/ob_table_load_data_to_index_table_channel.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_data_to_lob_table_channel.cpp b/src/observer/table_load/plan/ob_table_load_data_to_lob_table_channel.cpp index 0129e1980..e8a1d1b1a 100644 --- a/src/observer/table_load/plan/ob_table_load_data_to_lob_table_channel.cpp +++ b/src/observer/table_load/plan/ob_table_load_data_to_lob_table_channel.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_data_to_lob_table_channel.h b/src/observer/table_load/plan/ob_table_load_data_to_lob_table_channel.h index a98d17e3e..5573705c5 100644 --- a/src/observer/table_load/plan/ob_table_load_data_to_lob_table_channel.h +++ b/src/observer/table_load/plan/ob_table_load_data_to_lob_table_channel.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_dml_row_handler.cpp b/src/observer/table_load/plan/ob_table_load_dml_row_handler.cpp index b97a6abbd..22c75c5a9 100644 --- a/src/observer/table_load/plan/ob_table_load_dml_row_handler.cpp +++ b/src/observer/table_load/plan/ob_table_load_dml_row_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_dml_row_handler.h b/src/observer/table_load/plan/ob_table_load_dml_row_handler.h index e641be4cb..a0b38551d 100644 --- a/src/observer/table_load/plan/ob_table_load_dml_row_handler.h +++ b/src/observer/table_load/plan/ob_table_load_dml_row_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_full_plan.cpp b/src/observer/table_load/plan/ob_table_load_full_plan.cpp index e0d74dc67..03bc2ef2f 100644 --- a/src/observer/table_load/plan/ob_table_load_full_plan.cpp +++ b/src/observer/table_load/plan/ob_table_load_full_plan.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_full_plan.h b/src/observer/table_load/plan/ob_table_load_full_plan.h index cf17987d8..41c96b537 100644 --- a/src/observer/table_load/plan/ob_table_load_full_plan.h +++ b/src/observer/table_load/plan/ob_table_load_full_plan.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_inc_plan.cpp b/src/observer/table_load/plan/ob_table_load_inc_plan.cpp index 06eaaa353..48d3b9492 100644 --- a/src/observer/table_load/plan/ob_table_load_inc_plan.cpp +++ b/src/observer/table_load/plan/ob_table_load_inc_plan.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_inc_plan.h b/src/observer/table_load/plan/ob_table_load_inc_plan.h index fb2b53cd0..c832bf0b2 100644 --- a/src/observer/table_load/plan/ob_table_load_inc_plan.h +++ b/src/observer/table_load/plan/ob_table_load_inc_plan.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_merge_op.cpp b/src/observer/table_load/plan/ob_table_load_merge_op.cpp index ca693e785..fed121b97 100644 --- a/src/observer/table_load/plan/ob_table_load_merge_op.cpp +++ b/src/observer/table_load/plan/ob_table_load_merge_op.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_merge_op.h b/src/observer/table_load/plan/ob_table_load_merge_op.h index 30a0bc4b2..467fa0df0 100644 --- a/src/observer/table_load/plan/ob_table_load_merge_op.h +++ b/src/observer/table_load/plan/ob_table_load_merge_op.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_normal_row_handler.cpp b/src/observer/table_load/plan/ob_table_load_normal_row_handler.cpp index 742d5f307..cc8dd0293 100644 --- a/src/observer/table_load/plan/ob_table_load_normal_row_handler.cpp +++ b/src/observer/table_load/plan/ob_table_load_normal_row_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_normal_row_handler.h b/src/observer/table_load/plan/ob_table_load_normal_row_handler.h index 328f2ddbe..c06712cea 100644 --- a/src/observer/table_load/plan/ob_table_load_normal_row_handler.h +++ b/src/observer/table_load/plan/ob_table_load_normal_row_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_op.cpp b/src/observer/table_load/plan/ob_table_load_op.cpp index 5a69ca682..f3ca9e77d 100644 --- a/src/observer/table_load/plan/ob_table_load_op.cpp +++ b/src/observer/table_load/plan/ob_table_load_op.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_op.h b/src/observer/table_load/plan/ob_table_load_op.h index c24bd49a2..4dd184860 100644 --- a/src/observer/table_load/plan/ob_table_load_op.h +++ b/src/observer/table_load/plan/ob_table_load_op.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_plan.cpp b/src/observer/table_load/plan/ob_table_load_plan.cpp index 668b0197b..b32b325a0 100644 --- a/src/observer/table_load/plan/ob_table_load_plan.cpp +++ b/src/observer/table_load/plan/ob_table_load_plan.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_plan.h b/src/observer/table_load/plan/ob_table_load_plan.h index eff1679a1..37cc7a411 100644 --- a/src/observer/table_load/plan/ob_table_load_plan.h +++ b/src/observer/table_load/plan/ob_table_load_plan.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_plan_common.cpp b/src/observer/table_load/plan/ob_table_load_plan_common.cpp index 83557a723..80a6a131d 100644 --- a/src/observer/table_load/plan/ob_table_load_plan_common.cpp +++ b/src/observer/table_load/plan/ob_table_load_plan_common.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_plan_common.h b/src/observer/table_load/plan/ob_table_load_plan_common.h index 652ab8261..b9ae3ad3d 100644 --- a/src/observer/table_load/plan/ob_table_load_plan_common.h +++ b/src/observer/table_load/plan/ob_table_load_plan_common.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_table_builder.cpp b/src/observer/table_load/plan/ob_table_load_table_builder.cpp index d2c9641e5..3f87b46ff 100644 --- a/src/observer/table_load/plan/ob_table_load_table_builder.cpp +++ b/src/observer/table_load/plan/ob_table_load_table_builder.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -216,4 +220,4 @@ int ObTableLoadTableBuilderMgr::close() return ret; } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/plan/ob_table_load_table_builder.h b/src/observer/table_load/plan/ob_table_load_table_builder.h index 16d19ccce..f52cd314d 100644 --- a/src/observer/table_load/plan/ob_table_load_table_builder.h +++ b/src/observer/table_load/plan/ob_table_load_table_builder.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once @@ -89,4 +93,4 @@ class ObTableLoadTableBuilderMgr bool is_inited_; }; } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/table_load/plan/ob_table_load_table_op.cpp b/src/observer/table_load/plan/ob_table_load_table_op.cpp index 68950fc17..f5e2d9351 100644 --- a/src/observer/table_load/plan/ob_table_load_table_op.cpp +++ b/src/observer/table_load/plan/ob_table_load_table_op.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_table_op.h b/src/observer/table_load/plan/ob_table_load_table_op.h index 61da89547..d4a4221f4 100644 --- a/src/observer/table_load/plan/ob_table_load_table_op.h +++ b/src/observer/table_load/plan/ob_table_load_table_op.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_table_op_builder.h b/src/observer/table_load/plan/ob_table_load_table_op_builder.h index 9da4a60ff..01d7677b1 100644 --- a/src/observer/table_load/plan/ob_table_load_table_op_builder.h +++ b/src/observer/table_load/plan/ob_table_load_table_op_builder.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_table_op_define.h b/src/observer/table_load/plan/ob_table_load_table_op_define.h index 1a0cdcec4..d196d25e2 100644 --- a/src/observer/table_load/plan/ob_table_load_table_op_define.h +++ b/src/observer/table_load/plan/ob_table_load_table_op_define.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_table_op_driver.h b/src/observer/table_load/plan/ob_table_load_table_op_driver.h index c77e998da..a393bb6d8 100644 --- a/src/observer/table_load/plan/ob_table_load_table_op_driver.h +++ b/src/observer/table_load/plan/ob_table_load_table_op_driver.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_unique_index_table_row_handler.cpp b/src/observer/table_load/plan/ob_table_load_unique_index_table_row_handler.cpp index 9f722bae4..6a6ace3bc 100644 --- a/src/observer/table_load/plan/ob_table_load_unique_index_table_row_handler.cpp +++ b/src/observer/table_load/plan/ob_table_load_unique_index_table_row_handler.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_unique_index_table_row_handler.h b/src/observer/table_load/plan/ob_table_load_unique_index_table_row_handler.h index aa460f6fb..18b5ed2f1 100644 --- a/src/observer/table_load/plan/ob_table_load_unique_index_table_row_handler.h +++ b/src/observer/table_load/plan/ob_table_load_unique_index_table_row_handler.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_unique_index_to_ack_data_table_channel.cpp b/src/observer/table_load/plan/ob_table_load_unique_index_to_ack_data_table_channel.cpp index 379f0eb70..223827bf7 100644 --- a/src/observer/table_load/plan/ob_table_load_unique_index_to_ack_data_table_channel.cpp +++ b/src/observer/table_load/plan/ob_table_load_unique_index_to_ack_data_table_channel.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_unique_index_to_ack_data_table_channel.h b/src/observer/table_load/plan/ob_table_load_unique_index_to_ack_data_table_channel.h index 3be6ce1ae..21e2d0b84 100644 --- a/src/observer/table_load/plan/ob_table_load_unique_index_to_ack_data_table_channel.h +++ b/src/observer/table_load/plan/ob_table_load_unique_index_to_ack_data_table_channel.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_unique_index_to_delete_data_table_channel.cpp b/src/observer/table_load/plan/ob_table_load_unique_index_to_delete_data_table_channel.cpp index 2d550272e..d72ade84a 100644 --- a/src/observer/table_load/plan/ob_table_load_unique_index_to_delete_data_table_channel.cpp +++ b/src/observer/table_load/plan/ob_table_load_unique_index_to_delete_data_table_channel.cpp @@ -1,13 +1,17 @@ - /** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_unique_index_to_delete_data_table_channel.h b/src/observer/table_load/plan/ob_table_load_unique_index_to_delete_data_table_channel.h index abf55330e..83e7c8469 100644 --- a/src/observer/table_load/plan/ob_table_load_unique_index_to_delete_data_table_channel.h +++ b/src/observer/table_load/plan/ob_table_load_unique_index_to_delete_data_table_channel.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/plan/ob_table_load_write_op.cpp b/src/observer/table_load/plan/ob_table_load_write_op.cpp index c36e33f0c..30b7df55e 100644 --- a/src/observer/table_load/plan/ob_table_load_write_op.cpp +++ b/src/observer/table_load/plan/ob_table_load_write_op.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/plan/ob_table_load_write_op.h b/src/observer/table_load/plan/ob_table_load_write_op.h index c298242ae..5f75c4833 100644 --- a/src/observer/table_load/plan/ob_table_load_write_op.h +++ b/src/observer/table_load/plan/ob_table_load_write_op.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2025 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/resource/ob_table_load_resource_manager.cpp b/src/observer/table_load/resource/ob_table_load_resource_manager.cpp index 8a4f9229e..0642d48dd 100644 --- a/src/observer/table_load/resource/ob_table_load_resource_manager.cpp +++ b/src/observer/table_load/resource/ob_table_load_resource_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -207,7 +211,7 @@ int ObTableLoadResourceManager::apply_resource(ObDirectLoadResourceApplyArg &arg if (OB_FAIL(resource_pool_.get_refactored(apply_unit.addr_, ctx))) { LOG_WARN("fail to get refactored", KR(ret), K(apply_unit.addr_)); if (ret == OB_HASH_NOT_EXIST) { - // 第一次切主需要初始化,通过内部sql查询ACTIVE状态的observer可能不完整,期间若有导入任务进来时需要重试 + // The first leader switch requires initialization, internal SQL queries for ACTIVE status observers may be incomplete during this time, if an import task comes in, a retry is needed ret = OB_EAGAIN; } } else if (apply_unit.memory_size_ > ctx.memory_remain_) { diff --git a/src/observer/table_load/resource/ob_table_load_resource_manager.h b/src/observer/table_load/resource/ob_table_load_resource_manager.h index 033c9ea9c..5b53b2be3 100644 --- a/src/observer/table_load/resource/ob_table_load_resource_manager.h +++ b/src/observer/table_load/resource/ob_table_load_resource_manager.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/resource/ob_table_load_resource_processor.cpp b/src/observer/table_load/resource/ob_table_load_resource_processor.cpp index f26914c7c..6d365b0c8 100644 --- a/src/observer/table_load/resource/ob_table_load_resource_processor.cpp +++ b/src/observer/table_load/resource/ob_table_load_resource_processor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/resource/ob_table_load_resource_processor.h b/src/observer/table_load/resource/ob_table_load_resource_processor.h index e7be5d1cf..8b577d00b 100644 --- a/src/observer/table_load/resource/ob_table_load_resource_processor.h +++ b/src/observer/table_load/resource/ob_table_load_resource_processor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/resource/ob_table_load_resource_rpc_executor.cpp b/src/observer/table_load/resource/ob_table_load_resource_rpc_executor.cpp index 3e6f2b00e..b114542ad 100644 --- a/src/observer/table_load/resource/ob_table_load_resource_rpc_executor.cpp +++ b/src/observer/table_load/resource/ob_table_load_resource_rpc_executor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/resource/ob_table_load_resource_rpc_executor.h b/src/observer/table_load/resource/ob_table_load_resource_rpc_executor.h index 1478b2320..cab65bbf2 100644 --- a/src/observer/table_load/resource/ob_table_load_resource_rpc_executor.h +++ b/src/observer/table_load/resource/ob_table_load_resource_rpc_executor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/resource/ob_table_load_resource_rpc_proxy.cpp b/src/observer/table_load/resource/ob_table_load_resource_rpc_proxy.cpp index 3677e1a32..d44a5ae7b 100644 --- a/src/observer/table_load/resource/ob_table_load_resource_rpc_proxy.cpp +++ b/src/observer/table_load/resource/ob_table_load_resource_rpc_proxy.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/resource/ob_table_load_resource_rpc_proxy.h b/src/observer/table_load/resource/ob_table_load_resource_rpc_proxy.h index 017fddb42..443b52188 100644 --- a/src/observer/table_load/resource/ob_table_load_resource_rpc_proxy.h +++ b/src/observer/table_load/resource/ob_table_load_resource_rpc_proxy.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/resource/ob_table_load_resource_rpc_struct.cpp b/src/observer/table_load/resource/ob_table_load_resource_rpc_struct.cpp index 8d4daf880..b9e726565 100644 --- a/src/observer/table_load/resource/ob_table_load_resource_rpc_struct.cpp +++ b/src/observer/table_load/resource/ob_table_load_resource_rpc_struct.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/resource/ob_table_load_resource_rpc_struct.h b/src/observer/table_load/resource/ob_table_load_resource_rpc_struct.h index b2af72cdc..88c2509fe 100644 --- a/src/observer/table_load/resource/ob_table_load_resource_rpc_struct.h +++ b/src/observer/table_load/resource/ob_table_load_resource_rpc_struct.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/table_load/resource/ob_table_load_resource_service.cpp b/src/observer/table_load/resource/ob_table_load_resource_service.cpp index 475d51ef7..26ba42b72 100644 --- a/src/observer/table_load/resource/ob_table_load_resource_service.cpp +++ b/src/observer/table_load/resource/ob_table_load_resource_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/table_load/resource/ob_table_load_resource_service.h b/src/observer/table_load/resource/ob_table_load_resource_service.h index d56efbb57..c62feb314 100644 --- a/src/observer/table_load/resource/ob_table_load_resource_service.h +++ b/src/observer/table_load/resource/ob_table_load_resource_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/virtual_table/ob_agent_table_base.cpp b/src/observer/virtual_table/ob_agent_table_base.cpp index 0aa7d0150..6d29bf7c1 100644 --- a/src/observer/virtual_table/ob_agent_table_base.cpp +++ b/src/observer/virtual_table/ob_agent_table_base.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -234,7 +238,7 @@ int ObAgentTableBase::construct_columns( if (OB_SUCC(ret)) { const int64_t buf_len = 100; char *buf = NULL; - // 对query timeout取10的指数次,防止系统租户计划缓存数过大 + // Take the 10th power of query timeout to prevent the system tenant plan cache count from becoming too large int64_t rest_time = scan_param_->timeout_ - ObTimeUtility::current_time(); int64_t query_timeout = 1; for (; rest_time > 0;) { diff --git a/src/observer/virtual_table/ob_agent_table_base.h b/src/observer/virtual_table/ob_agent_table_base.h index 04df7983a..b2d049286 100644 --- a/src/observer/virtual_table/ob_agent_table_base.h +++ b/src/observer/virtual_table/ob_agent_table_base.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_VIRTUAL_TABLE_OB_AGENT_TABLE_BASE_H_ diff --git a/src/observer/virtual_table/ob_agent_virtual_table.cpp b/src/observer/virtual_table/ob_agent_virtual_table.cpp index 7c56a5779..edc3c0877 100644 --- a/src/observer/virtual_table/ob_agent_virtual_table.cpp +++ b/src/observer/virtual_table/ob_agent_virtual_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -74,7 +78,7 @@ static int varchar2varchar(const ObObj &src, ObObj &dst, ObIAllocator &) dst.set_null(); } else { dst = src; - //对于oracle租户内部表,从表、列到字符串类型确保所有collation为CS_TYPE_UTF8MB4_BIN + //For oracle tenant internal tables, ensure all collation of tables, columns to string type is CS_TYPE_UTF8MB4_BIN dst.set_collation_type(ObCollationType::CS_TYPE_UTF8MB4_BIN); } return OB_SUCCESS; @@ -267,12 +271,11 @@ int ObAgentVirtualTable::inner_get_next_row(common::ObNewRow *&row) return ret; } - -// 如果query range为 (tenant_id, cond1, cond2, ...) <= (v1, v2, v3, ...) and (tenant_id, cond1, cond2, ...) >= (v1', v2', v3', ...) -// 那么如果在最后的条件加上 and tenant_id = v,也就是 +// If query range is (tenant_id, cond1, cond2, ...) <= (v1, v2, v3, ...) and (tenant_id, cond1, cond2, ...) >= (v1', v2', v3', ...) +// then if the final condition is added as and tenant_id = v, that is to say // (tenant_id, cond1, cond2, ...) <= (v1, v2, v3, ...) and (tenant_id, cond1, cond2, ...) >= (v1', v2', v3', ...) and tenant_id = v -// 优化器这时候抽不出来query range,只能得到 (tenant_id, min, min), (tenant_id, max, max), -// 对于某些只支持get操作的表(比如plan_cache_plan_explain),结果集总为空,所以需要加上这个判断条件 +// The optimizer cannot extract the query range at this point, and can only obtain (tenant_id, min, min), (tenant_id, max, max), +// For some tables that only support get operations (e.g., plan_cache_plan_explain), the result set is always empty, so this condition check is necessary int ObAgentVirtualTable::should_add_tenant_condition(bool &need, const uint64_t tenant_id) const { int ret = OB_SUCCESS; diff --git a/src/observer/virtual_table/ob_agent_virtual_table.h b/src/observer/virtual_table/ob_agent_virtual_table.h index b900a4d98..2559ae4bd 100644 --- a/src/observer/virtual_table/ob_agent_virtual_table.h +++ b/src/observer/virtual_table/ob_agent_virtual_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_VIRTUAL_TABLE_OB_AGENT_VIRTUAL_TABLE_H_ @@ -52,11 +56,11 @@ class ObAgentVirtualTable : public ObAgentTableBase int should_add_tenant_condition(bool &need, const uint64_t tenant_id) const; private: - // 切sys前被代理的普通租户ID + // ID of the regular tenant being proxied before switching sys uint64_t general_tenant_id_; // agent table Compat Mode lib::Worker::CompatMode mode_; - // 表明是否这张代理表只查系统租户下的数据 + // Indicates whether this proxy table only queries data under the system tenant bool only_sys_data_; DISALLOW_COPY_AND_ASSIGN(ObAgentVirtualTable); }; diff --git a/src/observer/virtual_table/ob_all_concurrency_object_pool.cpp b/src/observer/virtual_table/ob_all_concurrency_object_pool.cpp index 7663021da..8b7e34ac1 100644 --- a/src/observer/virtual_table/ob_all_concurrency_object_pool.cpp +++ b/src/observer/virtual_table/ob_all_concurrency_object_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_concurrency_object_pool.h" diff --git a/src/observer/virtual_table/ob_all_concurrency_object_pool.h b/src/observer/virtual_table/ob_all_concurrency_object_pool.h index 822c16da3..8dc825480 100644 --- a/src/observer/virtual_table/ob_all_concurrency_object_pool.h +++ b/src/observer/virtual_table/ob_all_concurrency_object_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_CONCURRENCY_OBJECT_POOL_H_ diff --git a/src/observer/virtual_table/ob_all_data_type_class_table.cpp b/src/observer/virtual_table/ob_all_data_type_class_table.cpp index f39e30c0f..bafda7825 100644 --- a/src/observer/virtual_table/ob_all_data_type_class_table.cpp +++ b/src/observer/virtual_table/ob_all_data_type_class_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_data_type_class_table.h" diff --git a/src/observer/virtual_table/ob_all_data_type_class_table.h b/src/observer/virtual_table/ob_all_data_type_class_table.h index cef318170..1d98f0d07 100644 --- a/src/observer/virtual_table/ob_all_data_type_class_table.h +++ b/src/observer/virtual_table/ob_all_data_type_class_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_ALL_DATA_TYPE_CLASS_TABLE_ diff --git a/src/observer/virtual_table/ob_all_data_type_table.cpp b/src/observer/virtual_table/ob_all_data_type_table.cpp index f5436507b..19c83b94c 100644 --- a/src/observer/virtual_table/ob_all_data_type_table.cpp +++ b/src/observer/virtual_table/ob_all_data_type_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_data_type_table.h" diff --git a/src/observer/virtual_table/ob_all_data_type_table.h b/src/observer/virtual_table/ob_all_data_type_table.h index 296f3d8ba..b424db90e 100644 --- a/src/observer/virtual_table/ob_all_data_type_table.h +++ b/src/observer/virtual_table/ob_all_data_type_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_ALL_DATA_TYPE_TABLE_ diff --git a/src/observer/virtual_table/ob_all_disk_stat.cpp b/src/observer/virtual_table/ob_all_disk_stat.cpp index 1eb5e7183..dd9c3db94 100644 --- a/src/observer/virtual_table/ob_all_disk_stat.cpp +++ b/src/observer/virtual_table/ob_all_disk_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_disk_stat.h" diff --git a/src/observer/virtual_table/ob_all_disk_stat.h b/src/observer/virtual_table/ob_all_disk_stat.h index 616746370..483cbfe43 100644 --- a/src/observer/virtual_table/ob_all_disk_stat.h +++ b/src/observer/virtual_table/ob_all_disk_stat.h @@ -1,61 +1,64 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ - -#ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_DISK_STAT_TABLE_ -#define OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_DISK_STAT_TABLE_ - -#include "share/ob_virtual_table_scanner_iterator.h" - - -namespace oceanbase -{ -namespace common -{ -class ObObj; -} - -namespace observer -{ - -class ObInfoSchemaDiskStatTable : public common::ObVirtualTableScannerIterator -{ -public: - ObInfoSchemaDiskStatTable(); - virtual ~ObInfoSchemaDiskStatTable(); - virtual int inner_get_next_row(common::ObNewRow *&row); - virtual void reset(); - inline void set_addr(common::ObAddr &addr) {addr_ = &addr;} - virtual int set_ip(common::ObAddr *addr); - -private: - enum DISK_COLUMN - { - SVR_IP = common::OB_APP_MIN_COLUMN_ID, - SVR_PORT, - TOTAL_SIZE, - USED_SIZE, - FREE_SIZE, - IS_DISK_VALID, - DISK_ERROR_BEGIN_TS, - ALLOCATED_SIZE - }; - common::ObAddr *addr_; - common::ObString ipstr_; - int32_t port_; - bool is_end_; - DISALLOW_COPY_AND_ASSIGN(ObInfoSchemaDiskStatTable); -}; - -} -} -#endif /* OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_DISK_STAT_TABLE */ - +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ + +#ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_DISK_STAT_TABLE_ +#define OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_DISK_STAT_TABLE_ + +#include "share/ob_virtual_table_scanner_iterator.h" + + +namespace oceanbase +{ +namespace common +{ +class ObObj; +} + +namespace observer +{ + +class ObInfoSchemaDiskStatTable : public common::ObVirtualTableScannerIterator +{ +public: + ObInfoSchemaDiskStatTable(); + virtual ~ObInfoSchemaDiskStatTable(); + virtual int inner_get_next_row(common::ObNewRow *&row); + virtual void reset(); + inline void set_addr(common::ObAddr &addr) {addr_ = &addr;} + virtual int set_ip(common::ObAddr *addr); + +private: + enum DISK_COLUMN + { + SVR_IP = common::OB_APP_MIN_COLUMN_ID, + SVR_PORT, + TOTAL_SIZE, + USED_SIZE, + FREE_SIZE, + IS_DISK_VALID, + DISK_ERROR_BEGIN_TS, + ALLOCATED_SIZE + }; + common::ObAddr *addr_; + common::ObString ipstr_; + int32_t port_; + bool is_end_; + DISALLOW_COPY_AND_ASSIGN(ObInfoSchemaDiskStatTable); +}; + +} +} +#endif /* OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_DISK_STAT_TABLE */ diff --git a/src/observer/virtual_table/ob_all_latch.cpp b/src/observer/virtual_table/ob_all_latch.cpp index 6d0567840..41edd1f17 100644 --- a/src/observer/virtual_table/ob_all_latch.cpp +++ b/src/observer/virtual_table/ob_all_latch.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_latch.h" diff --git a/src/observer/virtual_table/ob_all_latch.h b/src/observer/virtual_table/ob_all_latch.h index 368450717..20e45c727 100644 --- a/src/observer/virtual_table/ob_all_latch.h +++ b/src/observer/virtual_table/ob_all_latch.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_LATCH_H_ diff --git a/src/observer/virtual_table/ob_all_plan_cache_stat.cpp b/src/observer/virtual_table/ob_all_plan_cache_stat.cpp index d456c41eb..4580f534b 100644 --- a/src/observer/virtual_table/ob_all_plan_cache_stat.cpp +++ b/src/observer/virtual_table/ob_all_plan_cache_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_plan_cache_stat.h b/src/observer/virtual_table/ob_all_plan_cache_stat.h index 1c270fca8..5648ecc62 100644 --- a/src/observer/virtual_table/ob_all_plan_cache_stat.h +++ b/src/observer/virtual_table/ob_all_plan_cache_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_ALL_PLAN_CACHE_STAT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_activity_metrics.cpp b/src/observer/virtual_table/ob_all_virtual_activity_metrics.cpp index 28b9f884e..7dd1c239c 100644 --- a/src/observer/virtual_table/ob_all_virtual_activity_metrics.cpp +++ b/src/observer/virtual_table/ob_all_virtual_activity_metrics.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_activity_metrics.h" diff --git a/src/observer/virtual_table/ob_all_virtual_activity_metrics.h b/src/observer/virtual_table/ob_all_virtual_activity_metrics.h index 414ffa6f2..ce2f21eee 100644 --- a/src/observer/virtual_table/ob_all_virtual_activity_metrics.h +++ b/src/observer/virtual_table/ob_all_virtual_activity_metrics.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_ACTIVITY_METRICS_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_apply_stat.cpp b/src/observer/virtual_table/ob_all_virtual_apply_stat.cpp index cbb3f9c0f..036a1c559 100644 --- a/src/observer/virtual_table/ob_all_virtual_apply_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_apply_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_apply_stat.h" diff --git a/src/observer/virtual_table/ob_all_virtual_apply_stat.h b/src/observer/virtual_table/ob_all_virtual_apply_stat.h index b863e7b06..09b5cbd10 100644 --- a/src/observer/virtual_table/ob_all_virtual_apply_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_apply_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_ALL_VIRTUAL_APPLY_STAT_H_ @@ -39,4 +43,4 @@ class ObAllVirtualApplyStat : public common::ObVirtualTableScannerIterator }; } // namespace observer } // namespace oceanbase -#endif /* OCEANBASE_OBSERVER_OB_ALL_VIRTUAL_APPLY_STAT_H_ */ \ No newline at end of file +#endif /* OCEANBASE_OBSERVER_OB_ALL_VIRTUAL_APPLY_STAT_H_ */ diff --git a/src/observer/virtual_table/ob_all_virtual_arbitration_member_info.cpp b/src/observer/virtual_table/ob_all_virtual_arbitration_member_info.cpp index 728295491..c8bb22ecf 100644 --- a/src/observer/virtual_table/ob_all_virtual_arbitration_member_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_arbitration_member_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_arbitration_member_info.h" diff --git a/src/observer/virtual_table/ob_all_virtual_arbitration_member_info.h b/src/observer/virtual_table/ob_all_virtual_arbitration_member_info.h index 3d385dbd2..6b846d933 100644 --- a/src/observer/virtual_table/ob_all_virtual_arbitration_member_info.h +++ b/src/observer/virtual_table/ob_all_virtual_arbitration_member_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_ARB_MEMBER_INFO_ diff --git a/src/observer/virtual_table/ob_all_virtual_arbitration_service_status.cpp b/src/observer/virtual_table/ob_all_virtual_arbitration_service_status.cpp index 8269f7512..8ecbeaa96 100644 --- a/src/observer/virtual_table/ob_all_virtual_arbitration_service_status.cpp +++ b/src/observer/virtual_table/ob_all_virtual_arbitration_service_status.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_arbitration_service_status.h" diff --git a/src/observer/virtual_table/ob_all_virtual_arbitration_service_status.h b/src/observer/virtual_table/ob_all_virtual_arbitration_service_status.h index fbeeda54e..8f4a2e008 100644 --- a/src/observer/virtual_table/ob_all_virtual_arbitration_service_status.h +++ b/src/observer/virtual_table/ob_all_virtual_arbitration_service_status.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_ARB_SERVICE_STATUS_ diff --git a/src/observer/virtual_table/ob_all_virtual_archive_dest_status.cpp b/src/observer/virtual_table/ob_all_virtual_archive_dest_status.cpp index a031cba9e..3d6b2f3f4 100644 --- a/src/observer/virtual_table/ob_all_virtual_archive_dest_status.cpp +++ b/src/observer/virtual_table/ob_all_virtual_archive_dest_status.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_virtual_archive_dest_status.h b/src/observer/virtual_table/ob_all_virtual_archive_dest_status.h index 1941b2514..21721f71c 100644 --- a/src/observer/virtual_table/ob_all_virtual_archive_dest_status.h +++ b/src/observer/virtual_table/ob_all_virtual_archive_dest_status.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_ALL_VIRTUAL_ARCHIVE_DEST_STATUS_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_bad_block_table.cpp b/src/observer/virtual_table/ob_all_virtual_bad_block_table.cpp index 648894208..68614d08c 100644 --- a/src/observer/virtual_table/ob_all_virtual_bad_block_table.cpp +++ b/src/observer/virtual_table/ob_all_virtual_bad_block_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_bad_block_table.h" diff --git a/src/observer/virtual_table/ob_all_virtual_bad_block_table.h b/src/observer/virtual_table/ob_all_virtual_bad_block_table.h index a392bf867..0d08f2167 100644 --- a/src/observer/virtual_table/ob_all_virtual_bad_block_table.h +++ b/src/observer/virtual_table/ob_all_virtual_bad_block_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_BAD_BLOCK_TABLE_H diff --git a/src/observer/virtual_table/ob_all_virtual_ccl_status.cpp b/src/observer/virtual_table/ob_all_virtual_ccl_status.cpp index 8a5ad2566..31e75acfc 100644 --- a/src/observer/virtual_table/ob_all_virtual_ccl_status.cpp +++ b/src/observer/virtual_table/ob_all_virtual_ccl_status.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_virtual_ccl_status.h b/src/observer/virtual_table/ob_all_virtual_ccl_status.h index 6ebd858ef..4488d960d 100644 --- a/src/observer/virtual_table/ob_all_virtual_ccl_status.h +++ b/src/observer/virtual_table/ob_all_virtual_ccl_status.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_ALL_VIRTUAL_CCL_STATUS_H diff --git a/src/observer/virtual_table/ob_all_virtual_cgroup_config.cpp b/src/observer/virtual_table/ob_all_virtual_cgroup_config.cpp index 2fcf30444..e60a739aa 100644 --- a/src/observer/virtual_table/ob_all_virtual_cgroup_config.cpp +++ b/src/observer/virtual_table/ob_all_virtual_cgroup_config.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/file/file_directory_utils.h" @@ -206,7 +210,7 @@ int ObAllVirtualCgroupConfig::add_cgroup_config_info_(const char *cgroup_path) } } if (OB_SUCC(ret)) { - // scanner最大支持64M,因此暂不考虑溢出的情况 + // scanner maximum supports 64M, therefore overflow is not considered for now if (OB_FAIL(scanner_.add_row(cur_row_))) { SERVER_LOG(WARN, "fail to add row", K(ret), K(cur_row_)); if (OB_SIZE_OVERFLOW == ret) { @@ -218,4 +222,4 @@ int ObAllVirtualCgroupConfig::add_cgroup_config_info_(const char *cgroup_path) } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_cgroup_config.h b/src/observer/virtual_table/ob_all_virtual_cgroup_config.h index 601a494e8..f4f051ac4 100644 --- a/src/observer/virtual_table/ob_all_virtual_cgroup_config.h +++ b/src/observer/virtual_table/ob_all_virtual_cgroup_config.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_CGROUP_CONFIG_H_ @@ -55,4 +59,4 @@ class ObAllVirtualCgroupConfig : public common::ObVirtualTableScannerIterator } } -#endif /* SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_CGROUP_CONFIG_H_ */ \ No newline at end of file +#endif /* SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_CGROUP_CONFIG_H_ */ diff --git a/src/observer/virtual_table/ob_all_virtual_checkpoint.cpp b/src/observer/virtual_table/ob_all_virtual_checkpoint.cpp index 7d1a94689..8c443ab71 100644 --- a/src/observer/virtual_table/ob_all_virtual_checkpoint.cpp +++ b/src/observer/virtual_table/ob_all_virtual_checkpoint.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_checkpoint.h" diff --git a/src/observer/virtual_table/ob_all_virtual_checkpoint.h b/src/observer/virtual_table/ob_all_virtual_checkpoint.h index 232e52cb6..ee0dbf583 100644 --- a/src/observer/virtual_table/ob_all_virtual_checkpoint.h +++ b/src/observer/virtual_table/ob_all_virtual_checkpoint.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_CHECKPOINT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_checkpoint_diagnose_info.cpp b/src/observer/virtual_table/ob_all_virtual_checkpoint_diagnose_info.cpp index 42536dae1..0ca0d60a6 100644 --- a/src/observer/virtual_table/ob_all_virtual_checkpoint_diagnose_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_checkpoint_diagnose_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/src/observer/virtual_table/ob_all_virtual_checkpoint_diagnose_info.h b/src/observer/virtual_table/ob_all_virtual_checkpoint_diagnose_info.h index 766ca1960..de1406539 100644 --- a/src/observer/virtual_table/ob_all_virtual_checkpoint_diagnose_info.h +++ b/src/observer/virtual_table/ob_all_virtual_checkpoint_diagnose_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_CHEKPOINT_DIAGNOSE_INFO_H diff --git a/src/observer/virtual_table/ob_all_virtual_checkpoint_diagnose_memtable_info.cpp b/src/observer/virtual_table/ob_all_virtual_checkpoint_diagnose_memtable_info.cpp index b1d4db509..59bbd01e7 100644 --- a/src/observer/virtual_table/ob_all_virtual_checkpoint_diagnose_memtable_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_checkpoint_diagnose_memtable_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/src/observer/virtual_table/ob_all_virtual_checkpoint_diagnose_memtable_info.h b/src/observer/virtual_table/ob_all_virtual_checkpoint_diagnose_memtable_info.h index cc6b24046..61262b06c 100644 --- a/src/observer/virtual_table/ob_all_virtual_checkpoint_diagnose_memtable_info.h +++ b/src/observer/virtual_table/ob_all_virtual_checkpoint_diagnose_memtable_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_CHEKPOINT_DIAGNOSE_MEMTABLE_INFO_H diff --git a/src/observer/virtual_table/ob_all_virtual_compaction_diagnose_info.cpp b/src/observer/virtual_table/ob_all_virtual_compaction_diagnose_info.cpp index 1c1d3ec6a..fad7d5b11 100644 --- a/src/observer/virtual_table/ob_all_virtual_compaction_diagnose_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_compaction_diagnose_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_compaction_diagnose_info.h" diff --git a/src/observer/virtual_table/ob_all_virtual_compaction_diagnose_info.h b/src/observer/virtual_table/ob_all_virtual_compaction_diagnose_info.h index 5145c3085..8a09ab32a 100644 --- a/src/observer/virtual_table/ob_all_virtual_compaction_diagnose_info.h +++ b/src/observer/virtual_table/ob_all_virtual_compaction_diagnose_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_COMPACTION_DIAGNOSE_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_compaction_suggestion.cpp b/src/observer/virtual_table/ob_all_virtual_compaction_suggestion.cpp index 4fa07b3c7..852c9de47 100644 --- a/src/observer/virtual_table/ob_all_virtual_compaction_suggestion.cpp +++ b/src/observer/virtual_table/ob_all_virtual_compaction_suggestion.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_compaction_suggestion.h" diff --git a/src/observer/virtual_table/ob_all_virtual_compaction_suggestion.h b/src/observer/virtual_table/ob_all_virtual_compaction_suggestion.h index 56f62808a..8bb97e420 100644 --- a/src/observer/virtual_table/ob_all_virtual_compaction_suggestion.h +++ b/src/observer/virtual_table/ob_all_virtual_compaction_suggestion.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_COMPACTION_SUGGESTION_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_compatibility_control.cpp b/src/observer/virtual_table/ob_all_virtual_compatibility_control.cpp index 0547f26fe..330d5ba4f 100644 --- a/src/observer/virtual_table/ob_all_virtual_compatibility_control.cpp +++ b/src/observer/virtual_table/ob_all_virtual_compatibility_control.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_virtual_compatibility_control.h b/src/observer/virtual_table/ob_all_virtual_compatibility_control.h index c8c5dde54..a024f8b33 100644 --- a/src/observer/virtual_table/ob_all_virtual_compatibility_control.h +++ b/src/observer/virtual_table/ob_all_virtual_compatibility_control.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_COMPATIBILITY_CONTROL_ diff --git a/src/observer/virtual_table/ob_all_virtual_cs_replica_tablet_stats.cpp b/src/observer/virtual_table/ob_all_virtual_cs_replica_tablet_stats.cpp index 0cf35cd82..a972c30f1 100644 --- a/src/observer/virtual_table/ob_all_virtual_cs_replica_tablet_stats.cpp +++ b/src/observer/virtual_table/ob_all_virtual_cs_replica_tablet_stats.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_cs_replica_tablet_stats.h" diff --git a/src/observer/virtual_table/ob_all_virtual_cs_replica_tablet_stats.h b/src/observer/virtual_table/ob_all_virtual_cs_replica_tablet_stats.h index 1d75d6848..952695421 100644 --- a/src/observer/virtual_table/ob_all_virtual_cs_replica_tablet_stats.h +++ b/src/observer/virtual_table/ob_all_virtual_cs_replica_tablet_stats.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_CS_REPLICA_TABLET_STATS_H_ @@ -88,4 +92,4 @@ class ObAllVirtualCSReplicaTabletStats : public ObAllVirtualTableLSTabletIter } // end observer } // end oceanbase -#endif /* OB_ALL_VIRTUAL_CS_REPLICA_TABLET_STATS_H_ */ \ No newline at end of file +#endif /* OB_ALL_VIRTUAL_CS_REPLICA_TABLET_STATS_H_ */ diff --git a/src/observer/virtual_table/ob_all_virtual_dag.cpp b/src/observer/virtual_table/ob_all_virtual_dag.cpp index e08e03936..9081b86ef 100644 --- a/src/observer/virtual_table/ob_all_virtual_dag.cpp +++ b/src/observer/virtual_table/ob_all_virtual_dag.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/src/observer/virtual_table/ob_all_virtual_dag.h b/src/observer/virtual_table/ob_all_virtual_dag.h index f33824f0b..33973749b 100644 --- a/src/observer/virtual_table/ob_all_virtual_dag.h +++ b/src/observer/virtual_table/ob_all_virtual_dag.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_DAG_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_dag_warning_history.cpp b/src/observer/virtual_table/ob_all_virtual_dag_warning_history.cpp index 86218d61e..6db8b81bb 100644 --- a/src/observer/virtual_table/ob_all_virtual_dag_warning_history.cpp +++ b/src/observer/virtual_table/ob_all_virtual_dag_warning_history.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_dag_warning_history.h" diff --git a/src/observer/virtual_table/ob_all_virtual_dag_warning_history.h b/src/observer/virtual_table/ob_all_virtual_dag_warning_history.h index c2ec823fd..fee55307e 100644 --- a/src/observer/virtual_table/ob_all_virtual_dag_warning_history.h +++ b/src/observer/virtual_table/ob_all_virtual_dag_warning_history.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_DAG_WARNING_HISTORY_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_dblink_info.cpp b/src/observer/virtual_table/ob_all_virtual_dblink_info.cpp index c619b9867..bc9d40caa 100644 --- a/src/observer/virtual_table/ob_all_virtual_dblink_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_dblink_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_dblink_info.h" diff --git a/src/observer/virtual_table/ob_all_virtual_dblink_info.h b/src/observer/virtual_table/ob_all_virtual_dblink_info.h index 5c699566e..1b1c64ede 100644 --- a/src/observer/virtual_table/ob_all_virtual_dblink_info.h +++ b/src/observer/virtual_table/ob_all_virtual_dblink_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_DBLINK_INFO_H_ @@ -102,4 +106,4 @@ class ObAllVirtualDblinkInfo : public common::ObVirtualTableScannerIterator } // namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/src/observer/virtual_table/ob_all_virtual_ddl_diagnose_info.cpp b/src/observer/virtual_table/ob_all_virtual_ddl_diagnose_info.cpp index 5cd37e3ed..4d379c740 100644 --- a/src/observer/virtual_table/ob_all_virtual_ddl_diagnose_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_ddl_diagnose_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE @@ -426,4 +430,4 @@ int ObAllVirtualDDLDiagnoseInfo::collect_task_gmt_create_time() }// observer -}// oceanbase \ No newline at end of file +}// oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_ddl_diagnose_info.h b/src/observer/virtual_table/ob_all_virtual_ddl_diagnose_info.h index c377b5a3e..a2d2dd2ce 100644 --- a/src/observer/virtual_table/ob_all_virtual_ddl_diagnose_info.h +++ b/src/observer/virtual_table/ob_all_virtual_ddl_diagnose_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_DDL_DIAGNOSE_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_ddl_sim_point_stat.cpp b/src/observer/virtual_table/ob_all_virtual_ddl_sim_point_stat.cpp index 496c52fee..55e665b91 100644 --- a/src/observer/virtual_table/ob_all_virtual_ddl_sim_point_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_ddl_sim_point_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ diff --git a/src/observer/virtual_table/ob_all_virtual_ddl_sim_point_stat.h b/src/observer/virtual_table/ob_all_virtual_ddl_sim_point_stat.h index cca0364f1..01d1e7ec8 100644 --- a/src/observer/virtual_table/ob_all_virtual_ddl_sim_point_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_ddl_sim_point_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_DDL_SIM_POINT_STAT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_diag_index_scan.cpp b/src/observer/virtual_table/ob_all_virtual_diag_index_scan.cpp index 1614e3e9f..72dfda9ef 100644 --- a/src/observer/virtual_table/ob_all_virtual_diag_index_scan.cpp +++ b/src/observer/virtual_table/ob_all_virtual_diag_index_scan.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_diag_index_scan.h" diff --git a/src/observer/virtual_table/ob_all_virtual_diag_index_scan.h b/src/observer/virtual_table/ob_all_virtual_diag_index_scan.h index cd49487d6..95980a08e 100644 --- a/src/observer/virtual_table/ob_all_virtual_diag_index_scan.h +++ b/src/observer/virtual_table/ob_all_virtual_diag_index_scan.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_DIAG_INDEX_SCAN_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_dml_stats.cpp b/src/observer/virtual_table/ob_all_virtual_dml_stats.cpp index ba5cd76df..257fe8887 100644 --- a/src/observer/virtual_table/ob_all_virtual_dml_stats.cpp +++ b/src/observer/virtual_table/ob_all_virtual_dml_stats.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_dml_stats.h" diff --git a/src/observer/virtual_table/ob_all_virtual_dml_stats.h b/src/observer/virtual_table/ob_all_virtual_dml_stats.h index 66c2a6a42..40017aaf4 100644 --- a/src/observer/virtual_table/ob_all_virtual_dml_stats.h +++ b/src/observer/virtual_table/ob_all_virtual_dml_stats.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_DML_STATS_H diff --git a/src/observer/virtual_table/ob_all_virtual_dtl_channel.cpp b/src/observer/virtual_table/ob_all_virtual_dtl_channel.cpp index f9396ddcb..4bec39ed3 100644 --- a/src/observer/virtual_table/ob_all_virtual_dtl_channel.cpp +++ b/src/observer/virtual_table/ob_all_virtual_dtl_channel.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_DTL diff --git a/src/observer/virtual_table/ob_all_virtual_dtl_channel.h b/src/observer/virtual_table/ob_all_virtual_dtl_channel.h index ef7c8464f..cc7f7215c 100644 --- a/src/observer/virtual_table/ob_all_virtual_dtl_channel.h +++ b/src/observer/virtual_table/ob_all_virtual_dtl_channel.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_DTL_CHANNEL_H diff --git a/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.cpp b/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.cpp index d937691f1..6f1130e53 100644 --- a/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.cpp +++ b/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_DTL diff --git a/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.h b/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.h index 28e92f09d..2137d3cf0 100644 --- a/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.h +++ b/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_DTL_FIRST_CACHED_BUFFER_H diff --git a/src/observer/virtual_table/ob_all_virtual_dtl_interm_result_monitor.cpp b/src/observer/virtual_table/ob_all_virtual_dtl_interm_result_monitor.cpp index cbc7e9faa..e8de9941c 100644 --- a/src/observer/virtual_table/ob_all_virtual_dtl_interm_result_monitor.cpp +++ b/src/observer/virtual_table/ob_all_virtual_dtl_interm_result_monitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_dtl_interm_result_monitor.h" diff --git a/src/observer/virtual_table/ob_all_virtual_dtl_interm_result_monitor.h b/src/observer/virtual_table/ob_all_virtual_dtl_interm_result_monitor.h index 3d32e0151..5ce890b88 100644 --- a/src/observer/virtual_table/ob_all_virtual_dtl_interm_result_monitor.h +++ b/src/observer/virtual_table/ob_all_virtual_dtl_interm_result_monitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_ALL_DTL_INTERM_RESULT_MONITOR_ diff --git a/src/observer/virtual_table/ob_all_virtual_dtl_memory.cpp b/src/observer/virtual_table/ob_all_virtual_dtl_memory.cpp index b5f1aa57c..a0a2466f4 100644 --- a/src/observer/virtual_table/ob_all_virtual_dtl_memory.cpp +++ b/src/observer/virtual_table/ob_all_virtual_dtl_memory.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_DTL diff --git a/src/observer/virtual_table/ob_all_virtual_dtl_memory.h b/src/observer/virtual_table/ob_all_virtual_dtl_memory.h index b27bb7f2d..fa1de457b 100644 --- a/src/observer/virtual_table/ob_all_virtual_dtl_memory.h +++ b/src/observer/virtual_table/ob_all_virtual_dtl_memory.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_DTL_MEMORY_H @@ -121,4 +125,4 @@ class ObAllVirtualDtlMemory : public common::ObVirtualTableScannerIterator } /* namespace observer */ } /* namespace oceanbase */ -#endif /* OB_ALL_VIRTUAL_DTL_MEMORY_H */ \ No newline at end of file +#endif /* OB_ALL_VIRTUAL_DTL_MEMORY_H */ diff --git a/src/observer/virtual_table/ob_all_virtual_dump_tenant_info.cpp b/src/observer/virtual_table/ob_all_virtual_dump_tenant_info.cpp index 4606ed203..fcab10cbd 100644 --- a/src/observer/virtual_table/ob_all_virtual_dump_tenant_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_dump_tenant_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/ob_server_struct.h" diff --git a/src/observer/virtual_table/ob_all_virtual_dump_tenant_info.h b/src/observer/virtual_table/ob_all_virtual_dump_tenant_info.h index 0f6177a5b..572ec3448 100644 --- a/src/observer/virtual_table/ob_all_virtual_dump_tenant_info.h +++ b/src/observer/virtual_table/ob_all_virtual_dump_tenant_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_DUMP_TENANT_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_dynamic_partition_table.cpp b/src/observer/virtual_table/ob_all_virtual_dynamic_partition_table.cpp index da2f66019..214b68260 100644 --- a/src/observer/virtual_table/ob_all_virtual_dynamic_partition_table.cpp +++ b/src/observer/virtual_table/ob_all_virtual_dynamic_partition_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_dynamic_partition_table.h" diff --git a/src/observer/virtual_table/ob_all_virtual_dynamic_partition_table.h b/src/observer/virtual_table/ob_all_virtual_dynamic_partition_table.h index f63aa2385..af125c233 100644 --- a/src/observer/virtual_table/ob_all_virtual_dynamic_partition_table.h +++ b/src/observer/virtual_table/ob_all_virtual_dynamic_partition_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_ALL_VIRTUAL_DYNAMIC_PARTITION_TABLE_ diff --git a/src/observer/virtual_table/ob_all_virtual_engine_table.cpp b/src/observer/virtual_table/ob_all_virtual_engine_table.cpp index 14e27292a..91202848d 100644 --- a/src/observer/virtual_table/ob_all_virtual_engine_table.cpp +++ b/src/observer/virtual_table/ob_all_virtual_engine_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_engine_table.h" diff --git a/src/observer/virtual_table/ob_all_virtual_engine_table.h b/src/observer/virtual_table/ob_all_virtual_engine_table.h index 4f46a8ca0..7875424d1 100644 --- a/src/observer/virtual_table/ob_all_virtual_engine_table.h +++ b/src/observer/virtual_table/ob_all_virtual_engine_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_ALL_VIRTUAL_ENGINE_TABLE_ diff --git a/src/observer/virtual_table/ob_all_virtual_files_table.cpp b/src/observer/virtual_table/ob_all_virtual_files_table.cpp index f245db32a..2d743468c 100644 --- a/src/observer/virtual_table/ob_all_virtual_files_table.cpp +++ b/src/observer/virtual_table/ob_all_virtual_files_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_files_table.h" diff --git a/src/observer/virtual_table/ob_all_virtual_files_table.h b/src/observer/virtual_table/ob_all_virtual_files_table.h index edbcbf159..4a0fa4f9b 100644 --- a/src/observer/virtual_table/ob_all_virtual_files_table.h +++ b/src/observer/virtual_table/ob_all_virtual_files_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_ALL_VIRTUAL_FILES_TABLE_ diff --git a/src/observer/virtual_table/ob_all_virtual_ha_diagnose.cpp b/src/observer/virtual_table/ob_all_virtual_ha_diagnose.cpp index 9d0548807..49960805e 100644 --- a/src/observer/virtual_table/ob_all_virtual_ha_diagnose.cpp +++ b/src/observer/virtual_table/ob_all_virtual_ha_diagnose.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_ha_diagnose.h" @@ -195,7 +199,7 @@ int ObAllVirtualHADiagnose::insert_stat_(storage::DiagnoseInfo &diagnose_info) case GC_START_TS: cur_row_.cells_[i].set_int(-1); break; - //TODO: @keqing.llt archive_scn列目前只占位 + //TODO: @keqing.llt archive_scn column is currently just a placeholder case ARCHIVE_SCN: cur_row_.cells_[i].set_uint64(0); break; diff --git a/src/observer/virtual_table/ob_all_virtual_ha_diagnose.h b/src/observer/virtual_table/ob_all_virtual_ha_diagnose.h index df34146cb..fe75cc791 100644 --- a/src/observer/virtual_table/ob_all_virtual_ha_diagnose.h +++ b/src/observer/virtual_table/ob_all_virtual_ha_diagnose.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_ALL_VIRTUAL_HA_DIAGNOSE_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_id_service.cpp b/src/observer/virtual_table/ob_all_virtual_id_service.cpp index bf058fc3c..c05c5b726 100644 --- a/src/observer/virtual_table/ob_all_virtual_id_service.cpp +++ b/src/observer/virtual_table/ob_all_virtual_id_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_id_service.h" diff --git a/src/observer/virtual_table/ob_all_virtual_id_service.h b/src/observer/virtual_table/ob_all_virtual_id_service.h index 062b6555a..04ea125de 100644 --- a/src/observer/virtual_table/ob_all_virtual_id_service.h +++ b/src/observer/virtual_table/ob_all_virtual_id_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_ID_SERVICE_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_io_stat.cpp b/src/observer/virtual_table/ob_all_virtual_io_stat.cpp index 7674ba780..891a003c7 100644 --- a/src/observer/virtual_table/ob_all_virtual_io_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_io_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_io_stat.h" diff --git a/src/observer/virtual_table/ob_all_virtual_io_stat.h b/src/observer/virtual_table/ob_all_virtual_io_stat.h index cc64c3156..7e040b251 100644 --- a/src/observer/virtual_table/ob_all_virtual_io_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_io_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_IO_STAT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_io_status.cpp b/src/observer/virtual_table/ob_all_virtual_io_status.cpp index 54ef22b16..c17c19dd3 100644 --- a/src/observer/virtual_table/ob_all_virtual_io_status.cpp +++ b/src/observer/virtual_table/ob_all_virtual_io_status.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_virtual_io_status.h b/src/observer/virtual_table/ob_all_virtual_io_status.h index b5b533cfb..a5283916b 100644 --- a/src/observer/virtual_table/ob_all_virtual_io_status.h +++ b/src/observer/virtual_table/ob_all_virtual_io_status.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_IO_STATUS_H diff --git a/src/observer/virtual_table/ob_all_virtual_kv_client_info.cpp b/src/observer/virtual_table/ob_all_virtual_kv_client_info.cpp index 8204326e4..310ef509a 100644 --- a/src/observer/virtual_table/ob_all_virtual_kv_client_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_kv_client_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -163,4 +167,4 @@ int ObAllVirtualKvClientInfo::process_curr_tenant(ObNewRow *&row) } } //namespace observer -} //namespace oceanbase \ No newline at end of file +} //namespace oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_kv_client_info.h b/src/observer/virtual_table/ob_all_virtual_kv_client_info.h index b4d535b45..631fe3735 100644 --- a/src/observer/virtual_table/ob_all_virtual_kv_client_info.h +++ b/src/observer/virtual_table/ob_all_virtual_kv_client_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_KV_CLIENT_INFO_H_ #define OB_ALL_VIRTUAL_KV_CLIENT_INFO_H_ @@ -74,4 +78,4 @@ class ObAllVirtualKvClientInfo : public common::ObVirtualTableScannerIterator, } /* namespace observer */ } /* namespace oceanbase */ -#endif \ No newline at end of file +#endif diff --git a/src/observer/virtual_table/ob_all_virtual_kv_connection.cpp b/src/observer/virtual_table/ob_all_virtual_kv_connection.cpp index b9c78702f..7c3941b16 100644 --- a/src/observer/virtual_table/ob_all_virtual_kv_connection.cpp +++ b/src/observer/virtual_table/ob_all_virtual_kv_connection.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_kv_connection.h" @@ -208,4 +212,4 @@ int ObAllVirtualKvConnection::FillScanner::init(ObIAllocator *allocator, } //namespace observer -} //namespace oceanbase \ No newline at end of file +} //namespace oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_kv_connection.h b/src/observer/virtual_table/ob_all_virtual_kv_connection.h index 10575f71a..651367db4 100644 --- a/src/observer/virtual_table/ob_all_virtual_kv_connection.h +++ b/src/observer/virtual_table/ob_all_virtual_kv_connection.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_KV_CONNECTION_H_ #define OB_ALL_VIRTUAL_KV_CONNECTION_H_ @@ -78,4 +82,4 @@ class ObAllVirtualKvConnection : public common::ObVirtualTableScannerIterator } /* namespace observer */ } /* namespace oceanbase */ -#endif \ No newline at end of file +#endif diff --git a/src/observer/virtual_table/ob_all_virtual_kv_group_commit_info.cpp b/src/observer/virtual_table/ob_all_virtual_kv_group_commit_info.cpp index 46bcf0284..091d4aead 100644 --- a/src/observer/virtual_table/ob_all_virtual_kv_group_commit_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_kv_group_commit_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -127,4 +131,4 @@ int ObAllVirtualKvGroupCommitInfo::process_curr_tenant(ObNewRow *&row) } } //namespace observer -} //namespace oceanbase \ No newline at end of file +} //namespace oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_kv_group_commit_info.h b/src/observer/virtual_table/ob_all_virtual_kv_group_commit_info.h index 4b58f77df..d90e8ad8a 100644 --- a/src/observer/virtual_table/ob_all_virtual_kv_group_commit_info.h +++ b/src/observer/virtual_table/ob_all_virtual_kv_group_commit_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_KV_GROUP_COMMIT_INFO_H_ #define OB_ALL_VIRTUAL_KV_GROUP_COMMIT_INFO_H_ @@ -61,4 +65,4 @@ class ObAllVirtualKvGroupCommitInfo : public common::ObVirtualTableScannerIterat } /* namespace observer */ } /* namespace oceanbase */ -#endif \ No newline at end of file +#endif diff --git a/src/observer/virtual_table/ob_all_virtual_kvcache_store_memblock.cpp b/src/observer/virtual_table/ob_all_virtual_kvcache_store_memblock.cpp index fbc456fa3..4fbc4ff3b 100644 --- a/src/observer/virtual_table/ob_all_virtual_kvcache_store_memblock.cpp +++ b/src/observer/virtual_table/ob_all_virtual_kvcache_store_memblock.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_kvcache_store_memblock.h" @@ -197,4 +201,4 @@ int ObAllVirtualKVCacheStoreMemblock::process_row(const ObKVCacheStoreMemblockIn } } // observer -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_kvcache_store_memblock.h b/src/observer/virtual_table/ob_all_virtual_kvcache_store_memblock.h index 8ef923864..7c6753a51 100644 --- a/src/observer/virtual_table/ob_all_virtual_kvcache_store_memblock.h +++ b/src/observer/virtual_table/ob_all_virtual_kvcache_store_memblock.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_KVCACHE_STORE_MEMBLOCK_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_load_data_stat.cpp b/src/observer/virtual_table/ob_all_virtual_load_data_stat.cpp index 2a4ad4833..8ae4d1900 100644 --- a/src/observer/virtual_table/ob_all_virtual_load_data_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_load_data_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_load_data_stat.h" @@ -127,7 +131,7 @@ int ObAllVirtualLoadDataStat::inner_get_next_row(ObNewRow *&row) cells[i].set_int(job_status->load_mode_); break; } - case LOAD_TIME: {//当前导入数据已经花费的秒数 + case LOAD_TIME: {//The number of seconds already spent importing data int64_t current_time = common::ObTimeUtility::current_time(); cells[i].set_int((current_time - job_status->start_time_) / 1000000L); break; diff --git a/src/observer/virtual_table/ob_all_virtual_load_data_stat.h b/src/observer/virtual_table/ob_all_virtual_load_data_stat.h index 37bc7cb42..38f06f5f5 100644 --- a/src/observer/virtual_table/ob_all_virtual_load_data_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_load_data_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_LOAD_DATA_STAT_H_ @@ -93,4 +97,4 @@ class ObAllVirtualLoadDataStat : public common::ObVirtualTableScannerIterator } } -#endif /* OB_ALL_VIRTUAL_LOAD_DATA_STAT_H_*/ \ No newline at end of file +#endif /* OB_ALL_VIRTUAL_LOAD_DATA_STAT_H_*/ diff --git a/src/observer/virtual_table/ob_all_virtual_lock_wait_stat.cpp b/src/observer/virtual_table/ob_all_virtual_lock_wait_stat.cpp index b353e45d5..f1cfeb231 100644 --- a/src/observer/virtual_table/ob_all_virtual_lock_wait_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_lock_wait_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_lock_wait_stat.h" diff --git a/src/observer/virtual_table/ob_all_virtual_lock_wait_stat.h b/src/observer/virtual_table/ob_all_virtual_lock_wait_stat.h index 57304a99b..629774ba2 100644 --- a/src/observer/virtual_table/ob_all_virtual_lock_wait_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_lock_wait_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_LOCK_WAIT_STAT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_log_stat.cpp b/src/observer/virtual_table/ob_all_virtual_log_stat.cpp index a756bcd2d..09fc32a7b 100644 --- a/src/observer/virtual_table/ob_all_virtual_log_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_log_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_log_stat.h" diff --git a/src/observer/virtual_table/ob_all_virtual_log_stat.h b/src/observer/virtual_table/ob_all_virtual_log_stat.h index b9bee8d0d..f447101bd 100644 --- a/src/observer/virtual_table/ob_all_virtual_log_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_log_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_PALF_STAT_ diff --git a/src/observer/virtual_table/ob_all_virtual_log_transport_dest_stat.cpp b/src/observer/virtual_table/ob_all_virtual_log_transport_dest_stat.cpp index b5bd4297e..d206b3b8c 100644 --- a/src/observer/virtual_table/ob_all_virtual_log_transport_dest_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_log_transport_dest_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_log_transport_dest_stat.h" @@ -31,4 +35,4 @@ int ObAllVirtualLogTransportDestStat::inner_get_next_row(common::ObNewRow *&row) void ObAllVirtualLogTransportDestStat::destroy() {} } -} \ No newline at end of file +} diff --git a/src/observer/virtual_table/ob_all_virtual_log_transport_dest_stat.h b/src/observer/virtual_table/ob_all_virtual_log_transport_dest_stat.h index 332a97664..100606c12 100644 --- a/src/observer/virtual_table/ob_all_virtual_log_transport_dest_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_log_transport_dest_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_LOG_TRANSPORT_DEST_STAT_H_ @@ -34,4 +38,4 @@ class ObAllVirtualLogTransportDestStat: public common::ObVirtualTableScannerIter } } -#endif \ No newline at end of file +#endif diff --git a/src/observer/virtual_table/ob_all_virtual_long_ops_status.cpp b/src/observer/virtual_table/ob_all_virtual_long_ops_status.cpp index 8497e4ac2..22846fd40 100644 --- a/src/observer/virtual_table/ob_all_virtual_long_ops_status.cpp +++ b/src/observer/virtual_table/ob_all_virtual_long_ops_status.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/src/observer/virtual_table/ob_all_virtual_long_ops_status.h b/src/observer/virtual_table/ob_all_virtual_long_ops_status.h index 483744e2c..585d375ef 100644 --- a/src/observer/virtual_table/ob_all_virtual_long_ops_status.h +++ b/src/observer/virtual_table/ob_all_virtual_long_ops_status.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_LONG_OPS_STATUS_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_ls_archive_stat.cpp b/src/observer/virtual_table/ob_all_virtual_ls_archive_stat.cpp index 3a3d4eb6e..870b15fd5 100644 --- a/src/observer/virtual_table/ob_all_virtual_ls_archive_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_ls_archive_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_ls_archive_stat.h" diff --git a/src/observer/virtual_table/ob_all_virtual_ls_archive_stat.h b/src/observer/virtual_table/ob_all_virtual_ls_archive_stat.h index cc5d51ae2..cb13b4b0c 100644 --- a/src/observer/virtual_table/ob_all_virtual_ls_archive_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_ls_archive_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_ALL_VIRTUAL_LS_ARCHIVE_STAT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_ls_info.cpp b/src/observer/virtual_table/ob_all_virtual_ls_info.cpp index 4b75343e8..a45701ca2 100644 --- a/src/observer/virtual_table/ob_all_virtual_ls_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_ls_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_ls_info.h" @@ -35,7 +39,7 @@ ObAllVirtualLSInfo::~ObAllVirtualLSInfo() void ObAllVirtualLSInfo::reset() { - // 注意这里跨租户资源必须由ObMultiTenantOperator释放, 因此必须放在最前面调用 + // Note that cross-tenant resources must be released by ObMultiTenantOperator, therefore it must be called first omt::ObMultiTenantOperator::reset(); addr_.reset(); ObVirtualTableScannerIterator::reset(); diff --git a/src/observer/virtual_table/ob_all_virtual_ls_info.h b/src/observer/virtual_table/ob_all_virtual_ls_info.h index eb005701b..3aea2b421 100644 --- a/src/observer/virtual_table/ob_all_virtual_ls_info.h +++ b/src/observer/virtual_table/ob_all_virtual_ls_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_OB_LS_INFO_H_ @@ -36,11 +40,11 @@ class ObAllVirtualLSInfo : public common::ObVirtualTableScannerIterator, addr_ = addr; } private: - // 过滤得到需要处理的租户 + // Filter to get the tenants that need processing virtual bool is_need_process(uint64_t tenant_id) override; - // 处理当前迭代的租户 + // Process the tenant of the current iteration virtual int process_curr_tenant(common::ObNewRow *&row) override; - // 释放上一个租户的资源 + // Release the resources of the previous tenant virtual void release_last_tenant() override; private: int next_ls_info_(ObLSVTInfo &ls_info); @@ -48,7 +52,7 @@ class ObAllVirtualLSInfo : public common::ObVirtualTableScannerIterator, common::ObAddr addr_; char ip_buf_[common::OB_IP_STR_BUFF]; char state_name_[common::MAX_LS_STATE_LENGTH]; - /* 跨租户访问的资源必须由ObMultiTenantOperator来处理释放*/ + /* The resources for cross-tenant access must be handled and released by ObMultiTenantOperator */ int64_t ls_id_; ObSharedGuard ls_iter_guard_; private: diff --git a/src/observer/virtual_table/ob_all_virtual_ls_log_restore_status.cpp b/src/observer/virtual_table/ob_all_virtual_ls_log_restore_status.cpp index a2d53b4ba..133c0800e 100644 --- a/src/observer/virtual_table/ob_all_virtual_ls_log_restore_status.cpp +++ b/src/observer/virtual_table/ob_all_virtual_ls_log_restore_status.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -41,4 +45,4 @@ int ObVirtualLSLogRestoreStatus::inner_get_next_row(common::ObNewRow *&row) void ObVirtualLSLogRestoreStatus::destroy() {} } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_ls_log_restore_status.h b/src/observer/virtual_table/ob_all_virtual_ls_log_restore_status.h index 6cc641b1a..8091e70f7 100644 --- a/src/observer/virtual_table/ob_all_virtual_ls_log_restore_status.h +++ b/src/observer/virtual_table/ob_all_virtual_ls_log_restore_status.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_ALL_VIRTUAL_LS_LOG_RESTORE_STATUS_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_ls_snapshot.cpp b/src/observer/virtual_table/ob_all_virtual_ls_snapshot.cpp index a23115c7b..bcfd8649c 100644 --- a/src/observer/virtual_table/ob_all_virtual_ls_snapshot.cpp +++ b/src/observer/virtual_table/ob_all_virtual_ls_snapshot.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_ls_snapshot.h" diff --git a/src/observer/virtual_table/ob_all_virtual_ls_snapshot.h b/src/observer/virtual_table/ob_all_virtual_ls_snapshot.h index c3c74de76..76e4b1b3c 100644 --- a/src/observer/virtual_table/ob_all_virtual_ls_snapshot.h +++ b/src/observer/virtual_table/ob_all_virtual_ls_snapshot.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_OBSERVER_OB_ALL_VIRTUAL_LS_SNAPSHOT_IN_STORAGE_NODE_H diff --git a/src/observer/virtual_table/ob_all_virtual_macro_block_marker_status.cpp b/src/observer/virtual_table/ob_all_virtual_macro_block_marker_status.cpp index ae35e920e..bf1b4f2ca 100644 --- a/src/observer/virtual_table/ob_all_virtual_macro_block_marker_status.cpp +++ b/src/observer/virtual_table/ob_all_virtual_macro_block_marker_status.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_macro_block_marker_status.h" diff --git a/src/observer/virtual_table/ob_all_virtual_macro_block_marker_status.h b/src/observer/virtual_table/ob_all_virtual_macro_block_marker_status.h index 0237a862a..6552afc00 100644 --- a/src/observer/virtual_table/ob_all_virtual_macro_block_marker_status.h +++ b/src/observer/virtual_table/ob_all_virtual_macro_block_marker_status.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_MACRO_BLOCK_MARKER_STATUS_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_malloc_sample_info.cpp b/src/observer/virtual_table/ob_all_virtual_malloc_sample_info.cpp index 11623b186..b342c9a22 100644 --- a/src/observer/virtual_table/ob_all_virtual_malloc_sample_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_malloc_sample_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_malloc_sample_info.h" diff --git a/src/observer/virtual_table/ob_all_virtual_malloc_sample_info.h b/src/observer/virtual_table/ob_all_virtual_malloc_sample_info.h index fc7b4f364..c319fc382 100644 --- a/src/observer/virtual_table/ob_all_virtual_malloc_sample_info.h +++ b/src/observer/virtual_table/ob_all_virtual_malloc_sample_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_MALLOC_SAMPLE_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_mds_event_history.cpp b/src/observer/virtual_table/ob_all_virtual_mds_event_history.cpp index f3044d23e..ef6f2df88 100644 --- a/src/observer/virtual_table/ob_all_virtual_mds_event_history.cpp +++ b/src/observer/virtual_table/ob_all_virtual_mds_event_history.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_mds_event_history.h" @@ -85,8 +89,8 @@ int ObAllVirtualMdsEventHistory::range_scan_(char *temp_buffer, int64_t buf_len) int ret = OB_SUCCESS; int tmp_ret = OB_SUCCESS; if (judge_key_in_ranges_(key)) { - if (MTL_ID() == OB_SYS_TENANT_ID ||// SYS租户可以看到所有租户的信息 - key.tenant_id_ == MTL_ID()) {// 非SYS租户只能看到本租户的信息 + if (MTL_ID() == OB_SYS_TENANT_ID ||// SYS tenant can see information of all tenants + key.tenant_id_ == MTL_ID()) {// Non-SYS tenant can only see information of its own tenant MAKE_TENANT_SWITCH_SCOPE_GUARD(guard); if (MTL_ID() != key.tenant_id_) { tmp_ret = guard.switch_to(key.tenant_id_); @@ -121,8 +125,8 @@ int ObAllVirtualMdsEventHistory::point_read_(char *temp_buffer, int64_t buf_len) if (OB_FAIL(ObMdsEventBuffer::for_each(key, [&key, this, temp_buffer, buf_len](const MdsEvent &event) -> int { int ret = OB_SUCCESS; int tmp_ret = OB_SUCCESS; - if (MTL_ID() == OB_SYS_TENANT_ID ||// SYS租户可以看到所有租户的信息 - key.tenant_id_ == MTL_ID()) {// 非SYS租户只能看到本租户的信息 + if (MTL_ID() == OB_SYS_TENANT_ID ||// SYS tenant can see information of all tenants + key.tenant_id_ == MTL_ID()) {// Non-SYS tenant can only see information of its own tenant MAKE_TENANT_SWITCH_SCOPE_GUARD(guard); if (MTL_ID() != key.tenant_id_) { tmp_ret = guard.switch_to(key.tenant_id_); @@ -392,4 +396,4 @@ int ObAllVirtualMdsEventHistory::get_primary_key_ranges_() } } -} \ No newline at end of file +} diff --git a/src/observer/virtual_table/ob_all_virtual_mds_event_history.h b/src/observer/virtual_table/ob_all_virtual_mds_event_history.h index daab5b0e4..857a3ecee 100644 --- a/src/observer/virtual_table/ob_all_virtual_mds_event_history.h +++ b/src/observer/virtual_table/ob_all_virtual_mds_event_history.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_MDS_EVENT_HISTORY_H diff --git a/src/observer/virtual_table/ob_all_virtual_mds_node_stat.cpp b/src/observer/virtual_table/ob_all_virtual_mds_node_stat.cpp index eed0c2916..2a62e8140 100644 --- a/src/observer/virtual_table/ob_all_virtual_mds_node_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_mds_node_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_mds_node_stat.h" diff --git a/src/observer/virtual_table/ob_all_virtual_mds_node_stat.h b/src/observer/virtual_table/ob_all_virtual_mds_node_stat.h index b730db86b..9069787a2 100644 --- a/src/observer/virtual_table/ob_all_virtual_mds_node_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_mds_node_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_MDS__NODE_STAT_H diff --git a/src/observer/virtual_table/ob_all_virtual_memory_context_stat.cpp b/src/observer/virtual_table/ob_all_virtual_memory_context_stat.cpp index 1896fdf8b..a45da1822 100644 --- a/src/observer/virtual_table/ob_all_virtual_memory_context_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_memory_context_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_memory_context_stat.h" diff --git a/src/observer/virtual_table/ob_all_virtual_memory_context_stat.h b/src/observer/virtual_table/ob_all_virtual_memory_context_stat.h index d35d00131..66fb49290 100644 --- a/src/observer/virtual_table/ob_all_virtual_memory_context_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_memory_context_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_MEMORY_CONTEXT_STAT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_memory_info.cpp b/src/observer/virtual_table/ob_all_virtual_memory_info.cpp index 2374d6c60..1e0dfdb35 100644 --- a/src/observer/virtual_table/ob_all_virtual_memory_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_memory_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_memory_info.h" @@ -98,7 +102,7 @@ int ObAllVirtualMemoryInfo::inner_get_next_row(ObNewRow *&row) break; } case MOD_ID: { - // MOD_ID废弃,为兼容工具而保留 + // MOD_ID deprecated, retained for tool compatibility cells[i].set_int(0); break; } @@ -143,7 +147,7 @@ int ObAllVirtualMemoryInfo::inner_get_next_row(ObNewRow *&row) } } // iter column end if (OB_SUCC(ret)) { - // scanner最大支持64M,因此暂不考虑溢出的情况 + // scanner maximum supports 64M, therefore overflow is not considered for now if (OB_FAIL(scanner_.add_row(cur_row_))) { SERVER_LOG(WARN, "fail to add row", K(ret), K(cur_row_)); if (OB_SIZE_OVERFLOW == ret) { diff --git a/src/observer/virtual_table/ob_all_virtual_memory_info.h b/src/observer/virtual_table/ob_all_virtual_memory_info.h index d44ec6a3b..b83e69dc2 100644 --- a/src/observer/virtual_table/ob_all_virtual_memory_info.h +++ b/src/observer/virtual_table/ob_all_virtual_memory_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_MEMORY_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_memstore_info.cpp b/src/observer/virtual_table/ob_all_virtual_memstore_info.cpp index ed9078023..5a04c5f74 100644 --- a/src/observer/virtual_table/ob_all_virtual_memstore_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_memstore_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_memstore_info.h" diff --git a/src/observer/virtual_table/ob_all_virtual_memstore_info.h b/src/observer/virtual_table/ob_all_virtual_memstore_info.h index acec59a1d..b20e96ace 100644 --- a/src/observer/virtual_table/ob_all_virtual_memstore_info.h +++ b/src/observer/virtual_table/ob_all_virtual_memstore_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_MEMSTORE_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_minor_freeze_info.cpp b/src/observer/virtual_table/ob_all_virtual_minor_freeze_info.cpp index c884ff6ce..75a444d4f 100644 --- a/src/observer/virtual_table/ob_all_virtual_minor_freeze_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_minor_freeze_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_minor_freeze_info.h" diff --git a/src/observer/virtual_table/ob_all_virtual_minor_freeze_info.h b/src/observer/virtual_table/ob_all_virtual_minor_freeze_info.h index e92d2fe73..c0ef9a839 100644 --- a/src/observer/virtual_table/ob_all_virtual_minor_freeze_info.h +++ b/src/observer/virtual_table/ob_all_virtual_minor_freeze_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_MINOR_FREEZE_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_nic_info.cpp b/src/observer/virtual_table/ob_all_virtual_nic_info.cpp index 9a541fd6c..55ea8af2d 100644 --- a/src/observer/virtual_table/ob_all_virtual_nic_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_nic_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_nic_info.h" @@ -123,4 +127,4 @@ int ObAllVirtualNicInfo::inner_get_next_row(common::ObNewRow *&row) } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_nic_info.h b/src/observer/virtual_table/ob_all_virtual_nic_info.h index 5dda4f893..19d8e7d72 100644 --- a/src/observer/virtual_table/ob_all_virtual_nic_info.h +++ b/src/observer/virtual_table/ob_all_virtual_nic_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_NIC_INFO_ diff --git a/src/observer/virtual_table/ob_all_virtual_obj_lock.cpp b/src/observer/virtual_table/ob_all_virtual_obj_lock.cpp index addee73b9..e94d20f50 100644 --- a/src/observer/virtual_table/ob_all_virtual_obj_lock.cpp +++ b/src/observer/virtual_table/ob_all_virtual_obj_lock.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_obj_lock.h" diff --git a/src/observer/virtual_table/ob_all_virtual_obj_lock.h b/src/observer/virtual_table/ob_all_virtual_obj_lock.h index e10aec305..6a2f99e81 100644 --- a/src/observer/virtual_table/ob_all_virtual_obj_lock.h +++ b/src/observer/virtual_table/ob_all_virtual_obj_lock.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_OB_OBJ_LOCK_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_opt_stat_gather_monitor.cpp b/src/observer/virtual_table/ob_all_virtual_opt_stat_gather_monitor.cpp index 3b7757ca6..399e8622f 100644 --- a/src/observer/virtual_table/ob_all_virtual_opt_stat_gather_monitor.cpp +++ b/src/observer/virtual_table/ob_all_virtual_opt_stat_gather_monitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_opt_stat_gather_monitor.h" @@ -184,4 +188,4 @@ int ObAllVirtualOptStatGatherMonitor::inner_get_next_row(ObNewRow *&row) } }/* ns observer*/ -}/* ns oceanbase */ \ No newline at end of file +}/* ns oceanbase */ diff --git a/src/observer/virtual_table/ob_all_virtual_opt_stat_gather_monitor.h b/src/observer/virtual_table/ob_all_virtual_opt_stat_gather_monitor.h index 60a9b39d1..3200b06d0 100644 --- a/src/observer/virtual_table/ob_all_virtual_opt_stat_gather_monitor.h +++ b/src/observer/virtual_table/ob_all_virtual_opt_stat_gather_monitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_OPT_STAT_GATHER_STAT_H diff --git a/src/observer/virtual_table/ob_all_virtual_plugin_info.cpp b/src/observer/virtual_table/ob_all_virtual_plugin_info.cpp index 0ebd321f8..a367630e3 100644 --- a/src/observer/virtual_table/ob_all_virtual_plugin_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_plugin_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_virtual_plugin_info.h b/src/observer/virtual_table/ob_all_virtual_plugin_info.h index 1a1f9ccb8..1338fd3c0 100644 --- a/src/observer/virtual_table/ob_all_virtual_plugin_info.h +++ b/src/observer/virtual_table/ob_all_virtual_plugin_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #pragma once diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_base.cpp b/src/observer/virtual_table/ob_all_virtual_proxy_base.cpp index 615003f26..226fd536a 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_base.cpp +++ b/src/observer/virtual_table/ob_all_virtual_proxy_base.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_base.h b/src/observer/virtual_table/ob_all_virtual_proxy_base.h index 5482eb5ff..92636e5e5 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_base.h +++ b/src/observer/virtual_table/ob_all_virtual_proxy_base.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_ALL_VIRTUAL_PROXY_BASE_ diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_partition.cpp b/src/observer/virtual_table/ob_all_virtual_proxy_partition.cpp index eb847062f..8bfaa92f7 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_partition.cpp +++ b/src/observer/virtual_table/ob_all_virtual_proxy_partition.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_partition.h b/src/observer/virtual_table/ob_all_virtual_proxy_partition.h index 934a815c1..2b81cf912 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_partition.h +++ b/src/observer/virtual_table/ob_all_virtual_proxy_partition.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_ALL_VIRTUAL_PROXY_PARTITOIN_ diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_partition_info.cpp b/src/observer/virtual_table/ob_all_virtual_proxy_partition_info.cpp index 95519df8a..8d58a8d21 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_partition_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_proxy_partition_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -172,7 +176,7 @@ int ObAllVirtualProxyPartitionInfo::fill_row_(const ObTableSchema &table_schema) ObObj *cells = cur_row_.cells_; int64_t all_part_num = table_schema.get_all_part_num(); const ObPartitionOption &part_option = table_schema.get_part_option(); - const ObPartitionOption &sub_part_option = table_schema.get_sub_part_option(); + const ObSubPartitionOption &sub_part_option = table_schema.get_sub_part_option(); // part key column uint64_t column_id = OB_INVALID_ID; diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_partition_info.h b/src/observer/virtual_table/ob_all_virtual_proxy_partition_info.h index 0d7d52b30..9d864a125 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_partition_info.h +++ b/src/observer/virtual_table/ob_all_virtual_proxy_partition_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_ALL_VIRTUAL_PROXY_PARTITION_INFO_ diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_routine.cpp b/src/observer/virtual_table/ob_all_virtual_proxy_routine.cpp index 739200b11..6aedc645d 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_routine.cpp +++ b/src/observer/virtual_table/ob_all_virtual_proxy_routine.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -380,4 +384,4 @@ int ObAllVirtualProxyRoutine::fill_row_( } } // end of namespace observer -} // end of namespace oceanbase \ No newline at end of file +} // end of namespace oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_routine.h b/src/observer/virtual_table/ob_all_virtual_proxy_routine.h index 92340da9e..cb85ee964 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_routine.h +++ b/src/observer/virtual_table/ob_all_virtual_proxy_routine.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_ALL_VIRTUAL_PROXY_ROUTINE_H @@ -100,4 +104,4 @@ class ObAllVirtualProxyRoutine : public common::ObVirtualTableIterator } // end of namespace observer } // end of namespace oceanbase -#endif // OCEANBASE_OBSERVER_ALL_VIRTUAL_PROXY_ROUTINE_H \ No newline at end of file +#endif // OCEANBASE_OBSERVER_ALL_VIRTUAL_PROXY_ROUTINE_H diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_schema.cpp b/src/observer/virtual_table/ob_all_virtual_proxy_schema.cpp index a4cef47d8..d8496fb46 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_schema.cpp +++ b/src/observer/virtual_table/ob_all_virtual_proxy_schema.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_schema.h b/src/observer/virtual_table/ob_all_virtual_proxy_schema.h index a26c062ac..781801c0c 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_schema.h +++ b/src/observer/virtual_table/ob_all_virtual_proxy_schema.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_ALL_VIRTUAL_PROXY_SCHEMA_ diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_sub_partition.cpp b/src/observer/virtual_table/ob_all_virtual_proxy_sub_partition.cpp index f743f05af..fbf3b2ec7 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_sub_partition.cpp +++ b/src/observer/virtual_table/ob_all_virtual_proxy_sub_partition.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_virtual_proxy_sub_partition.h b/src/observer/virtual_table/ob_all_virtual_proxy_sub_partition.h index d0f8985a4..7d61b246e 100644 --- a/src/observer/virtual_table/ob_all_virtual_proxy_sub_partition.h +++ b/src/observer/virtual_table/ob_all_virtual_proxy_sub_partition.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_ALL_VIRTUAL_PROXY_SUB_PARTITOIN_ diff --git a/src/observer/virtual_table/ob_all_virtual_ps_item_info.cpp b/src/observer/virtual_table/ob_all_virtual_ps_item_info.cpp index a35951899..fc99c3010 100644 --- a/src/observer/virtual_table/ob_all_virtual_ps_item_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_ps_item_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_ps_item_info.h" @@ -258,7 +262,7 @@ int ObAllVirtualPsItemInfo::get_next_row_from_specified_tenant(uint64_t tenant_i if (OB_NOT_NULL(stmt_info)) { if (OB_SUCCESS != (tmp_ret = ps_cache_->deref_stmt_info(stmt_id))) { if (OB_SUCCESS == ret) { - // 如果ret不是OB_SUCCESS,则忽略了tmp_ret + // If ret is not OB_SUCCESS, then tmp_ret is ignored ret = tmp_ret; } SERVER_LOG(WARN, "deref_stmt_info failed", K(tmp_ret), K(stmt_id)); diff --git a/src/observer/virtual_table/ob_all_virtual_ps_item_info.h b/src/observer/virtual_table/ob_all_virtual_ps_item_info.h index e7482adc6..d98ed3d7a 100644 --- a/src/observer/virtual_table/ob_all_virtual_ps_item_info.h +++ b/src/observer/virtual_table/ob_all_virtual_ps_item_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_ALL_VIRTUAL_PS_ITEM_INFO_H diff --git a/src/observer/virtual_table/ob_all_virtual_ps_stat.cpp b/src/observer/virtual_table/ob_all_virtual_ps_stat.cpp index d070a56af..ddc68897d 100644 --- a/src/observer/virtual_table/ob_all_virtual_ps_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_ps_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_ps_stat.h" @@ -66,7 +70,7 @@ int ObAllVirtualPsStat::fill_cells(ObPsCache &ps_cache, uint64_t tenant_id) break; } case share::ALL_VIRTUAL_PS_STAT_CDE::STMT_COUNT: { - // @shaoge 以stmt_id_map的大小作为ps_cache的大小 + // @shaoge use the size of stmt_id_map as the size of ps_cache cells[i].set_int(ps_cache.get_stmt_id_map_size()); break; } diff --git a/src/observer/virtual_table/ob_all_virtual_ps_stat.h b/src/observer/virtual_table/ob_all_virtual_ps_stat.h index 64903cccf..435b97093 100644 --- a/src/observer/virtual_table/ob_all_virtual_ps_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_ps_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_ALL_VIRTUAL_PS_STAT_H diff --git a/src/observer/virtual_table/ob_all_virtual_px_p2p_datahub.cpp b/src/observer/virtual_table/ob_all_virtual_px_p2p_datahub.cpp index cb49eab4b..b29112495 100644 --- a/src/observer/virtual_table/ob_all_virtual_px_p2p_datahub.cpp +++ b/src/observer/virtual_table/ob_all_virtual_px_p2p_datahub.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_px_p2p_datahub.h" diff --git a/src/observer/virtual_table/ob_all_virtual_px_p2p_datahub.h b/src/observer/virtual_table/ob_all_virtual_px_p2p_datahub.h index 8add3f86e..64a10f6d8 100644 --- a/src/observer/virtual_table/ob_all_virtual_px_p2p_datahub.h +++ b/src/observer/virtual_table/ob_all_virtual_px_p2p_datahub.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_ALL_PX_P2P_DATAHUB_TABLE_ diff --git a/src/observer/virtual_table/ob_all_virtual_px_target_monitor.cpp b/src/observer/virtual_table/ob_all_virtual_px_target_monitor.cpp index a55e15f93..b70bbab02 100644 --- a/src/observer/virtual_table/ob_all_virtual_px_target_monitor.cpp +++ b/src/observer/virtual_table/ob_all_virtual_px_target_monitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_virtual_px_target_monitor.h b/src/observer/virtual_table/ob_all_virtual_px_target_monitor.h index bff1627bd..ceefd0451 100644 --- a/src/observer/virtual_table/ob_all_virtual_px_target_monitor.h +++ b/src/observer/virtual_table/ob_all_virtual_px_target_monitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_PX_TARGET_MONITOR_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_px_worker_stat.cpp b/src/observer/virtual_table/ob_all_virtual_px_worker_stat.cpp index c8d4d8c22..7a9c42599 100644 --- a/src/observer/virtual_table/ob_all_virtual_px_worker_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_px_worker_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_px_worker_stat.h" diff --git a/src/observer/virtual_table/ob_all_virtual_px_worker_stat.h b/src/observer/virtual_table/ob_all_virtual_px_worker_stat.h index 0fa6a789d..54a82a7e3 100644 --- a/src/observer/virtual_table/ob_all_virtual_px_worker_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_px_worker_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_ALL_PX_WORKER_STAT_TABLE_ diff --git a/src/observer/virtual_table/ob_all_virtual_raid_stat.cpp b/src/observer/virtual_table/ob_all_virtual_raid_stat.cpp index 18d37f3ed..01a703651 100644 --- a/src/observer/virtual_table/ob_all_virtual_raid_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_raid_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX STORAGE diff --git a/src/observer/virtual_table/ob_all_virtual_raid_stat.h b/src/observer/virtual_table/ob_all_virtual_raid_stat.h index ebf93fb97..0f90fbfb0 100644 --- a/src/observer/virtual_table/ob_all_virtual_raid_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_raid_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_DISK_STAT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_replay_stat.cpp b/src/observer/virtual_table/ob_all_virtual_replay_stat.cpp index 9c5afec8e..de09f038a 100644 --- a/src/observer/virtual_table/ob_all_virtual_replay_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_replay_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_replay_stat.h" diff --git a/src/observer/virtual_table/ob_all_virtual_replay_stat.h b/src/observer/virtual_table/ob_all_virtual_replay_stat.h index 329943a51..133919f16 100644 --- a/src/observer/virtual_table/ob_all_virtual_replay_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_replay_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_ALL_VIRTUAL_REPLAY_STAT_H_ @@ -39,4 +43,4 @@ class ObAllVirtualReplayStat : public common::ObVirtualTableScannerIterator }; } // namespace observer } // namespace oceanbase -#endif /* OCEANBASE_OBSERVER_OB_ALL_VIRTUAL_REPLAY_STAT_H_ */ \ No newline at end of file +#endif /* OCEANBASE_OBSERVER_OB_ALL_VIRTUAL_REPLAY_STAT_H_ */ diff --git a/src/observer/virtual_table/ob_all_virtual_res_mgr_sys_stat.cpp b/src/observer/virtual_table/ob_all_virtual_res_mgr_sys_stat.cpp index 18e1ed2e9..fcf142e4d 100644 --- a/src/observer/virtual_table/ob_all_virtual_res_mgr_sys_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_res_mgr_sys_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -111,16 +115,8 @@ int ObAllVirtualResMgrSysStat::update_all_stats_(const int64_t tenant_id, ObStat stat_events.get(ObStatEventIds::OBLOGGER_WRITE_SIZE - ObStatEventIds::STAT_EVENT_ADD_END -1)->stat_value_ = (OB_SYS_TENANT_ID == tenant_id) ? OB_LOGGER.get_write_size() : 0; - stat_events.get(ObStatEventIds::ELECTION_WRITE_SIZE - ObStatEventIds::STAT_EVENT_ADD_END -1)->stat_value_ = - (OB_SYS_TENANT_ID == tenant_id) ? OB_LOGGER.get_elec_write_size() : 0; - stat_events.get(ObStatEventIds::ROOTSERVICE_WRITE_SIZE - ObStatEventIds::STAT_EVENT_ADD_END -1)->stat_value_ = - (OB_SYS_TENANT_ID == tenant_id) ? OB_LOGGER.get_rs_write_size() : 0; stat_events.get(ObStatEventIds::OBLOGGER_TOTAL_WRITE_COUNT - ObStatEventIds::STAT_EVENT_ADD_END -1)->stat_value_ = (OB_SYS_TENANT_ID == tenant_id) ? OB_LOGGER.get_total_write_count() : 0; - stat_events.get(ObStatEventIds::ELECTION_TOTAL_WRITE_COUNT - ObStatEventIds::STAT_EVENT_ADD_END -1)->stat_value_ = - (OB_SYS_TENANT_ID == tenant_id) ? OB_LOGGER.get_elec_total_write_count() : 0; - stat_events.get(ObStatEventIds::ROOTSERVICE_TOTAL_WRITE_COUNT - ObStatEventIds::STAT_EVENT_ADD_END -1)->stat_value_ = - (OB_SYS_TENANT_ID == tenant_id) ? OB_LOGGER.get_rs_total_write_count() : 0; stat_events.get(ObStatEventIds::ASYNC_ERROR_LOG_DROPPED_COUNT - ObStatEventIds::STAT_EVENT_ADD_END -1)->stat_value_ = (OB_SYS_TENANT_ID == tenant_id) ? OB_LOGGER.get_dropped_error_log_count() : 0; stat_events.get(ObStatEventIds::ASYNC_WARN_LOG_DROPPED_COUNT - ObStatEventIds::STAT_EVENT_ADD_END -1)->stat_value_ = diff --git a/src/observer/virtual_table/ob_all_virtual_res_mgr_sys_stat.h b/src/observer/virtual_table/ob_all_virtual_res_mgr_sys_stat.h index ebfca8f5b..821e65a75 100644 --- a/src/observer/virtual_table/ob_all_virtual_res_mgr_sys_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_res_mgr_sys_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_RES_MGR_SYS_STAT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_schema_memory.cpp b/src/observer/virtual_table/ob_all_virtual_schema_memory.cpp index 6f0c74568..ce27c10e6 100644 --- a/src/observer/virtual_table/ob_all_virtual_schema_memory.cpp +++ b/src/observer/virtual_table/ob_all_virtual_schema_memory.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ # define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_virtual_schema_memory.h b/src/observer/virtual_table/ob_all_virtual_schema_memory.h index 59d2a4e47..a3cdbfb11 100644 --- a/src/observer/virtual_table/ob_all_virtual_schema_memory.h +++ b/src/observer/virtual_table/ob_all_virtual_schema_memory.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SCHEMA_MEMORY_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_schema_slot.cpp b/src/observer/virtual_table/ob_all_virtual_schema_slot.cpp index 7513788ac..72fd23982 100644 --- a/src/observer/virtual_table/ob_all_virtual_schema_slot.cpp +++ b/src/observer/virtual_table/ob_all_virtual_schema_slot.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ # define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_virtual_schema_slot.h b/src/observer/virtual_table/ob_all_virtual_schema_slot.h index 9dcbdd918..931e77352 100644 --- a/src/observer/virtual_table/ob_all_virtual_schema_slot.h +++ b/src/observer/virtual_table/ob_all_virtual_schema_slot.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SCHEMA_SLOT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_server.cpp b/src/observer/virtual_table/ob_all_virtual_server.cpp index 84124f09f..266a4f445 100644 --- a/src/observer/virtual_table/ob_all_virtual_server.cpp +++ b/src/observer/virtual_table/ob_all_virtual_server.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_server.h" diff --git a/src/observer/virtual_table/ob_all_virtual_server.h b/src/observer/virtual_table/ob_all_virtual_server.h index e5dafeb54..c4ec54300 100644 --- a/src/observer/virtual_table/ob_all_virtual_server.h +++ b/src/observer/virtual_table/ob_all_virtual_server.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SERVER_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_server_compaction_event_history.cpp b/src/observer/virtual_table/ob_all_virtual_server_compaction_event_history.cpp index 19c38c4cb..3b36801d6 100644 --- a/src/observer/virtual_table/ob_all_virtual_server_compaction_event_history.cpp +++ b/src/observer/virtual_table/ob_all_virtual_server_compaction_event_history.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_server_compaction_event_history.h" diff --git a/src/observer/virtual_table/ob_all_virtual_server_compaction_event_history.h b/src/observer/virtual_table/ob_all_virtual_server_compaction_event_history.h index 5be0be1f2..fe96e2734 100644 --- a/src/observer/virtual_table/ob_all_virtual_server_compaction_event_history.h +++ b/src/observer/virtual_table/ob_all_virtual_server_compaction_event_history.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_SERVER_COMPACTION_EVENT_HISTORY_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_server_compaction_progress.cpp b/src/observer/virtual_table/ob_all_virtual_server_compaction_progress.cpp index 2b1b54895..061941cb9 100644 --- a/src/observer/virtual_table/ob_all_virtual_server_compaction_progress.cpp +++ b/src/observer/virtual_table/ob_all_virtual_server_compaction_progress.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_server_compaction_progress.h" diff --git a/src/observer/virtual_table/ob_all_virtual_server_compaction_progress.h b/src/observer/virtual_table/ob_all_virtual_server_compaction_progress.h index eebf362cc..a296b6c8e 100644 --- a/src/observer/virtual_table/ob_all_virtual_server_compaction_progress.h +++ b/src/observer/virtual_table/ob_all_virtual_server_compaction_progress.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_SERVER_COMPACTION_PROGRESS_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_server_object_pool.cpp b/src/observer/virtual_table/ob_all_virtual_server_object_pool.cpp index 91fcb63b0..5e731c28e 100644 --- a/src/observer/virtual_table/ob_all_virtual_server_object_pool.cpp +++ b/src/observer/virtual_table/ob_all_virtual_server_object_pool.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_server_object_pool.h" diff --git a/src/observer/virtual_table/ob_all_virtual_server_object_pool.h b/src/observer/virtual_table/ob_all_virtual_server_object_pool.h index 3a8615b75..ee3a2098b 100644 --- a/src/observer/virtual_table/ob_all_virtual_server_object_pool.h +++ b/src/observer/virtual_table/ob_all_virtual_server_object_pool.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_SERVER_OBJECT_POOL_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_server_schema_info.cpp b/src/observer/virtual_table/ob_all_virtual_server_schema_info.cpp index 124521eeb..2b9703c73 100644 --- a/src/observer/virtual_table/ob_all_virtual_server_schema_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_server_schema_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ # define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_virtual_server_schema_info.h b/src/observer/virtual_table/ob_all_virtual_server_schema_info.h index 664f42646..0b682a856 100644 --- a/src/observer/virtual_table/ob_all_virtual_server_schema_info.h +++ b/src/observer/virtual_table/ob_all_virtual_server_schema_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SERVER_SCHEMA_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_server_storage.cpp b/src/observer/virtual_table/ob_all_virtual_server_storage.cpp index 6ba8cd866..0c58e00dc 100644 --- a/src/observer/virtual_table/ob_all_virtual_server_storage.cpp +++ b/src/observer/virtual_table/ob_all_virtual_server_storage.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_server_storage.h" diff --git a/src/observer/virtual_table/ob_all_virtual_server_storage.h b/src/observer/virtual_table/ob_all_virtual_server_storage.h index 9a5330d4e..1c6d9e451 100644 --- a/src/observer/virtual_table/ob_all_virtual_server_storage.h +++ b/src/observer/virtual_table/ob_all_virtual_server_storage.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_SERVER_STORAGE_H_ @@ -115,4 +119,4 @@ class ObAllVirtualServerStorage : public common::ObVirtualTableScannerIterator } // namespace observer } // namespace oceanbase -#endif /* OB_ALL_VIRTUAL_SERVER_STORAGE_H_*/ \ No newline at end of file +#endif /* OB_ALL_VIRTUAL_SERVER_STORAGE_H_*/ diff --git a/src/observer/virtual_table/ob_all_virtual_session_event.cpp b/src/observer/virtual_table/ob_all_virtual_session_event.cpp index 97d381bb8..97e4fc3fa 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_event.cpp +++ b/src/observer/virtual_table/ob_all_virtual_session_event.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_session_event.h" diff --git a/src/observer/virtual_table/ob_all_virtual_session_event.h b/src/observer/virtual_table/ob_all_virtual_session_event.h index dc4769fcd..2223e4aa0 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_event.h +++ b/src/observer/virtual_table/ob_all_virtual_session_event.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SESSION_EVENT_ diff --git a/src/observer/virtual_table/ob_all_virtual_session_info.cpp b/src/observer/virtual_table/ob_all_virtual_session_info.cpp index 556097e8f..b43349468 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_session_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_session_info.h" diff --git a/src/observer/virtual_table/ob_all_virtual_session_info.h b/src/observer/virtual_table/ob_all_virtual_session_info.h index 93bc8324f..2d64cc196 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_info.h +++ b/src/observer/virtual_table/ob_all_virtual_session_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SESSION_INFO_ diff --git a/src/observer/virtual_table/ob_all_virtual_session_ps_info.cpp b/src/observer/virtual_table/ob_all_virtual_session_ps_info.cpp index fb80f73b1..9a45372e9 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_ps_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_session_ps_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_session_ps_info.h" diff --git a/src/observer/virtual_table/ob_all_virtual_session_ps_info.h b/src/observer/virtual_table/ob_all_virtual_session_ps_info.h index e87313fdb..c7cc618c1 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_ps_info.h +++ b/src/observer/virtual_table/ob_all_virtual_session_ps_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SESSION_PS_INFO_ diff --git a/src/observer/virtual_table/ob_all_virtual_session_stat.cpp b/src/observer/virtual_table/ob_all_virtual_session_stat.cpp index 16ba22e59..e2d7d3f9a 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_session_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_session_stat.h" diff --git a/src/observer/virtual_table/ob_all_virtual_session_stat.h b/src/observer/virtual_table/ob_all_virtual_session_stat.h index 17ec74091..46d662b42 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_session_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SESSION_STAT_ diff --git a/src/observer/virtual_table/ob_all_virtual_session_wait.cpp b/src/observer/virtual_table/ob_all_virtual_session_wait.cpp index 3357d78e7..3c8e08edc 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_wait.cpp +++ b/src/observer/virtual_table/ob_all_virtual_session_wait.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_session_wait.h" diff --git a/src/observer/virtual_table/ob_all_virtual_session_wait.h b/src/observer/virtual_table/ob_all_virtual_session_wait.h index 59cff79e7..17d561fd2 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_wait.h +++ b/src/observer/virtual_table/ob_all_virtual_session_wait.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SESSION_WAIT_ diff --git a/src/observer/virtual_table/ob_all_virtual_session_wait_history.cpp b/src/observer/virtual_table/ob_all_virtual_session_wait_history.cpp index 13cdac7dd..ff3811434 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_wait_history.cpp +++ b/src/observer/virtual_table/ob_all_virtual_session_wait_history.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_session_wait_history.h" diff --git a/src/observer/virtual_table/ob_all_virtual_session_wait_history.h b/src/observer/virtual_table/ob_all_virtual_session_wait_history.h index 4e8927e06..524b589d8 100644 --- a/src/observer/virtual_table/ob_all_virtual_session_wait_history.h +++ b/src/observer/virtual_table/ob_all_virtual_session_wait_history.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SESSION_WAIT_HISTORY_ diff --git a/src/observer/virtual_table/ob_all_virtual_shared_storage_compaction_info.h b/src/observer/virtual_table/ob_all_virtual_shared_storage_compaction_info.h index 611c3f738..f7bdf9847 100644 --- a/src/observer/virtual_table/ob_all_virtual_shared_storage_compaction_info.h +++ b/src/observer/virtual_table/ob_all_virtual_shared_storage_compaction_info.h @@ -1,12 +1,18 @@ -//Copyright (c) 2022 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #ifndef SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SHARED_STORAGE_COMPACTION_INFO_H_ #define SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SHARED_STORAGE_COMPACTION_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_shared_storage_quota.cpp b/src/observer/virtual_table/ob_all_virtual_shared_storage_quota.cpp index a0a6bf3e7..27f81d470 100644 --- a/src/observer/virtual_table/ob_all_virtual_shared_storage_quota.cpp +++ b/src/observer/virtual_table/ob_all_virtual_shared_storage_quota.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_shared_storage_quota.h" @@ -263,4 +267,4 @@ int ObVirtualSharedStorageQuota::add_row( } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_shared_storage_quota.h b/src/observer/virtual_table/ob_all_virtual_shared_storage_quota.h index 3e74a427e..eee34ea8b 100644 --- a/src/observer/virtual_table/ob_all_virtual_shared_storage_quota.h +++ b/src/observer/virtual_table/ob_all_virtual_shared_storage_quota.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SHARED_STORAGE_QUOTA_H_ @@ -55,4 +59,4 @@ class ObVirtualSharedStorageQuota : public common::ObVirtualTableScannerIterator } // namespace observer } // namespace oceanbase -#endif /* SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SHARED_STORAGE_QUOTA_H_ */ \ No newline at end of file +#endif /* SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SHARED_STORAGE_QUOTA_H_ */ diff --git a/src/observer/virtual_table/ob_all_virtual_sql_plan.cpp b/src/observer/virtual_table/ob_all_virtual_sql_plan.cpp index ba11d00db..31aa688c1 100644 --- a/src/observer/virtual_table/ob_all_virtual_sql_plan.cpp +++ b/src/observer/virtual_table/ob_all_virtual_sql_plan.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/ob_server_utils.h" @@ -516,7 +520,7 @@ int ObAllVirtualSqlPlan::dump_tenant_plans(int64_t tenant_id) DumpAllPlan dump_plan; dump_plan.tenant_id_ = tenant_id; dump_plan.plan_ids_ = &plan_ids_; - // !!!引用plan cache资源之前必须加ObReqTimeGuard + // !!!Before referencing plan cache resources, ObReqTimeGuard must be added ObReqTimeGuard req_timeinfo_guard; ObPlanCache *plan_cache = NULL; MTL_SWITCH(tenant_id) { @@ -555,7 +559,7 @@ int ObAllVirtualSqlPlan::prepare_next_plan() //next plan ++plan_idx_; ObPhysicalPlan *plan = NULL; - // !!!引用plan cache资源之前必须加ObReqTimeGuard + // !!!Before referencing plan cache resources, ObReqTimeGuard must be added ObReqTimeGuard req_timeinfo_guard; ObPlanCache *plan_cache = NULL; ObCacheObjGuard guard(PC_DIAG_HANDLE); diff --git a/src/observer/virtual_table/ob_all_virtual_sql_plan.h b/src/observer/virtual_table/ob_all_virtual_sql_plan.h index 8a452d71f..d0ea7bf9c 100644 --- a/src/observer/virtual_table/ob_all_virtual_sql_plan.h +++ b/src/observer/virtual_table/ob_all_virtual_sql_plan.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_VIRTUAL_SQL_PLAN_H_ @@ -151,4 +155,4 @@ class ObAllVirtualSqlPlan : public common::ObVirtualTableScannerIterator } } -#endif /* SRC_OBSERVER_VIRTUAL_SQL_PLAN_H_ */ \ No newline at end of file +#endif /* SRC_OBSERVER_VIRTUAL_SQL_PLAN_H_ */ diff --git a/src/observer/virtual_table/ob_all_virtual_sql_stat.cpp b/src/observer/virtual_table/ob_all_virtual_sql_stat.cpp index bd7b30121..6fddba89b 100644 --- a/src/observer/virtual_table/ob_all_virtual_sql_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_sql_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_ENG @@ -219,7 +223,7 @@ int ObAllVirtualSqlStatIter::get_next_sql_stat ( uint64_t cur_sql_stat_cache_id = sql_stat_cache_id_array_.at(sql_stat_cache_id_array_idx_); sql_stat_cache_id_array_idx_++; ObCacheObjGuard guard(VT_SQL_STAT_HANDLE); - int tmp_ret = plan_cache->ref_cache_obj(cur_sql_stat_cache_id, guard); //plan引用计数加VT_SQL_STAT_HANDLE + int tmp_ret = plan_cache->ref_cache_obj(cur_sql_stat_cache_id, guard); // plan reference count plus VT_SQL_STAT_HANDLE if (OB_HASH_NOT_EXIST == tmp_ret) { //do nothing; } else if (OB_SUCCESS != tmp_ret) { diff --git a/src/observer/virtual_table/ob_all_virtual_sql_stat.h b/src/observer/virtual_table/ob_all_virtual_sql_stat.h index f1539bff6..cd7b5694c 100644 --- a/src/observer/virtual_table/ob_all_virtual_sql_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_sql_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_SQL_STAT_H diff --git a/src/observer/virtual_table/ob_all_virtual_sql_workarea_active.cpp b/src/observer/virtual_table/ob_all_virtual_sql_workarea_active.cpp index 08e183b68..9375494c9 100644 --- a/src/observer/virtual_table/ob_all_virtual_sql_workarea_active.cpp +++ b/src/observer/virtual_table/ob_all_virtual_sql_workarea_active.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_ENG diff --git a/src/observer/virtual_table/ob_all_virtual_sql_workarea_active.h b/src/observer/virtual_table/ob_all_virtual_sql_workarea_active.h index c0932cc81..be12e5674 100644 --- a/src/observer/virtual_table/ob_all_virtual_sql_workarea_active.h +++ b/src/observer/virtual_table/ob_all_virtual_sql_workarea_active.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_SQL_WORKAREA_ACTIVE_H diff --git a/src/observer/virtual_table/ob_all_virtual_sql_workarea_histogram.cpp b/src/observer/virtual_table/ob_all_virtual_sql_workarea_histogram.cpp index 63f50aaa8..6c094d2bd 100644 --- a/src/observer/virtual_table/ob_all_virtual_sql_workarea_histogram.cpp +++ b/src/observer/virtual_table/ob_all_virtual_sql_workarea_histogram.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_ENG diff --git a/src/observer/virtual_table/ob_all_virtual_sql_workarea_histogram.h b/src/observer/virtual_table/ob_all_virtual_sql_workarea_histogram.h index 80e72a4a5..6184bf5f7 100644 --- a/src/observer/virtual_table/ob_all_virtual_sql_workarea_histogram.h +++ b/src/observer/virtual_table/ob_all_virtual_sql_workarea_histogram.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_SQL_WORKAREA_HISTOGRAM_H diff --git a/src/observer/virtual_table/ob_all_virtual_sql_workarea_history_stat.cpp b/src/observer/virtual_table/ob_all_virtual_sql_workarea_history_stat.cpp index d7ee9ba45..37bc64d9f 100644 --- a/src/observer/virtual_table/ob_all_virtual_sql_workarea_history_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_sql_workarea_history_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_ENG diff --git a/src/observer/virtual_table/ob_all_virtual_sql_workarea_history_stat.h b/src/observer/virtual_table/ob_all_virtual_sql_workarea_history_stat.h index d07bfcd4f..db063b512 100644 --- a/src/observer/virtual_table/ob_all_virtual_sql_workarea_history_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_sql_workarea_history_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_SQL_WORKAREA_HISTORY_STAT_H diff --git a/src/observer/virtual_table/ob_all_virtual_sql_workarea_memory_info.cpp b/src/observer/virtual_table/ob_all_virtual_sql_workarea_memory_info.cpp index 53444de0a..084c2a7df 100644 --- a/src/observer/virtual_table/ob_all_virtual_sql_workarea_memory_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_sql_workarea_memory_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SQL_ENG diff --git a/src/observer/virtual_table/ob_all_virtual_sql_workarea_memory_info.h b/src/observer/virtual_table/ob_all_virtual_sql_workarea_memory_info.h index 14c57d085..69a0ef5e5 100644 --- a/src/observer/virtual_table/ob_all_virtual_sql_workarea_memory_info.h +++ b/src/observer/virtual_table/ob_all_virtual_sql_workarea_memory_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_SQL_WORKAREA_MEMORY_INFO_H diff --git a/src/observer/virtual_table/ob_all_virtual_ss_local_cache_info.cpp b/src/observer/virtual_table/ob_all_virtual_ss_local_cache_info.cpp index 7710a8669..d4e10c397 100644 --- a/src/observer/virtual_table/ob_all_virtual_ss_local_cache_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_ss_local_cache_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_ss_local_cache_info.h" @@ -437,4 +441,4 @@ bool ObAllVirtualSSLocalCacheInfo::is_need_process(uint64_t tenant_id) } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_ss_local_cache_info.h b/src/observer/virtual_table/ob_all_virtual_ss_local_cache_info.h index 9019444ed..30e8b8fdd 100644 --- a/src/observer/virtual_table/ob_all_virtual_ss_local_cache_info.h +++ b/src/observer/virtual_table/ob_all_virtual_ss_local_cache_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_SS_LOCAL_CACHE_INFO_H_ @@ -101,4 +105,4 @@ class ObAllVirtualSSLocalCacheInfo : public common::ObVirtualTableScannerIterato } // namespace observer } // namespace oceanbase -#endif /* OB_ALL_VIRTUAL_SS_LOCAL_CACHE_INFO_H_ */ \ No newline at end of file +#endif /* OB_ALL_VIRTUAL_SS_LOCAL_CACHE_INFO_H_ */ diff --git a/src/observer/virtual_table/ob_all_virtual_storage_cache_task.cpp b/src/observer/virtual_table/ob_all_virtual_storage_cache_task.cpp index b7851c3a4..507ef17c2 100644 --- a/src/observer/virtual_table/ob_all_virtual_storage_cache_task.cpp +++ b/src/observer/virtual_table/ob_all_virtual_storage_cache_task.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_storage_cache_task.h" @@ -270,4 +274,4 @@ bool ObAllVirtualStorageCacheTask::is_need_process(uint64_t tenant_id) } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_storage_cache_task.h b/src/observer/virtual_table/ob_all_virtual_storage_cache_task.h index dfa77f8f1..1ee66fd46 100644 --- a/src/observer/virtual_table/ob_all_virtual_storage_cache_task.h +++ b/src/observer/virtual_table/ob_all_virtual_storage_cache_task.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_STORAGE_CACHE_TASK_H_ @@ -83,4 +87,4 @@ class ObAllVirtualStorageCacheTask : public common::ObVirtualTableScannerIterato } // namespace observer } // namespace oceanbase -#endif /* OB_ALL_VIRTUAL_STORAGE_CACHE_TASK_H_ */ \ No newline at end of file +#endif /* OB_ALL_VIRTUAL_STORAGE_CACHE_TASK_H_ */ diff --git a/src/observer/virtual_table/ob_all_virtual_storage_leak_info.cpp b/src/observer/virtual_table/ob_all_virtual_storage_leak_info.cpp index a213a461e..91409fffe 100644 --- a/src/observer/virtual_table/ob_all_virtual_storage_leak_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_storage_leak_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_storage_leak_info.h" @@ -170,4 +174,4 @@ int ObAllVirtualStorageLeakInfo::process_row() }; // observer -}; // oceanbase \ No newline at end of file +}; // oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_storage_leak_info.h b/src/observer/virtual_table/ob_all_virtual_storage_leak_info.h index e07e954a5..4429ba422 100644 --- a/src/observer/virtual_table/ob_all_virtual_storage_leak_info.h +++ b/src/observer/virtual_table/ob_all_virtual_storage_leak_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_STORAGE_LEAK_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_storage_meta_memory_status.cpp b/src/observer/virtual_table/ob_all_virtual_storage_meta_memory_status.cpp index 586ae211d..e62f3d220 100644 --- a/src/observer/virtual_table/ob_all_virtual_storage_meta_memory_status.cpp +++ b/src/observer/virtual_table/ob_all_virtual_storage_meta_memory_status.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_storage_meta_memory_status.h" @@ -147,4 +151,4 @@ int ObAllVirtualStorageMetaMemoryStatus::process_curr_tenant(ObNewRow *&row) } } -} \ No newline at end of file +} diff --git a/src/observer/virtual_table/ob_all_virtual_storage_meta_memory_status.h b/src/observer/virtual_table/ob_all_virtual_storage_meta_memory_status.h index ea51bfe8a..7d14affb5 100644 --- a/src/observer/virtual_table/ob_all_virtual_storage_meta_memory_status.h +++ b/src/observer/virtual_table/ob_all_virtual_storage_meta_memory_status.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_STORAGE_META_MEMORY_STATUS_H_ @@ -58,11 +62,11 @@ class ObAllVirtualStorageMetaMemoryStatus : public common::ObVirtualTableScanner virtual void reset(); private: - // 过滤得到需要处理的租户 + // Filter to get the tenants that need processing virtual bool is_need_process(uint64_t tenant_id) override; - // 处理当前迭代的租户 + // Process the tenant of the current iteration virtual int process_curr_tenant(common::ObNewRow *&row) override; - // 释放上一个租户的资源 + // Release the resources of the previous tenant virtual void release_last_tenant() override; private: @@ -73,7 +77,7 @@ class ObAllVirtualStorageMetaMemoryStatus : public common::ObVirtualTableScanner common::ObAddr addr_; char ip_buf_[common::OB_IP_STR_BUFF]; char address_[STRING_LEN]; - /* 跨租户访问的资源必须由ObMultiTenantOperator来处理释放*/ + /* The resources for cross-tenant access must be handled and released by ObMultiTenantOperator */ int64_t pool_idx_; ObSEArray status_arr_; private: @@ -83,4 +87,4 @@ class ObAllVirtualStorageMetaMemoryStatus : public common::ObVirtualTableScanner } } -#endif \ No newline at end of file +#endif diff --git a/src/observer/virtual_table/ob_all_virtual_sys_event.cpp b/src/observer/virtual_table/ob_all_virtual_sys_event.cpp index 6a421e3e8..8a733b2e5 100644 --- a/src/observer/virtual_table/ob_all_virtual_sys_event.cpp +++ b/src/observer/virtual_table/ob_all_virtual_sys_event.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_sys_event.h" diff --git a/src/observer/virtual_table/ob_all_virtual_sys_event.h b/src/observer/virtual_table/ob_all_virtual_sys_event.h index 27f9b1cf9..8d4e73855 100644 --- a/src/observer/virtual_table/ob_all_virtual_sys_event.h +++ b/src/observer/virtual_table/ob_all_virtual_sys_event.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_SYS_EVENT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_sys_parameter_stat.cpp b/src/observer/virtual_table/ob_all_virtual_sys_parameter_stat.cpp index abee0045e..89ae2f566 100644 --- a/src/observer/virtual_table/ob_all_virtual_sys_parameter_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_sys_parameter_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_sys_parameter_stat.h" @@ -59,8 +63,6 @@ int ObAllVirtualSysParameterStat::inner_get_next_row(ObNewRow *&row) { int ret = OB_SUCCESS; if (OB_SUCC(inner_sys_get_next_row(row))) { - } else if (OB_ITER_END == ret) { - ret = inner_tenant_get_next_row(row); } return ret; } @@ -165,7 +167,7 @@ int ObAllVirtualSysParameterStat::inner_sys_get_next_row(ObNewRow *&row) break; } default : { - // TODO: 版本兼容性,多余的列不报错 + // TODO: Version compatibility, extra columns do not cause errors // ret = OB_ERR_UNEXPECTED; // SERVER_LOG(WARN, "unexpected column id", K(col_id), K(i), K(ret)); cells[i].set_null(); @@ -182,121 +184,5 @@ int ObAllVirtualSysParameterStat::inner_sys_get_next_row(ObNewRow *&row) return ret; } -int ObAllVirtualSysParameterStat::inner_tenant_get_next_row(common::ObNewRow *&row) -{ - int ret = OB_SUCCESS; - if (tenant_iter_ == tenant_config_->get_container().end()) { - ret = OB_ITER_END; - } else { - ObObj *cells = cur_row_.cells_; - ObString ipstr; - if (OB_UNLIKELY(NULL == cells)) { - ret = OB_ERR_UNEXPECTED; - SERVER_LOG(ERROR, "cur row cell is NULL", K(ret)); - } else if (OB_FAIL(ObServerUtils::get_server_ip(allocator_, ipstr))) { - SERVER_LOG(ERROR, "get server ip failed", K(ret)); - } else { - for (int64_t i = 0; OB_SUCC(ret) && i < output_column_ids_.count(); ++i) { - const uint64_t col_id = output_column_ids_.at(i); - switch (col_id) { - case ZONE: { - cells[i].set_varchar(GCONF.zone); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case SERVER_TYPE: { - cells[i].set_varchar("observer"); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case SERVER_IP: { - cells[i].set_varchar(ipstr); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case SERVER_PORT: { - cells[i].set_int(GCONF.self_addr_.get_port()); - break; - } - case NAME: { - cells[i].set_varchar(tenant_iter_->first.str()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case DATA_TYPE: { - cells[i].set_varchar(tenant_iter_->second->data_type()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case VALUE: { - cells[i].set_varchar(tenant_iter_->second->str()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case INFO: { - cells[i].set_varchar(tenant_iter_->second->info()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case SECTION: { - cells[i].set_varchar(tenant_iter_->second->section()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case SCOPE: { - cells[i].set_varchar(tenant_iter_->second->scope()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case SOURCE: { - cells[i].set_varchar(tenant_iter_->second->source()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case EDIT_LEVEL: { - cells[i].set_varchar(tenant_iter_->second->edit_level()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case DEFAULT_VALUE: { - cells[i].set_varchar(tenant_iter_->second->default_str()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case ISDEFAULT: { - int isdefault = tenant_iter_->second->is_default(tenant_iter_->second->str(),tenant_iter_->second->default_str(),sizeof(tenant_iter_->second->default_str())) ? 1 : 0; - cells[i].set_int(isdefault); - break; - } - default : { - // 版本兼容性,多余列不报错 - // ret = OB_ERR_UNEXPECTED; - // SERVER_LOG(WARN, "unexpected column id", K(col_id), K(i), K(ret)); - cells[i].set_null(); - break; - } - } - } // end for - if (OB_SUCC(ret)) { - row = &cur_row_; - ++tenant_iter_; - } - } - } - return ret; -} - } // namespace observer } // namespace oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_sys_parameter_stat.h b/src/observer/virtual_table/ob_all_virtual_sys_parameter_stat.h index bf2622d5b..20555cfcd 100644 --- a/src/observer/virtual_table/ob_all_virtual_sys_parameter_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_sys_parameter_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SYS_PARAMETER_STAT_H_ @@ -32,7 +36,7 @@ class ObAllVirtualSysParameterStat : public common::ObVirtualTableIterator virtual int inner_get_next_row(common::ObNewRow *&row); private: int inner_sys_get_next_row(common::ObNewRow *&row); - int inner_tenant_get_next_row(common::ObNewRow *&row); + enum SYS_PARAMETER_STAT_COLUMN { ZONE = common::OB_APP_MIN_COLUMN_ID, SERVER_TYPE, diff --git a/src/observer/virtual_table/ob_all_virtual_sys_stat.cpp b/src/observer/virtual_table/ob_all_virtual_sys_stat.cpp index 637fb94fb..676e1ed27 100644 --- a/src/observer/virtual_table/ob_all_virtual_sys_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_sys_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -119,16 +123,8 @@ int ObAllVirtualSysStat::update_all_stats_(const int64_t tenant_id, common::ObDi stat_events.get(ObStatEventIds::OBLOGGER_WRITE_SIZE - ObStatEventIds::STAT_EVENT_ADD_END -1)->stat_value_ = (OB_SYS_TENANT_ID == tenant_id) ? OB_LOGGER.get_write_size() : 0; - stat_events.get(ObStatEventIds::ELECTION_WRITE_SIZE - ObStatEventIds::STAT_EVENT_ADD_END -1)->stat_value_ = - (OB_SYS_TENANT_ID == tenant_id) ? OB_LOGGER.get_elec_write_size() : 0; - stat_events.get(ObStatEventIds::ROOTSERVICE_WRITE_SIZE - ObStatEventIds::STAT_EVENT_ADD_END -1)->stat_value_ = - (OB_SYS_TENANT_ID == tenant_id) ? OB_LOGGER.get_rs_write_size() : 0; stat_events.get(ObStatEventIds::OBLOGGER_TOTAL_WRITE_COUNT - ObStatEventIds::STAT_EVENT_ADD_END -1)->stat_value_ = (OB_SYS_TENANT_ID == tenant_id) ? OB_LOGGER.get_total_write_count() : 0; - stat_events.get(ObStatEventIds::ELECTION_TOTAL_WRITE_COUNT - ObStatEventIds::STAT_EVENT_ADD_END -1)->stat_value_ = - (OB_SYS_TENANT_ID == tenant_id) ? OB_LOGGER.get_elec_total_write_count() : 0; - stat_events.get(ObStatEventIds::ROOTSERVICE_TOTAL_WRITE_COUNT - ObStatEventIds::STAT_EVENT_ADD_END -1)->stat_value_ = - (OB_SYS_TENANT_ID == tenant_id) ? OB_LOGGER.get_rs_total_write_count() : 0; stat_events.get(ObStatEventIds::ASYNC_ERROR_LOG_DROPPED_COUNT - ObStatEventIds::STAT_EVENT_ADD_END -1)->stat_value_ = (OB_SYS_TENANT_ID == tenant_id) ? OB_LOGGER.get_dropped_error_log_count() : 0; stat_events.get(ObStatEventIds::ASYNC_WARN_LOG_DROPPED_COUNT - ObStatEventIds::STAT_EVENT_ADD_END -1)->stat_value_ = diff --git a/src/observer/virtual_table/ob_all_virtual_sys_stat.h b/src/observer/virtual_table/ob_all_virtual_sys_stat.h index d17f9557b..2cc10aacf 100644 --- a/src/observer/virtual_table/ob_all_virtual_sys_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_sys_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_SYS_STAT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_sys_task_status.cpp b/src/observer/virtual_table/ob_all_virtual_sys_task_status.cpp index 00a94eefc..966ddd740 100644 --- a/src/observer/virtual_table/ob_all_virtual_sys_task_status.cpp +++ b/src/observer/virtual_table/ob_all_virtual_sys_task_status.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_sys_task_status.h" diff --git a/src/observer/virtual_table/ob_all_virtual_sys_task_status.h b/src/observer/virtual_table/ob_all_virtual_sys_task_status.h index eaedfda31..dc11c7222 100644 --- a/src/observer/virtual_table/ob_all_virtual_sys_task_status.h +++ b/src/observer/virtual_table/ob_all_virtual_sys_task_status.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_SYS_TASK_STATUS_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_sys_variable_default_value.cpp b/src/observer/virtual_table/ob_all_virtual_sys_variable_default_value.cpp index 0e2568502..829e5db6a 100644 --- a/src/observer/virtual_table/ob_all_virtual_sys_variable_default_value.cpp +++ b/src/observer/virtual_table/ob_all_virtual_sys_variable_default_value.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_sys_variable_default_value.h" diff --git a/src/observer/virtual_table/ob_all_virtual_sys_variable_default_value.h b/src/observer/virtual_table/ob_all_virtual_sys_variable_default_value.h index 29bc018f7..479ce1c7a 100644 --- a/src/observer/virtual_table/ob_all_virtual_sys_variable_default_value.h +++ b/src/observer/virtual_table/ob_all_virtual_sys_variable_default_value.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_ALL_VIRTUAL_SYS_VARIABLE_DEFAULT_VALUE_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_table_mgr.cpp b/src/observer/virtual_table/ob_all_virtual_table_mgr.cpp index e5797e3d5..9f5c26bee 100644 --- a/src/observer/virtual_table/ob_all_virtual_table_mgr.cpp +++ b/src/observer/virtual_table/ob_all_virtual_table_mgr.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_table_mgr.h" diff --git a/src/observer/virtual_table/ob_all_virtual_table_mgr.h b/src/observer/virtual_table/ob_all_virtual_table_mgr.h index 348ff4c95..6739abe6a 100644 --- a/src/observer/virtual_table/ob_all_virtual_table_mgr.h +++ b/src/observer/virtual_table/ob_all_virtual_table_mgr.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_TABLE_MGR_H_ @@ -69,11 +73,11 @@ class ObAllVirtualTableMgr : public common::ObVirtualTableScannerIterator, virtual void reset(); inline void set_addr(common::ObAddr &addr) { addr_ = addr; } private: - // 过滤得到需要处理的租户 + // Filter to get the tenants that need processing virtual bool is_need_process(uint64_t tenant_id) override; - // 处理当前迭代的租户 + // Process the tenant of the current iteration virtual int process_curr_tenant(common::ObNewRow *&row) override; - // 释放上一个租户的资源 + // Release the resources of the previous tenant virtual void release_last_tenant() override; int get_next_tablet(); diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_buffer_info.cpp b/src/observer/virtual_table/ob_all_virtual_tablet_buffer_info.cpp index 3b99aa7d0..33ffa9bfd 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_buffer_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tablet_buffer_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_tablet_buffer_info.h" @@ -181,4 +185,4 @@ int ObAllVirtualTabletBufferInfo::gen_row( } } // observer -} // oceanbase \ No newline at end of file +} // oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_buffer_info.h b/src/observer/virtual_table/ob_all_virtual_tablet_buffer_info.h index b375f9c8f..d884af0e5 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_buffer_info.h +++ b/src/observer/virtual_table/ob_all_virtual_tablet_buffer_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_TABLET_BUFFER_INFO_H_ @@ -72,4 +76,4 @@ class ObAllVirtualTabletBufferInfo : public common::ObVirtualTableScannerIterato }; } // observer } // oceanbase -#endif \ No newline at end of file +#endif diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_compaction_history.cpp b/src/observer/virtual_table/ob_all_virtual_tablet_compaction_history.cpp index 203f66dbe..39938777f 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_compaction_history.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tablet_compaction_history.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_tablet_compaction_history.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_compaction_history.h b/src/observer/virtual_table/ob_all_virtual_tablet_compaction_history.h index 2f1e54a66..c9efd6b78 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_compaction_history.h +++ b/src/observer/virtual_table/ob_all_virtual_tablet_compaction_history.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TABLET_COMPACTION_HISTORY_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_compaction_info.cpp b/src/observer/virtual_table/ob_all_virtual_tablet_compaction_info.cpp index f4e56fe03..d5b278f85 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_compaction_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tablet_compaction_info.cpp @@ -1,12 +1,18 @@ -//Copyright (c) 2022 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #define USING_LOG_PREFIX STORAGE #include "observer/virtual_table/ob_all_virtual_tablet_compaction_info.h" @@ -157,4 +163,4 @@ int ObAllVirtualTabletCompactionInfo::process_curr_tenant(common::ObNewRow *&row } } /* namespace observer */ -} /* namespace oceanbase */ \ No newline at end of file +} /* namespace oceanbase */ diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_compaction_info.h b/src/observer/virtual_table/ob_all_virtual_tablet_compaction_info.h index 94987d138..d6961f80b 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_compaction_info.h +++ b/src/observer/virtual_table/ob_all_virtual_tablet_compaction_info.h @@ -1,12 +1,18 @@ -//Copyright (c) 2022 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #ifndef SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_TABLET_COMPACTION_INFO_H_ #define SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_TABLET_COMPACTION_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_compaction_progress.cpp b/src/observer/virtual_table/ob_all_virtual_tablet_compaction_progress.cpp index ae6015fce..a43c45bcc 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_compaction_progress.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tablet_compaction_progress.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_tablet_compaction_progress.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_compaction_progress.h b/src/observer/virtual_table/ob_all_virtual_tablet_compaction_progress.h index 27dce4b27..738c77c33 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_compaction_progress.h +++ b/src/observer/virtual_table/ob_all_virtual_tablet_compaction_progress.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_PARITION_COMPACTION_PROGRESS_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_ddl_kv_info.cpp b/src/observer/virtual_table/ob_all_virtual_tablet_ddl_kv_info.cpp index 5066522d5..08e102e1c 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_ddl_kv_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tablet_ddl_kv_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_tablet_ddl_kv_info.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_ddl_kv_info.h b/src/observer/virtual_table/ob_all_virtual_tablet_ddl_kv_info.h index d65d50a45..25ae7f4e8 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_ddl_kv_info.h +++ b/src/observer/virtual_table/ob_all_virtual_tablet_ddl_kv_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TABLET_DDL_KV_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_info.cpp b/src/observer/virtual_table/ob_all_virtual_tablet_info.cpp index 9b22d4197..c49695c2e 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tablet_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_tablet_info.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_info.h b/src/observer/virtual_table/ob_all_virtual_tablet_info.h index cdd55a467..5bc1667e8 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_info.h +++ b/src/observer/virtual_table/ob_all_virtual_tablet_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TABLET_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_local_cache.cpp b/src/observer/virtual_table/ob_all_virtual_tablet_local_cache.cpp index ca6ac69c8..85f28aa82 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_local_cache.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tablet_local_cache.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_tablet_local_cache.h" @@ -250,4 +254,4 @@ bool ObAllVirtualTabletLocalCache::is_need_process(uint64_t tenant_id) } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_local_cache.h b/src/observer/virtual_table/ob_all_virtual_tablet_local_cache.h index 6486fbb74..ef4465f91 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_local_cache.h +++ b/src/observer/virtual_table/ob_all_virtual_tablet_local_cache.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TABLET_LOCAL_CACHE_H_ @@ -82,4 +86,4 @@ class ObAllVirtualTabletLocalCache : public common::ObVirtualTableScannerIterato } // namespace observer } // namespace oceanbase -#endif /* OB_ALL_VIRTUAL_TABLET_LOCAL_CACHE_H_ */ \ No newline at end of file +#endif /* OB_ALL_VIRTUAL_TABLET_LOCAL_CACHE_H_ */ diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_pointer_status.cpp b/src/observer/virtual_table/ob_all_virtual_tablet_pointer_status.cpp index 40065660b..fde73aefd 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_pointer_status.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tablet_pointer_status.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_tablet_pointer_status.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_pointer_status.h b/src/observer/virtual_table/ob_all_virtual_tablet_pointer_status.h index 29643c97a..ec595a7c6 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_pointer_status.h +++ b/src/observer/virtual_table/ob_all_virtual_tablet_pointer_status.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_TABLET_POINTER_STATUS_H_ @@ -62,11 +66,11 @@ class ObAllVirtualTabletPtr : public common::ObVirtualTableScannerIterator, virtual int inner_get_next_row(common::ObNewRow *&row); virtual void reset(); private: - // 过滤得到需要处理的租户 + // Filter to get the tenants that need processing virtual bool is_need_process(uint64_t tenant_id) override; - // 处理当前迭代的租户 + // Process the tenant of the current iteration virtual int process_curr_tenant(common::ObNewRow *&row) override; - // 释放上一个租户的资源 + // Release the resources of the previous tenant virtual void release_last_tenant() override; int get_next_tablet_pointer( ObTabletMapKey &tablet_key, @@ -82,7 +86,7 @@ class ObAllVirtualTabletPtr : public common::ObVirtualTableScannerIterator, char address_[ADDR_STR_LEN]; char pointer_[STR_LEN]; char old_chain_[STR_LEN]; - /* 跨租户访问的资源必须由ObMultiTenantOperator来处理释放*/ + /* The resources accessed across tenants must be handled and released by ObMultiTenantOperator */ storage::ObTenantTabletPtrWithInMemObjIterator *tablet_iter_; void *iter_buf_; private: diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_sstable_macro_info.cpp b/src/observer/virtual_table/ob_all_virtual_tablet_sstable_macro_info.cpp index 69b1d601b..8695c8ea2 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_sstable_macro_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tablet_sstable_macro_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_tablet_sstable_macro_info.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_sstable_macro_info.h b/src/observer/virtual_table/ob_all_virtual_tablet_sstable_macro_info.h index 3fe0311bb..92cb4016d 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_sstable_macro_info.h +++ b/src/observer/virtual_table/ob_all_virtual_tablet_sstable_macro_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TABLET_SSTABLE_MACRO_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_stat.cpp b/src/observer/virtual_table/ob_all_virtual_tablet_stat.cpp index be73ddb9e..b8c22e159 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tablet_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_tablet_stat.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_stat.h b/src/observer/virtual_table/ob_all_virtual_tablet_stat.h index 422786a31..a7a01ef67 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_tablet_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TABLET_STAT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_store_stat.cpp b/src/observer/virtual_table/ob_all_virtual_tablet_store_stat.cpp index 9a44aac4c..073f92de7 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_store_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tablet_store_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_tablet_store_stat.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_store_stat.h b/src/observer/virtual_table/ob_all_virtual_tablet_store_stat.h index 26ef00503..0e45ea8ad 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_store_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_tablet_store_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TABLET_STORE_STAT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_ctx_memory_info.cpp b/src/observer/virtual_table/ob_all_virtual_tenant_ctx_memory_info.cpp index 86de0a6bc..587711fce 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_ctx_memory_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tenant_ctx_memory_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_tenant_ctx_memory_info.h" @@ -142,7 +146,7 @@ int ObAllVirtualTenantCtxMemoryInfo::add_row(uint64_t tenant_id, int64_t ctx_id, } } // iter column end if (OB_SUCC(ret)) { - // scanner最大支持64M,因此暂不考虑溢出的情况 + // scanner maximum supports 64M, therefore overflow is not considered for now if (OB_FAIL(scanner_.add_row(cur_row_))) { SERVER_LOG(WARN, "fail to add row", K(ret), K(cur_row_)); if (OB_SIZE_OVERFLOW == ret) { diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_ctx_memory_info.h b/src/observer/virtual_table/ob_all_virtual_tenant_ctx_memory_info.h index a1bded4a6..8abc00e34 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_ctx_memory_info.h +++ b/src/observer/virtual_table/ob_all_virtual_tenant_ctx_memory_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_TENANT_CTX_MEMORY_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_memory_info.cpp b/src/observer/virtual_table/ob_all_virtual_tenant_memory_info.cpp index 15332aa86..7838a1215 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_memory_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tenant_memory_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_tenant_memory_info.h" @@ -127,7 +131,7 @@ int ObAllVirtualTenantMemoryInfo::add_row(uint64_t tenant_id, int64_t hold, int6 } } // iter column end if (OB_SUCC(ret)) { - // scanner最大支持64M,因此暂不考虑溢出的情况 + // scanner maximum supports 64M, therefore overflow is not considered for now if (OB_FAIL(scanner_.add_row(cur_row_))) { SERVER_LOG(WARN, "fail to add row", K(ret), K(cur_row_)); if (OB_SIZE_OVERFLOW == ret) { diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_memory_info.h b/src/observer/virtual_table/ob_all_virtual_tenant_memory_info.h index b6c6cf50e..a1379866c 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_memory_info.h +++ b/src/observer/virtual_table/ob_all_virtual_tenant_memory_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_TENANT_MEMORY_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_memstore_allocator_info.cpp b/src/observer/virtual_table/ob_all_virtual_tenant_memstore_allocator_info.cpp index f2d0addc9..299f23766 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_memstore_allocator_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tenant_memstore_allocator_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_tenant_memstore_allocator_info.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_memstore_allocator_info.h b/src/observer/virtual_table/ob_all_virtual_tenant_memstore_allocator_info.h index 9dd1eac0e..49d93c44c 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_memstore_allocator_info.h +++ b/src/observer/virtual_table/ob_all_virtual_tenant_memstore_allocator_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TENANT_MEMSOTRE_ALLOCATOR_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_memstore_info.cpp b/src/observer/virtual_table/ob_all_virtual_tenant_memstore_info.cpp index a37524b5c..6455e182b 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_memstore_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tenant_memstore_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_tenant_memstore_info.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_memstore_info.h b/src/observer/virtual_table/ob_all_virtual_tenant_memstore_info.h index 3d08faa3b..840335218 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_memstore_info.h +++ b/src/observer/virtual_table/ob_all_virtual_tenant_memstore_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TENANT_MEMSTORE_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_mview_running_job.cpp b/src/observer/virtual_table/ob_all_virtual_tenant_mview_running_job.cpp index 1dc529553..f4a748b06 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_mview_running_job.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tenant_mview_running_job.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_tenant_mview_running_job.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_mview_running_job.h b/src/observer/virtual_table/ob_all_virtual_tenant_mview_running_job.h index 17fd2f1bf..d0ca83bf1 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_mview_running_job.h +++ b/src/observer/virtual_table/ob_all_virtual_tenant_mview_running_job.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_TENANT_MVIEW_RUNNING_JOB_ diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_parameter_info.cpp b/src/observer/virtual_table/ob_all_virtual_tenant_parameter_info.cpp deleted file mode 100644 index 1858223c2..000000000 --- a/src/observer/virtual_table/ob_all_virtual_tenant_parameter_info.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ - -#include "ob_all_virtual_tenant_parameter_info.h" -#include "observer/ob_server_struct.h" - -namespace oceanbase -{ -using namespace common; - -namespace observer -{ - -ObAllVirtualTenantParameterInfo::ObAllVirtualTenantParameterInfo() - : all_config_(), config_iter_() -{ -} - -ObAllVirtualTenantParameterInfo::~ObAllVirtualTenantParameterInfo() -{ - reset(); -} - -int ObAllVirtualTenantParameterInfo::inner_open() -{ - int ret = OB_SUCCESS; - const ObAddr &addr = GCTX.self_addr(); - if (OB_FAIL(OTC_MGR.get_all_tenant_config_info(all_config_, allocator_))) { - SERVER_LOG(WARN, "fail to get all tenant config info", K(ret)); - } else if (!addr.ip_to_string(ip_buf_, sizeof(ip_buf_))) { - ret = OB_ERR_UNEXPECTED; - SERVER_LOG(WARN, "ip to string failed", K(ret)); - } else { - config_iter_ = all_config_.begin(); - } - return ret; -} - -void ObAllVirtualTenantParameterInfo::reset() -{ - ObVirtualTableIterator::reset(); - config_iter_ = all_config_.begin(); -} - -int ObAllVirtualTenantParameterInfo::inner_get_next_row(ObNewRow *&row) -{ - int ret = OB_SUCCESS; - if (config_iter_ == all_config_.end()) { - ret = OB_ITER_END; - } else { - ObObj *cells = cur_row_.cells_; - if (OB_UNLIKELY(nullptr == cells)) { - ret = OB_ERR_UNEXPECTED; - SERVER_LOG(ERROR, "cur row cell is NULL", K(ret)); - } else { - for (int64_t i = 0; OB_SUCC(ret) && i < output_column_ids_.count(); ++i) { - const uint64_t col_id = output_column_ids_.at(i); - switch (col_id) { - case TENANT_ID : { - cells[i].set_int(config_iter_->tenant_id_); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case ZONE: { - cells[i].set_varchar(GCONF.zone); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case SERVER_TYPE: { - cells[i].set_varchar("observer"); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case SERVER_IP: { - cells[i].set_varchar(ip_buf_); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case SERVER_PORT: { - cells[i].set_int(GCONF.self_addr_.get_port()); - break; - } - case NAME: { - cells[i].set_varchar(config_iter_->name_.ptr()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case DATA_TYPE: { - cells[i].set_varchar(config_iter_->data_type_.ptr()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case VALUE: { - cells[i].set_varchar(config_iter_->value_.ptr()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case INFO: { - cells[i].set_varchar(config_iter_->info_.ptr()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case SECTION: { - cells[i].set_varchar(config_iter_->section_.ptr()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case SCOPE: { - cells[i].set_varchar(config_iter_->scope_.ptr()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case SOURCE: { - cells[i].set_varchar(config_iter_->source_.ptr()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - case EDIT_LEVEL: { - cells[i].set_varchar(config_iter_->edit_level_.ptr()); - cells[i].set_collation_type( - ObCharset::get_default_collation(ObCharset::get_default_charset())); - break; - } - default : { - ret = OB_ERR_UNEXPECTED; - SERVER_LOG(WARN, "unexpected column id", K(col_id), K(i), K(ret)); - break; - } - } // switch col_id - } // for columns - if (OB_SUCC(ret)) { - row = &cur_row_; - ++config_iter_; - } - } // else - } // else - return ret; -} - -} // namespace observer -} // namespace oceanbase - diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_parameter_info.h b/src/observer/virtual_table/ob_all_virtual_tenant_parameter_info.h deleted file mode 100644 index 7f660d2c6..000000000 --- a/src/observer/virtual_table/ob_all_virtual_tenant_parameter_info.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ - -#ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_TENANT_PARAMETER_INFO_H_ -#define OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_TENANT_PARAMETER_INFO_H_ - -#include "lib/container/ob_array.h" -#include "lib/container/ob_array_iterator.h" -#include "share/ob_virtual_table_iterator.h" -#include "share/config/ob_server_config.h" -#include "observer/omt/ob_tenant_config_mgr.h" - -namespace oceanbase -{ -namespace observer -{ - -class ObAllVirtualTenantParameterInfo : public common::ObVirtualTableIterator -{ -public: - ObAllVirtualTenantParameterInfo(); - virtual ~ObAllVirtualTenantParameterInfo(); - virtual int inner_open(); - virtual void reset(); - virtual int inner_get_next_row(common::ObNewRow *&row); -private: - enum ALL_TENANT_PARAMETER_INFO_COLUMN { - TENANT_ID = common::OB_APP_MIN_COLUMN_ID, - ZONE, - SERVER_TYPE, - SERVER_IP, - SERVER_PORT, - NAME, - DATA_TYPE, - VALUE, - INFO, - SECTION, - SCOPE, - SOURCE, - EDIT_LEVEL, - }; - common::ObArray all_config_; - common::ObArray::iterator config_iter_; - char ip_buf_[common::OB_IP_STR_BUFF]; - DISALLOW_COPY_AND_ASSIGN(ObAllVirtualTenantParameterInfo); -}; -} // namespace observer -} // namespace oceanbase - -#endif - diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_parameter_stat.cpp b/src/observer/virtual_table/ob_all_virtual_tenant_parameter_stat.cpp index f874d0d69..7eeef9ecc 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_parameter_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tenant_parameter_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_tenant_parameter_stat.h" @@ -30,8 +34,7 @@ ObAllVirtualTenantParameterStat::ObAllVirtualTenantParameterStat() : tenant_iter_(), cur_tenant_idx_(-1), tenant_id_list_(), - tenant_config_(), - seed_config_() + tenant_config_() { } @@ -50,8 +53,6 @@ int ObAllVirtualTenantParameterStat::init(const bool show_seed) ret = OB_ERR_UNEXPECTED; SERVER_LOG(WARN, "unexpected null of omt", KR(ret), K(GCTX.omt_)); } else if (FALSE_IT(show_seed_ = show_seed)) { - } else if (show_seed_) { - ret = update_seed(); } else { if (is_sys_tenant(effective_tenant_id_)) { // sys tenant show all local tenant parameter info @@ -110,12 +111,8 @@ int ObAllVirtualTenantParameterStat::inner_get_next_row(ObNewRow *&row) if (OB_UNLIKELY(!inited_)) { ret = OB_NOT_INIT; SERVER_LOG(WARN, "not inited", K(inited_), KR(ret)); - } else if (show_seed_) { - ret = inner_seed_get_next_row(row); } else { if (OB_SUCC(inner_sys_get_next_row(row))) { - } else if (OB_ITER_END == ret) { - ret = inner_tenant_get_next_row(row); } } return ret; @@ -127,88 +124,6 @@ int ObAllVirtualTenantParameterStat::inner_sys_get_next_row(common::ObNewRow *&r return fill_row_(row, sys_iter_, GCONF.get_container(), NULL); } -int ObAllVirtualTenantParameterStat::inner_tenant_get_next_row(common::ObNewRow *&row) -{ - int ret = OB_SUCCESS; - if (OB_UNLIKELY(!inited_)) { - ret = OB_NOT_INIT; - SERVER_LOG(WARN, "not inited", K(inited_), KR(ret)); - } else if (OB_UNLIKELY(nullptr == GCTX.omt_)) { - ret = OB_ERR_UNEXPECTED; - SERVER_LOG(WARN, "unexpected null of omt", K(ret)); - } else if (cur_tenant_idx_ >= tenant_id_list_.count()) { - ret = OB_ITER_END; - } else { - if (cur_tenant_idx_ < 0 // first come-in - // current tenant is over - || (tenant_config_.is_valid() && tenant_iter_ == tenant_config_->get_container().end())) { - // find next valid tenant - while (OB_SUCC(ret) && ++cur_tenant_idx_ < tenant_id_list_.count()) { - uint64_t tenant_id = tenant_id_list_.at(cur_tenant_idx_); - - // init tenant config - tenant_config_.set_config(TENANT_CONF(tenant_id)); - if (tenant_config_.is_valid()) { - tenant_iter_ = tenant_config_->get_container().begin(); - break; - } else { - // tenant config has not been loaded, just skip it - SERVER_LOG(WARN, "tenant config is not ready", K(tenant_id), K(cur_tenant_idx_)); - } - } - - if (cur_tenant_idx_ >= tenant_id_list_.count()) { - ret = OB_ITER_END; - } - } - - if (OB_FAIL(ret)) { - } else if (cur_tenant_idx_ < 0 - || !tenant_config_.is_valid() - || cur_tenant_idx_ >= tenant_id_list_.count()) { - ret = OB_ERR_UNEXPECTED; - SERVER_LOG(WARN, "cur_tenant_idx_ and tenant_config_ is not valid, unexpected", KR(ret), - K(cur_tenant_idx_), K(tenant_id_list_)); - } else { - const uint64_t tenant_id = tenant_id_list_.at(cur_tenant_idx_); - if (OB_FAIL(fill_row_(row, - tenant_iter_, - tenant_config_->get_container(), - &tenant_id))) { - SERVER_LOG(WARN, "fill row fail", KR(ret), K(tenant_id), K(tenant_config_->get_tenant_id()), - K(cur_tenant_idx_), K(tenant_id_list_)); - } - } - } - return ret; -} - -int ObAllVirtualTenantParameterStat::update_seed() -{ - int ret = OB_SUCCESS; - const static char *from_seed = "select config_version, zone, svr_type, svr_ip, svr_port, name, " - "data_type, value, info, section, scope, source, edit_level " - "from __all_seed_parameter"; - ObSQLClientRetryWeak sql_client_retry_weak(GCTX.sql_proxy_); - SMART_VAR(ObMySQLProxy::MySQLResult, result) { - if (OB_FAIL(seed_config_.init(&(OTC_MGR)))) { - SERVER_LOG(WARN, "seed config init failed", K(ret)); - } else if (OB_FAIL(sql_client_retry_weak.read(result, OB_SYS_TENANT_ID, from_seed))) { - SERVER_LOG(WARN, "read config from __all_seed_parameter failed", K(from_seed), K(ret)); - } else if (OB_FAIL(seed_config_.update_local(ObSystemConfig::INIT_VERSION, result, false))) { - SERVER_LOG(WARN, "update seed config failed", K(ret)); - } else { - tenant_iter_ = seed_config_.get_container().begin(); - } - } - return ret; -} - -int ObAllVirtualTenantParameterStat::inner_seed_get_next_row(common::ObNewRow *&row) -{ - return fill_row_(row, tenant_iter_, seed_config_.get_container(), NULL); -} - int ObAllVirtualTenantParameterStat::fill_row_(common::ObNewRow *&row, CfgIter &iter, const ObConfigContainer &cfg_container, @@ -328,11 +243,7 @@ int ObAllVirtualTenantParameterStat::fill_row_(common::ObNewRow *&row, break; } case TENANT_ID: { - if (NULL == tenant_id_ptr) { - cells[i].set_null(); - } else { - cells[i].set_int(*tenant_id_ptr); - } + cells[i].set_int(OB_SYS_TENANT_ID); break; } case DEFAULT_VALUE: { diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_parameter_stat.h b/src/observer/virtual_table/ob_all_virtual_tenant_parameter_stat.h index b49435e2e..77d622d9e 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_parameter_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_tenant_parameter_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_TENANT_PARAMETER_STAT_H_ @@ -43,9 +47,6 @@ class ObAllVirtualTenantParameterStat : public common::ObVirtualTableIterator typedef common::ObConfigContainer::const_iterator CfgIter; int inner_sys_get_next_row(common::ObNewRow *&row); - int inner_tenant_get_next_row(common::ObNewRow *&row); - int update_seed(); - int inner_seed_get_next_row(common::ObNewRow *&row); int fill_row_(common::ObNewRow *&row, CfgIter &iter, const common::ObConfigContainer &cfg_container, @@ -80,8 +81,6 @@ class ObAllVirtualTenantParameterStat : public common::ObVirtualTableIterator common::ObSEArray tenant_id_list_; // all tenant in observer omt::ObTenantConfigGuard tenant_config_; // current tenant config - omt::ObTenantConfig seed_config_; // seed config - private: DISALLOW_COPY_AND_ASSIGN(ObAllVirtualTenantParameterStat); }; diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_resource_limit.cpp b/src/observer/virtual_table/ob_all_virtual_tenant_resource_limit.cpp index 507ca308d..7004a3e8a 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_resource_limit.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tenant_resource_limit.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_resource_limit.h b/src/observer/virtual_table/ob_all_virtual_tenant_resource_limit.h index bf645ca23..2b3461b4d 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_resource_limit.h +++ b/src/observer/virtual_table/ob_all_virtual_tenant_resource_limit.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_OB_TENANT_RESOURCE_LIMIT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_resource_limit_detail.cpp b/src/observer/virtual_table/ob_all_virtual_tenant_resource_limit_detail.cpp index 496dd6fe9..1cad61e6f 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_resource_limit_detail.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tenant_resource_limit_detail.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_resource_limit_detail.h b/src/observer/virtual_table/ob_all_virtual_tenant_resource_limit_detail.h index 7b2d9d93a..86845d994 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_resource_limit_detail.h +++ b/src/observer/virtual_table/ob_all_virtual_tenant_resource_limit_detail.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_OB_TENANT_RESOURCE_LIMIT_DETAIL_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_scheduler_running_job.cpp b/src/observer/virtual_table/ob_all_virtual_tenant_scheduler_running_job.cpp index 75367e26b..a52a22787 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_scheduler_running_job.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tenant_scheduler_running_job.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_tenant_scheduler_running_job.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_scheduler_running_job.h b/src/observer/virtual_table/ob_all_virtual_tenant_scheduler_running_job.h index bcc35991a..b898c3689 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_scheduler_running_job.h +++ b/src/observer/virtual_table/ob_all_virtual_tenant_scheduler_running_job.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_TENANT_SCHEDULER_RUNNING_JOB_ diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica.cpp b/src/observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica.cpp index 9c57cc4ba..74a5ba83c 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica.h b/src/observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica.h index 094fb8bd9..b094c3da7 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica.h +++ b/src/observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_OBSERVER_OB_ALL_VIRTUAL_TENANT_SNAPSHOT_LS_REPLICA_H diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica_history.cpp b/src/observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica_history.cpp index 9263813f8..de6e3cce9 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica_history.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica_history.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica_history.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica_history.h b/src/observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica_history.h index 244a4a8dd..701e39df7 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica_history.h +++ b/src/observer/virtual_table/ob_all_virtual_tenant_snapshot_ls_replica_history.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_OBSERVER_OB_ALL_VIRTUAL_TENANT_SNAPSHOT_LS_REPLICA_HISTORY_H diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_vector_mem_info.cpp b/src/observer/virtual_table/ob_all_virtual_tenant_vector_mem_info.cpp index 1a5363904..7bce34dd4 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_vector_mem_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tenant_vector_mem_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_tenant_vector_mem_info.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tenant_vector_mem_info.h b/src/observer/virtual_table/ob_all_virtual_tenant_vector_mem_info.h index 133e9f862..d60b8d7c5 100644 --- a/src/observer/virtual_table/ob_all_virtual_tenant_vector_mem_info.h +++ b/src/observer/virtual_table/ob_all_virtual_tenant_vector_mem_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TENANT_VECTOR_MEM_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_thread.cpp b/src/observer/virtual_table/ob_all_virtual_thread.cpp index fc600b1ce..08cc5a3bf 100644 --- a/src/observer/virtual_table/ob_all_virtual_thread.cpp +++ b/src/observer/virtual_table/ob_all_virtual_thread.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_thread.h" @@ -253,7 +257,7 @@ int ObAllVirtualThread::inner_get_next_row(common::ObNewRow *&row) } } if (OB_SUCC(ret)) { - // scanner最大支持64M,因此暂不考虑溢出的情况 + // scanner maximum supports 64M, therefore overflow is not considered for now if (OB_FAIL(scanner_.add_row(cur_row_))) { SERVER_LOG(WARN, "fail to add row", K(ret), K(cur_row_)); if (OB_SIZE_OVERFLOW == ret) { @@ -344,4 +348,4 @@ int ObAllVirtualThread::read_real_cgroup_path() } } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/virtual_table/ob_all_virtual_thread.h b/src/observer/virtual_table/ob_all_virtual_thread.h index 24a27ef10..959d72fbf 100644 --- a/src/observer/virtual_table/ob_all_virtual_thread.h +++ b/src/observer/virtual_table/ob_all_virtual_thread.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_THREAD_H_ @@ -64,4 +68,4 @@ class ObAllVirtualThread : public common::ObVirtualTableScannerIterator } } -#endif /* SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_THREAD_H_ */ \ No newline at end of file +#endif /* SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_THREAD_H_ */ diff --git a/src/observer/virtual_table/ob_all_virtual_timestamp_service.cpp b/src/observer/virtual_table/ob_all_virtual_timestamp_service.cpp index b35bb4c95..63e548833 100644 --- a/src/observer/virtual_table/ob_all_virtual_timestamp_service.cpp +++ b/src/observer/virtual_table/ob_all_virtual_timestamp_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_timestamp_service.h" diff --git a/src/observer/virtual_table/ob_all_virtual_timestamp_service.h b/src/observer/virtual_table/ob_all_virtual_timestamp_service.h index 93edc5d60..865f0457d 100644 --- a/src/observer/virtual_table/ob_all_virtual_timestamp_service.h +++ b/src/observer/virtual_table/ob_all_virtual_timestamp_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TIMESTAMP_SERVICE_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tmp_file.cpp b/src/observer/virtual_table/ob_all_virtual_tmp_file.cpp index 0d498f36b..c26241247 100644 --- a/src/observer/virtual_table/ob_all_virtual_tmp_file.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tmp_file.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_tmp_file.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tmp_file.h b/src/observer/virtual_table/ob_all_virtual_tmp_file.h index a7b17e123..a62c279eb 100644 --- a/src/observer/virtual_table/ob_all_virtual_tmp_file.h +++ b/src/observer/virtual_table/ob_all_virtual_tmp_file.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TMP_FILE_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tracepoint_info.cpp b/src/observer/virtual_table/ob_all_virtual_tracepoint_info.cpp index a8d362b96..9aedfa179 100644 --- a/src/observer/virtual_table/ob_all_virtual_tracepoint_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tracepoint_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_tracepoint_info.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tracepoint_info.h b/src/observer/virtual_table/ob_all_virtual_tracepoint_info.h index e8f3fae0d..266d0371e 100644 --- a/src/observer/virtual_table/ob_all_virtual_tracepoint_info.h +++ b/src/observer/virtual_table/ob_all_virtual_tracepoint_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_ALL_TRACEPOINT_INFO_ diff --git a/src/observer/virtual_table/ob_all_virtual_transaction_checkpoint.cpp b/src/observer/virtual_table/ob_all_virtual_transaction_checkpoint.cpp index d4b92bcd8..3003c4477 100644 --- a/src/observer/virtual_table/ob_all_virtual_transaction_checkpoint.cpp +++ b/src/observer/virtual_table/ob_all_virtual_transaction_checkpoint.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_transaction_checkpoint.h" diff --git a/src/observer/virtual_table/ob_all_virtual_transaction_checkpoint.h b/src/observer/virtual_table/ob_all_virtual_transaction_checkpoint.h index 83fac11cc..09a351af4 100644 --- a/src/observer/virtual_table/ob_all_virtual_transaction_checkpoint.h +++ b/src/observer/virtual_table/ob_all_virtual_transaction_checkpoint.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TRANSACTION_CHECKPOINT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_transaction_freeze_checkpoint.cpp b/src/observer/virtual_table/ob_all_virtual_transaction_freeze_checkpoint.cpp index ea48bb80c..07bad352b 100644 --- a/src/observer/virtual_table/ob_all_virtual_transaction_freeze_checkpoint.cpp +++ b/src/observer/virtual_table/ob_all_virtual_transaction_freeze_checkpoint.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_transaction_freeze_checkpoint.h" diff --git a/src/observer/virtual_table/ob_all_virtual_transaction_freeze_checkpoint.h b/src/observer/virtual_table/ob_all_virtual_transaction_freeze_checkpoint.h index a9dbc4cbe..aa4aa8c66 100644 --- a/src/observer/virtual_table/ob_all_virtual_transaction_freeze_checkpoint.h +++ b/src/observer/virtual_table/ob_all_virtual_transaction_freeze_checkpoint.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TRANSACTION_FREEZE_CHECKPOINT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tx_ctx_mgr_stat.cpp b/src/observer/virtual_table/ob_all_virtual_tx_ctx_mgr_stat.cpp index 8c70d8713..e741c4cd7 100644 --- a/src/observer/virtual_table/ob_all_virtual_tx_ctx_mgr_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tx_ctx_mgr_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_tx_ctx_mgr_stat.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tx_ctx_mgr_stat.h b/src/observer/virtual_table/ob_all_virtual_tx_ctx_mgr_stat.h index da950099d..b321a734e 100644 --- a/src/observer/virtual_table/ob_all_virtual_tx_ctx_mgr_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_tx_ctx_mgr_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TX_CTX_MGR_STAT diff --git a/src/observer/virtual_table/ob_all_virtual_tx_data.cpp b/src/observer/virtual_table/ob_all_virtual_tx_data.cpp index 20582f912..2d5e2ecab 100644 --- a/src/observer/virtual_table/ob_all_virtual_tx_data.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tx_data.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_tx_data.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tx_data.h b/src/observer/virtual_table/ob_all_virtual_tx_data.h index 978750e9d..bec26fa8c 100644 --- a/src/observer/virtual_table/ob_all_virtual_tx_data.h +++ b/src/observer/virtual_table/ob_all_virtual_tx_data.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TX_DATA_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tx_data_table.cpp b/src/observer/virtual_table/ob_all_virtual_tx_data_table.cpp index ffa3bd07d..739f66647 100644 --- a/src/observer/virtual_table/ob_all_virtual_tx_data_table.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tx_data_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_tx_data_table.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tx_data_table.h b/src/observer/virtual_table/ob_all_virtual_tx_data_table.h index efb6876c3..04543db53 100644 --- a/src/observer/virtual_table/ob_all_virtual_tx_data_table.h +++ b/src/observer/virtual_table/ob_all_virtual_tx_data_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TX_DATA_TABLE_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tx_lock_stat.cpp b/src/observer/virtual_table/ob_all_virtual_tx_lock_stat.cpp index 580a3ef3d..5c18d93e5 100644 --- a/src/observer/virtual_table/ob_all_virtual_tx_lock_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tx_lock_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_tx_lock_stat.h" @@ -290,7 +294,7 @@ int ObGVTxLockStat::process_curr_tenant(ObNewRow *&row) // proxy_session_id if (tx_lock_stat.get_proxy_session_id() > 0) { ObAddr client_server; - //解析出来client server的信息 + //Parse out the client server information (void)get_addr_by_proxy_sessid(tx_lock_stat.get_proxy_session_id(), client_server); if (client_server.is_valid()) { client_server.to_string(proxy_session_id_buffer_, OB_MIN_BUFFER_SIZE); diff --git a/src/observer/virtual_table/ob_all_virtual_tx_lock_stat.h b/src/observer/virtual_table/ob_all_virtual_tx_lock_stat.h index 44f040824..9b51fa398 100644 --- a/src/observer/virtual_table/ob_all_virtual_tx_lock_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_tx_lock_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TX_LOCK_STAT_H diff --git a/src/observer/virtual_table/ob_all_virtual_tx_scheduler_stat.cpp b/src/observer/virtual_table/ob_all_virtual_tx_scheduler_stat.cpp index 1c062beec..c30e92673 100644 --- a/src/observer/virtual_table/ob_all_virtual_tx_scheduler_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tx_scheduler_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_tx_scheduler_stat.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tx_scheduler_stat.h b/src/observer/virtual_table/ob_all_virtual_tx_scheduler_stat.h index 448a1be9c..0ca5e54a4 100644 --- a/src/observer/virtual_table/ob_all_virtual_tx_scheduler_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_tx_scheduler_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TX_SCHEDULER_STAT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_tx_stat.cpp b/src/observer/virtual_table/ob_all_virtual_tx_stat.cpp index bec94d3cb..c2504495e 100644 --- a/src/observer/virtual_table/ob_all_virtual_tx_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tx_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_tx_stat.h" diff --git a/src/observer/virtual_table/ob_all_virtual_tx_stat.h b/src/observer/virtual_table/ob_all_virtual_tx_stat.h index 740c9a39b..6ac43b9b6 100644 --- a/src/observer/virtual_table/ob_all_virtual_tx_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_tx_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_TX_STAT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_unit.cpp b/src/observer/virtual_table/ob_all_virtual_unit.cpp index f17fb7fbb..d77f8631b 100644 --- a/src/observer/virtual_table/ob_all_virtual_unit.cpp +++ b/src/observer/virtual_table/ob_all_virtual_unit.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_unit.h" diff --git a/src/observer/virtual_table/ob_all_virtual_unit.h b/src/observer/virtual_table/ob_all_virtual_unit.h index 102cf889f..4c5c05b8a 100644 --- a/src/observer/virtual_table/ob_all_virtual_unit.h +++ b/src/observer/virtual_table/ob_all_virtual_unit.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_UNIT_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_vector_index_info.cpp b/src/observer/virtual_table/ob_all_virtual_vector_index_info.cpp index 80df3a23d..6c4e06f4d 100644 --- a/src/observer/virtual_table/ob_all_virtual_vector_index_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_vector_index_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_all_virtual_vector_index_info.h" diff --git a/src/observer/virtual_table/ob_all_virtual_vector_index_info.h b/src/observer/virtual_table/ob_all_virtual_vector_index_info.h index a319a5790..99ad32963 100644 --- a/src/observer/virtual_table/ob_all_virtual_vector_index_info.h +++ b/src/observer/virtual_table/ob_all_virtual_vector_index_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_VECTOR_INDEX_INFO_H_ diff --git a/src/observer/virtual_table/ob_all_virtual_weak_read_stat.cpp b/src/observer/virtual_table/ob_all_virtual_weak_read_stat.cpp index 486429a74..193b4b873 100644 --- a/src/observer/virtual_table/ob_all_virtual_weak_read_stat.cpp +++ b/src/observer/virtual_table/ob_all_virtual_weak_read_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_all_virtual_weak_read_stat.h" @@ -56,7 +60,7 @@ int ObAllVirtualWeakReadStat::inner_get_next_row(ObNewRow *&row) all_tenants.set_label(ObModIds::OB_TENANT_ID_LIST); GCTX.omt_->get_tenant_ids(all_tenants); for (int64_t index = 0; OB_SUCCESS == ret && index < all_tenants.size(); index++) { - //对每个租户,切换租户上下文,获得列数据 + // For each tenant, switch tenant context to obtain column data tenant_id = all_tenants[index]; char self_ip_buf[common::OB_IP_STR_BUFF]; char master_ip_buf[common::OB_IP_STR_BUFF]; diff --git a/src/observer/virtual_table/ob_all_virtual_weak_read_stat.h b/src/observer/virtual_table/ob_all_virtual_weak_read_stat.h index d063ef399..94e90e249 100644 --- a/src/observer/virtual_table/ob_all_virtual_weak_read_stat.h +++ b/src/observer/virtual_table/ob_all_virtual_weak_read_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_ALL_VIRTUAL_WEAK_READ_STAT_H_ diff --git a/src/observer/virtual_table/ob_global_variables.cpp b/src/observer/virtual_table/ob_global_variables.cpp index d05b4882b..e5ca0fb35 100644 --- a/src/observer/virtual_table/ob_global_variables.cpp +++ b/src/observer/virtual_table/ob_global_variables.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_global_variables.h" diff --git a/src/observer/virtual_table/ob_global_variables.h b/src/observer/virtual_table/ob_global_variables.h index 33a0df6a7..1c106b19a 100644 --- a/src/observer/virtual_table/ob_global_variables.h +++ b/src/observer/virtual_table/ob_global_variables.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_GLOBAL_VARIABLES_ diff --git a/src/observer/virtual_table/ob_gv_sql.cpp b/src/observer/virtual_table/ob_gv_sql.cpp index b4073e5a0..f56564580 100644 --- a/src/observer/virtual_table/ob_gv_sql.cpp +++ b/src/observer/virtual_table/ob_gv_sql.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_gv_sql.h" @@ -67,7 +71,7 @@ int ObGVSql::inner_open() int ObGVSql::get_row_from_specified_tenant(uint64_t tenant_id, bool &is_end) { int ret = OB_SUCCESS; - // !!! 引用plan cache资源前必须加ObReqTimeGuard + // !!! Must add ObReqTimeGuard before referencing plan cache resources ObReqTimeGuard req_timeinfo_guard; is_end = false; if (OB_INVALID_ID == static_cast(plan_id_array_idx_)) { @@ -105,9 +109,8 @@ int ObGVSql::get_row_from_specified_tenant(uint64_t tenant_id, bool &is_end) uint64_t plan_id= plan_id_array_.at(plan_id_array_idx_); ++plan_id_array_idx_; ObCacheObjGuard guard(PC_DIAG_HANDLE); - int tmp_ret = plan_cache_->ref_alloc_obj(plan_id, guard); //plan引用计数加1 - - //如果当前plan_id对应的plan已被淘汰, 则忽略继续获取下一个plan + int tmp_ret = plan_cache_->ref_alloc_obj(plan_id, guard); // increment plan reference count by 1 + // If the plan corresponding to the current plan_id has been phased out, then ignore and continue to get the next plan if (OB_HASH_NOT_EXIST == tmp_ret) { //do nothing; } else if (OB_SUCCESS != tmp_ret) { diff --git a/src/observer/virtual_table/ob_gv_sql.h b/src/observer/virtual_table/ob_gv_sql.h index 0a6cf0a8a..3fb58fca6 100644 --- a/src/observer/virtual_table/ob_gv_sql.h +++ b/src/observer/virtual_table/ob_gv_sql.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_GV_SQL_H diff --git a/src/observer/virtual_table/ob_gv_sql_audit.cpp b/src/observer/virtual_table/ob_gv_sql_audit.cpp index 90521082d..97a6af2cc 100644 --- a/src/observer/virtual_table/ob_gv_sql_audit.cpp +++ b/src/observer/virtual_table/ob_gv_sql_audit.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_gv_sql_audit.h" @@ -120,9 +124,9 @@ int ObGvSqlAudit::check_ip_and_port(bool &is_valid) int ret = OB_SUCCESS; is_valid = true; - // is_serving_tenant被改成 (svr_ip, svr_port) in (ip1, port1), (ip2, port2), ... - // 抽出来的query range为[(ip1, port1), (ip1, port1)], [(ip2, port2), (ip2, port2)], ... - // 需要遍历所有query range,判断本机的ip & port是否落在某一个query range中 + // is_serving_tenant changed to (svr_ip, svr_port) in (ip1, port1), (ip2, port2), ... + // The extracted query range is [(ip1, port1), (ip1, port1)], [(ip2, port2), (ip2, port2)], ... + // Need to traverse all query ranges, and determine if the local ip & port falls within any one of the query ranges if (key_ranges_.count() >= 1) { is_valid = false; for (int64_t i = 0; OB_SUCC(ret) && !is_valid && i < key_ranges_.count(); i++) { @@ -215,9 +219,9 @@ int ObGvSqlAudit::inner_get_next_row(common::ObNewRow *&row) } else { with_tenant_ctx_ = new(buff) ObTenantSpaceFetcher(t_id); if (OB_FAIL(with_tenant_ctx_->get_ret())) { - // 如果指定tenant id查询, 且当前机器没有该租户资源时, 获取 - // tenant space会报OB_TENANT_NOT_IN_SERVER, 此时需要忽略该报 - // 错, 返回该租户的sql audit记录为空 + // If specified tenant id is queried, and the current machine does not have resources for this tenant, get + // tenant space will report OB_TENANT_NOT_IN_SERVER, at this time the report needs to be ignored + // Wrong, return the sql audit record of this tenant as empty if (OB_TENANT_NOT_IN_SERVER == ret) { ret = OB_SUCCESS; continue; diff --git a/src/observer/virtual_table/ob_gv_sql_audit.h b/src/observer/virtual_table/ob_gv_sql_audit.h index 1e1eb22ff..6cb046e15 100644 --- a/src/observer/virtual_table/ob_gv_sql_audit.h +++ b/src/observer/virtual_table/ob_gv_sql_audit.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_GV_SQL_AUDIT_ diff --git a/src/observer/virtual_table/ob_information_check_constraints_table.cpp b/src/observer/virtual_table/ob_information_check_constraints_table.cpp index 4e190b9a3..cc2a81e09 100644 --- a/src/observer/virtual_table/ob_information_check_constraints_table.cpp +++ b/src/observer/virtual_table/ob_information_check_constraints_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_information_check_constraints_table.h" diff --git a/src/observer/virtual_table/ob_information_check_constraints_table.h b/src/observer/virtual_table/ob_information_check_constraints_table.h index ca36a0f6a..2e3387bfd 100644 --- a/src/observer/virtual_table/ob_information_check_constraints_table.h +++ b/src/observer/virtual_table/ob_information_check_constraints_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_CHECK_CONSTRAINTS_ diff --git a/src/observer/virtual_table/ob_information_columns_table.cpp b/src/observer/virtual_table/ob_information_columns_table.cpp index 4fbfdff87..70e67882a 100644 --- a/src/observer/virtual_table/ob_information_columns_table.cpp +++ b/src/observer/virtual_table/ob_information_columns_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -76,11 +80,11 @@ int ObInfoSchemaColumnsTable::inner_get_next_row(common::ObNewRow *&row) } else { if (!start_to_read_) { void *tmp_ptr = NULL; - // 如果无db filter(is_filter_db_: false), - // check_database_table_filter里面最多一次循环: start_key=MIN,MIN, end_key=MAX,MAX + // If there is no db filter (is_filter_db_: false), + // inside check_database_table_filter, the maximum number of loops is: start_key=MIN,MIN, end_key=MAX,MAX if (!is_filter_db_ && OB_FAIL(check_database_table_filter())) { SERVER_LOG(WARN, "fail to check database and table filter", K(ret)); - // 当指定了db_name后,无需直接遍历租户所有的database_schema_array + // When db_name is specified, there is no need to directly iterate over the tenant's entire database_schema_array } else if (!is_filter_db_ && OB_FAIL(schema_guard_->get_database_schemas_in_tenant( tenant_id_, database_schema_array_))) { SERVER_LOG(WARN, "fail to get database schemas in tenant", K(ret), @@ -99,12 +103,11 @@ int ObInfoSchemaColumnsTable::inner_get_next_row(common::ObNewRow *&row) column_type_str_len_ = OB_MAX_SYS_PARAM_NAME_LENGTH; view_resolve_alloc_.set_tenant_id(tenant_id_); } - // - // 分两部分进行遍历: + // Traverse in two parts: // database_schema_array + table_schema_array // - // 1. 扫描database_schema_array + // 1. Scan database_schema_array int64_t i = 0; if (last_schema_idx_ != -1) { i = last_schema_idx_; @@ -125,10 +128,8 @@ int ObInfoSchemaColumnsTable::inner_get_next_row(common::ObNewRow *&row) SERVER_LOG(WARN, "fail to iterate all table schema. ", K(ret)); } } // end for database_schema_array_ loop - - - // 2. 扫描table_schema_array - // 扫描完database_schema_array,继续扫描filter_table_schema_array + // 2. scan table_schema_array + // Scan complete for database_schema_array, continue scanning filter_table_schema_array if (OB_SUCC(ret) && database_schema_array_.count() == i) { is_filter_table_schema = true; if (OB_FAIL(iterate_table_schema_array(is_filter_table_schema, -1))) { @@ -169,7 +170,7 @@ int ObInfoSchemaColumnsTable::iterate_table_schema_array(const bool is_filter_ta const ObDatabaseSchema *database_schema = NULL; ObArray table_schema_array; int64_t table_schema_array_size = 0; - // 处理table_schema_array分页 + // Handle table_schema_array pagination int64_t i = 0; if (!is_filter_table_schema && OB_UNLIKELY(last_db_schema_idx < 0)) { ret = OB_ERR_UNEXPECTED; @@ -213,7 +214,7 @@ int ObInfoSchemaColumnsTable::iterate_table_schema_array(const bool is_filter_ta SERVER_LOG(WARN, "table_schema should not be NULL", K(ret)); } else { bool is_normal_view = table_schema->is_view_table()&& !table_schema->is_materialized_view() && (table_schema->get_table_state_flag() == ObTableStateFlag::TABLE_STATE_NORMAL || table_schema->get_table_state_flag() == ObTableStateFlag::TABLE_STATE_OFFLINE_DDL); - // 不显示索引表 + // Do not display index table if (table_schema->is_aux_table() || table_schema->is_tmp_table() || table_schema->is_in_recyclebin() @@ -305,7 +306,7 @@ int ObInfoSchemaColumnsTable::iterate_column_schema_array( { int ret = OB_SUCCESS; uint64_t ordinal_position = 0; - // 记录column的逻辑顺序 + // Record the logical order of column uint64_t logical_index = 0; if (last_column_idx_ != -1) { logical_index = last_column_idx_; @@ -321,7 +322,7 @@ int ObInfoSchemaColumnsTable::iterate_column_schema_array( ret = OB_ERR_UNEXPECTED; SERVER_LOG(WARN, "column_schema is NULL", K(ret)); } else { - // 不显示隐藏pk + // Do not display hidden pk if (column_schema->is_hidden()) { continue; } @@ -363,15 +364,14 @@ int ObInfoSchemaColumnsTable::iterate_column_schema_array( } return ret; } - -// 过滤策略: -// 如果key_ranges_抽出来db_name -// 直接遍历当前的database_schema_array, -// 则不再从schema guard中获取租户的所有database_schema_array; -// 不管是否为有效的db_name, is_filter_db_均置为true -// 如果抽出来table_name -// 直接遍历当前的table_schema_array, -// 则不再从database_schema中获取所有的table schema +// Filter strategy: +// If key_ranges_ is extracted to db_name +// directly traverse the current database_schema_array, +// then no longer obtain the tenant's entire database_schema_array from the schema guard; +// Regardless of whether db_name is valid, is_filter_db_ is set to true +// if extracted table_name +// directly traverse the current table_schema_array, +// then no longer retrieve all table schemas from database_schema int ObInfoSchemaColumnsTable::check_database_table_filter() { int ret = OB_SUCCESS; @@ -393,9 +393,9 @@ int ObInfoSchemaColumnsTable::check_database_table_filter() } else if (start_key_obj_ptr[0].is_varchar_or_char() && end_key_obj_ptr[0].is_varchar_or_char() && start_key_obj_ptr[0] == end_key_obj_ptr[0]) { - // 表示至少指定了db_name - // 包含过滤条件为db_name + table_name - // 则无需获取租户下所有的database_schema + // Indicates that at least db_name is specified + // Include filter condition as db_name + table_name + // then there is no need to obtain all database_schemas under the tenant ObString database_name = CS_TYPE_BINARY == start_key_obj_ptr[0].get_collation_type() ? start_key_obj_ptr[0].get_varchar() : start_key_obj_ptr[0].get_varchar().trim_end_space_only(); @@ -408,7 +408,7 @@ int ObInfoSchemaColumnsTable::check_database_table_filter() } else if (start_key_obj_ptr[1].is_varchar_or_char() && end_key_obj_ptr[1].is_varchar_or_char() && start_key_obj_ptr[1] == end_key_obj_ptr[1]) { - // 指定db_name,同时指定了tbl_name + // Specify db_name, simultaneously specifying tbl_name const ObTableSchema *filter_table_schema = NULL; ObString table_name = CS_TYPE_BINARY == start_key_obj_ptr[1].get_collation_type() ? start_key_obj_ptr[1].get_varchar() @@ -424,7 +424,7 @@ int ObInfoSchemaColumnsTable::check_database_table_filter() } else if (OB_FAIL(filter_table_schema_array_.push_back(filter_table_schema))) { SERVER_LOG(WARN, "push_back failed", K(filter_table_schema->get_table_name())); } - // 此时只指定了db_name,直接将该db push_back进入filter_database_schema_array + // At this point, only db_name is specified, directly push_back this db into filter_database_schema_array } else if (OB_FAIL(add_var_to_array_no_dup(database_schema_array_, filter_database_schema))) { SERVER_LOG(WARN, "push_back failed", K(filter_database_schema->get_database_name())); } @@ -827,7 +827,7 @@ int ObInfoSchemaColumnsTable::fill_row_cells(const ObString &database_name, case EXTRA: { //TODO ObString extra = ObString::make_string(""); - // auto_increment 和 on update current_timestamp 不会同时出现在同一列上 + // auto_increment and on update current_timestamp will not appear on the same column at the same time if (column_schema->is_autoincrement()) { extra = ObString::make_string("auto_increment"); } else if (column_schema->is_on_update_current_timestamp()) { diff --git a/src/observer/virtual_table/ob_information_columns_table.h b/src/observer/virtual_table/ob_information_columns_table.h index d5d283caa..950795610 100644 --- a/src/observer/virtual_table/ob_information_columns_table.h +++ b/src/observer/virtual_table/ob_information_columns_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_COLUMNS_TABLE_ diff --git a/src/observer/virtual_table/ob_information_global_status_table.cpp b/src/observer/virtual_table/ob_information_global_status_table.cpp index 0e0d6f7a5..0fe9cd490 100644 --- a/src/observer/virtual_table/ob_information_global_status_table.cpp +++ b/src/observer/virtual_table/ob_information_global_status_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_information_global_status_table.h" @@ -177,7 +181,7 @@ int ObInfoSchemaGlobalStatusTable::inner_get_next_row(ObNewRow *&row) start_to_read_ = true; } } - // 无需考虑返回码,不管成功与否都需要释放内存 + // No need to consider the return code, memory must be released regardless of success or failure int tmp_ret = OB_SUCCESS; if (OB_SUCCESS != (tmp_ret = all_status.destroy())) { SERVER_LOG(WARN, "fail to destroy all status", K(tmp_ret)); diff --git a/src/observer/virtual_table/ob_information_global_status_table.h b/src/observer/virtual_table/ob_information_global_status_table.h index bf896444d..2ab1bc839 100644 --- a/src/observer/virtual_table/ob_information_global_status_table.h +++ b/src/observer/virtual_table/ob_information_global_status_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_GLOBAL_STATUS_TABLE_ diff --git a/src/observer/virtual_table/ob_information_kvcache_table.cpp b/src/observer/virtual_table/ob_information_kvcache_table.cpp index 03e497ff8..4226b113c 100644 --- a/src/observer/virtual_table/ob_information_kvcache_table.cpp +++ b/src/observer/virtual_table/ob_information_kvcache_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_information_kvcache_table.h" diff --git a/src/observer/virtual_table/ob_information_kvcache_table.h b/src/observer/virtual_table/ob_information_kvcache_table.h index 9bac130be..5f64c3f43 100644 --- a/src/observer/virtual_table/ob_information_kvcache_table.h +++ b/src/observer/virtual_table/ob_information_kvcache_table.h @@ -1,83 +1,86 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ - -#ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_KVCACHE_TABLE_ -#define OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_KVCACHE_TABLE_ - -#include "share/ob_virtual_table_scanner_iterator.h" -#include "share/cache/ob_kv_storecache.h" -#include "lib/stat/ob_di_cache.h" - - -namespace oceanbase -{ -namespace common -{ -class ObObj; -} - -namespace observer -{ - -class ObInfoSchemaKvCacheTable : public common::ObVirtualTableScannerIterator -{ -public: - ObInfoSchemaKvCacheTable(); - virtual ~ObInfoSchemaKvCacheTable(); - virtual int inner_get_next_row(common::ObNewRow *&row); - virtual void reset(); - inline void set_addr(common::ObAddr &addr) {addr_ = &addr;} - -private: - virtual int set_ip(); - virtual int inner_open() override; - int get_tenant_info(); - int get_handles(ObKVCacheInst *&inst, ObDiagnoseTenantInfo *& tenant_info); - int set_diagnose_info(ObKVCacheInst *inst, ObDiagnoseTenantInfo *tenant_info); - int process_row(const ObKVCacheInst *inst); - -private: - enum CACHE_COLUMN - { - TENANT_ID = common::OB_APP_MIN_COLUMN_ID, - SVR_IP, - SVR_PORT, - CACHE_NAME, - CACHE_ID, - PRIORITY, - CACHE_SIZE, - CACHE_STORE_SIZE, - CACHE_MAP_SIZE, - KV_CNT, - HIT_RATIO, - TOTAL_PUT_CNT, - TOTAL_HIT_CNT, - TOTAL_MISS_CNT, - HOLD_SIZE - }; - common::ObAddr *addr_; - common::ObString ipstr_; - int32_t port_; - common::ObSEArray inst_handles_; - int16_t cache_iter_; - common::ObStringBuf str_buf_; - common::ObObj cells_[common::OB_ROW_MAX_COLUMNS_COUNT]; - common::ObArenaAllocator arenallocator_; - common::ObDiagnoseTenantInfo tenant_di_info_; - common::ObArray > tenant_dis_; - DISALLOW_COPY_AND_ASSIGN(ObInfoSchemaKvCacheTable); -}; - -} -} -#endif /* OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_KVCACHE_TABLE */ - +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ + +#ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_KVCACHE_TABLE_ +#define OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_KVCACHE_TABLE_ + +#include "share/ob_virtual_table_scanner_iterator.h" +#include "share/cache/ob_kv_storecache.h" +#include "lib/stat/ob_di_cache.h" + + +namespace oceanbase +{ +namespace common +{ +class ObObj; +} + +namespace observer +{ + +class ObInfoSchemaKvCacheTable : public common::ObVirtualTableScannerIterator +{ +public: + ObInfoSchemaKvCacheTable(); + virtual ~ObInfoSchemaKvCacheTable(); + virtual int inner_get_next_row(common::ObNewRow *&row); + virtual void reset(); + inline void set_addr(common::ObAddr &addr) {addr_ = &addr;} + +private: + virtual int set_ip(); + virtual int inner_open() override; + int get_tenant_info(); + int get_handles(ObKVCacheInst *&inst, ObDiagnoseTenantInfo *& tenant_info); + int set_diagnose_info(ObKVCacheInst *inst, ObDiagnoseTenantInfo *tenant_info); + int process_row(const ObKVCacheInst *inst); + +private: + enum CACHE_COLUMN + { + TENANT_ID = common::OB_APP_MIN_COLUMN_ID, + SVR_IP, + SVR_PORT, + CACHE_NAME, + CACHE_ID, + PRIORITY, + CACHE_SIZE, + CACHE_STORE_SIZE, + CACHE_MAP_SIZE, + KV_CNT, + HIT_RATIO, + TOTAL_PUT_CNT, + TOTAL_HIT_CNT, + TOTAL_MISS_CNT, + HOLD_SIZE + }; + common::ObAddr *addr_; + common::ObString ipstr_; + int32_t port_; + common::ObSEArray inst_handles_; + int16_t cache_iter_; + common::ObStringBuf str_buf_; + common::ObObj cells_[common::OB_ROW_MAX_COLUMNS_COUNT]; + common::ObArenaAllocator arenallocator_; + common::ObDiagnoseTenantInfo tenant_di_info_; + common::ObArray > tenant_dis_; + DISALLOW_COPY_AND_ASSIGN(ObInfoSchemaKvCacheTable); +}; + +} +} +#endif /* OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_KVCACHE_TABLE */ diff --git a/src/observer/virtual_table/ob_information_parameters_table.cpp b/src/observer/virtual_table/ob_information_parameters_table.cpp index 807e20e82..b81b76a2f 100644 --- a/src/observer/virtual_table/ob_information_parameters_table.cpp +++ b/src/observer/virtual_table/ob_information_parameters_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_information_parameters_table.h" diff --git a/src/observer/virtual_table/ob_information_parameters_table.h b/src/observer/virtual_table/ob_information_parameters_table.h index 965aa789c..cb006f1ea 100644 --- a/src/observer/virtual_table/ob_information_parameters_table.h +++ b/src/observer/virtual_table/ob_information_parameters_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SRC_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_PARAMETERS_TABLE_H_ diff --git a/src/observer/virtual_table/ob_information_partitions_table.cpp b/src/observer/virtual_table/ob_information_partitions_table.cpp index 0036a4d2a..79ed5f349 100644 --- a/src/observer/virtual_table/ob_information_partitions_table.cpp +++ b/src/observer/virtual_table/ob_information_partitions_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_information_partitions_table.h" diff --git a/src/observer/virtual_table/ob_information_partitions_table.h b/src/observer/virtual_table/ob_information_partitions_table.h index 59a9b796d..7264e4d57 100644 --- a/src/observer/virtual_table/ob_information_partitions_table.h +++ b/src/observer/virtual_table/ob_information_partitions_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_PARTITIONS_TABLE_ diff --git a/src/observer/virtual_table/ob_information_query_response_time.cpp b/src/observer/virtual_table/ob_information_query_response_time.cpp index ad1af3234..a812277c7 100644 --- a/src/observer/virtual_table/ob_information_query_response_time.cpp +++ b/src/observer/virtual_table/ob_information_query_response_time.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_information_query_response_time.h" diff --git a/src/observer/virtual_table/ob_information_query_response_time.h b/src/observer/virtual_table/ob_information_query_response_time.h index efb959b27..0802992d4 100644 --- a/src/observer/virtual_table/ob_information_query_response_time.h +++ b/src/observer/virtual_table/ob_information_query_response_time.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_QUERY_RESPONSE_TIME_ diff --git a/src/observer/virtual_table/ob_information_referential_constraints_table.cpp b/src/observer/virtual_table/ob_information_referential_constraints_table.cpp index 31d2c0c0f..8fbc5f693 100644 --- a/src/observer/virtual_table/ob_information_referential_constraints_table.cpp +++ b/src/observer/virtual_table/ob_information_referential_constraints_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_information_referential_constraints_table.h" diff --git a/src/observer/virtual_table/ob_information_referential_constraints_table.h b/src/observer/virtual_table/ob_information_referential_constraints_table.h index 2014a4baa..357a5d009 100644 --- a/src/observer/virtual_table/ob_information_referential_constraints_table.h +++ b/src/observer/virtual_table/ob_information_referential_constraints_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_REFERENTIAL_CONSTRAINTS_ diff --git a/src/observer/virtual_table/ob_information_schema_enable_roles_table.cpp b/src/observer/virtual_table/ob_information_schema_enable_roles_table.cpp index a7c4a81c3..c3677e50d 100644 --- a/src/observer/virtual_table/ob_information_schema_enable_roles_table.cpp +++ b/src/observer/virtual_table/ob_information_schema_enable_roles_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_information_schema_enable_roles_table.h b/src/observer/virtual_table/ob_information_schema_enable_roles_table.h index 56d834f38..a64aa487e 100644 --- a/src/observer/virtual_table/ob_information_schema_enable_roles_table.h +++ b/src/observer/virtual_table/ob_information_schema_enable_roles_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_INFORMATION_SCHEMA_ENABLE_ROLES_ diff --git a/src/observer/virtual_table/ob_information_schema_privileges_table.cpp b/src/observer/virtual_table/ob_information_schema_privileges_table.cpp index 5c678d7f4..cc6244e7c 100644 --- a/src/observer/virtual_table/ob_information_schema_privileges_table.cpp +++ b/src/observer/virtual_table/ob_information_schema_privileges_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_information_schema_privileges_table.h b/src/observer/virtual_table/ob_information_schema_privileges_table.h index 8b8928466..f4c4892ed 100644 --- a/src/observer/virtual_table/ob_information_schema_privileges_table.h +++ b/src/observer/virtual_table/ob_information_schema_privileges_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_SCHEMA_PRIVILEGES_ diff --git a/src/observer/virtual_table/ob_information_session_status_table.cpp b/src/observer/virtual_table/ob_information_session_status_table.cpp index 0d8f6baab..33b734894 100644 --- a/src/observer/virtual_table/ob_information_session_status_table.cpp +++ b/src/observer/virtual_table/ob_information_session_status_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_information_session_status_table.h" @@ -177,7 +181,7 @@ int ObInfoSchemaSessionStatusTable::inner_get_next_row(ObNewRow *&row) start_to_read_ = true; } } - // 无需考虑返回码,不管成功与否都需要释放内存 + // No need to consider the return code, memory should be released regardless of success or failure int tmp_ret = OB_SUCCESS; if (OB_SUCCESS != (tmp_ret = all_status.destroy())) { SERVER_LOG(WARN, "fail to destroy all status", K(tmp_ret)); diff --git a/src/observer/virtual_table/ob_information_session_status_table.h b/src/observer/virtual_table/ob_information_session_status_table.h index 354eb844d..2ad742f86 100644 --- a/src/observer/virtual_table/ob_information_session_status_table.h +++ b/src/observer/virtual_table/ob_information_session_status_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_SESSION_STATUS_TABLE_ diff --git a/src/observer/virtual_table/ob_information_session_variables_table.cpp b/src/observer/virtual_table/ob_information_session_variables_table.cpp index 4fe5db4c2..715a69680 100644 --- a/src/observer/virtual_table/ob_information_session_variables_table.cpp +++ b/src/observer/virtual_table/ob_information_session_variables_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_information_session_variables_table.h" diff --git a/src/observer/virtual_table/ob_information_session_variables_table.h b/src/observer/virtual_table/ob_information_session_variables_table.h index 1ff38237f..e69ada148 100644 --- a/src/observer/virtual_table/ob_information_session_variables_table.h +++ b/src/observer/virtual_table/ob_information_session_variables_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_SESSION_VARIABLES_TABLE_ diff --git a/src/observer/virtual_table/ob_information_table_constraints_table.cpp b/src/observer/virtual_table/ob_information_table_constraints_table.cpp index 7679426ba..fccc25a62 100644 --- a/src/observer/virtual_table/ob_information_table_constraints_table.cpp +++ b/src/observer/virtual_table/ob_information_table_constraints_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_information_table_constraints_table.h" diff --git a/src/observer/virtual_table/ob_information_table_constraints_table.h b/src/observer/virtual_table/ob_information_table_constraints_table.h index 77af35bd7..6266e60dd 100644 --- a/src/observer/virtual_table/ob_information_table_constraints_table.h +++ b/src/observer/virtual_table/ob_information_table_constraints_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_TABLE_CONSTRAINTS_ diff --git a/src/observer/virtual_table/ob_information_table_privileges_table.cpp b/src/observer/virtual_table/ob_information_table_privileges_table.cpp index 27f8581bb..d059e2ca6 100644 --- a/src/observer/virtual_table/ob_information_table_privileges_table.cpp +++ b/src/observer/virtual_table/ob_information_table_privileges_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_information_table_privileges_table.h b/src/observer/virtual_table/ob_information_table_privileges_table.h index aa7846ccf..7566e2fbd 100644 --- a/src/observer/virtual_table/ob_information_table_privileges_table.h +++ b/src/observer/virtual_table/ob_information_table_privileges_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_TABLE_PRIVILEGES_ diff --git a/src/observer/virtual_table/ob_information_triggers_table.cpp b/src/observer/virtual_table/ob_information_triggers_table.cpp index abc875a11..140b046e2 100644 --- a/src/observer/virtual_table/ob_information_triggers_table.cpp +++ b/src/observer/virtual_table/ob_information_triggers_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_information_triggers_table.h" @@ -66,7 +70,7 @@ int ObInfoSchemaTriggersTable::inner_get_next_row(ObNewRow *&row) ret = OB_ERR_UNEXPECTED; SERVER_LOG(WARN, "Trigger info should not be null", K(ret)); } else if (tg_info->is_in_recyclebin()) { - //在回收站中的trigger不需要展示 + //triggers in the recycle bin do not need to be displayed } else if (OB_FAIL(exec_env.init(tg_info->get_package_exec_env()))) { SERVER_LOG(ERROR, "fail to load exec env", K(ret)); } else { @@ -77,7 +81,7 @@ int ObInfoSchemaTriggersTable::inner_get_next_row(ObNewRow *&row) K(tg_info->get_owner_id()), K(ret)); } else { if (OB_NOT_NULL(user_info)) { - // 这里兼容mysql,如果user存在,则给user_name赋值,如果user已经被删除,则user_name = "" + // Here compatibility with mysql is ensured, if user exists, then assign value to user_name, if user has been deleted, then user_name = "" const int64_t USERNAME_AUX_LEN = 6;// "''@''" + '\0' int64_t pos = 0; int64_t buf_size = user_info->get_user_name_str().length() diff --git a/src/observer/virtual_table/ob_information_triggers_table.h b/src/observer/virtual_table/ob_information_triggers_table.h index 7ab6da731..fa0b9d0bd 100644 --- a/src/observer/virtual_table/ob_information_triggers_table.h +++ b/src/observer/virtual_table/ob_information_triggers_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SRC_OBSERVER_VIRTUAL_TABLE_OB_INFORMATION_TRIGGERS_TABLE_H_ diff --git a/src/observer/virtual_table/ob_information_user_privileges_table.cpp b/src/observer/virtual_table/ob_information_user_privileges_table.cpp index 64d62a4cf..7dcb01ecc 100644 --- a/src/observer/virtual_table/ob_information_user_privileges_table.cpp +++ b/src/observer/virtual_table/ob_information_user_privileges_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -89,6 +93,14 @@ ObInfoSchemaUserPrivilegesTable::StaticInit::StaticInit() "CREATE CATALOG"; ObInfoSchemaUserPrivilegesTable::priv_type_strs[OB_PRIV_USE_CATALOG_SHIFT] = "USE CATALOG"; + ObInfoSchemaUserPrivilegesTable::priv_type_strs[OB_PRIV_CREATE_AI_MODEL_SHIFT] = + "CREATE AI MODEL"; + ObInfoSchemaUserPrivilegesTable::priv_type_strs[OB_PRIV_ALTER_AI_MODEL_SHIFT] = + "ALTER AI MODEL"; + ObInfoSchemaUserPrivilegesTable::priv_type_strs[OB_PRIV_DROP_AI_MODEL_SHIFT] = + "DROP AI MODEL"; + ObInfoSchemaUserPrivilegesTable::priv_type_strs[OB_PRIV_ACCESS_AI_MODEL_SHIFT] = + "ACCESS AI MODEL"; } ObInfoSchemaUserPrivilegesTable::ObInfoSchemaUserPrivilegesTable() diff --git a/src/observer/virtual_table/ob_information_user_privileges_table.h b/src/observer/virtual_table/ob_information_user_privileges_table.h index edb895784..f2f6fcee6 100644 --- a/src/observer/virtual_table/ob_information_user_privileges_table.h +++ b/src/observer/virtual_table/ob_information_user_privileges_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_USER_PRIVILEGES_ diff --git a/src/observer/virtual_table/ob_iterate_private_virtual_table.cpp b/src/observer/virtual_table/ob_iterate_private_virtual_table.cpp index 446781c60..49a0fa425 100644 --- a/src/observer/virtual_table/ob_iterate_private_virtual_table.cpp +++ b/src/observer/virtual_table/ob_iterate_private_virtual_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_iterate_private_virtual_table.h b/src/observer/virtual_table/ob_iterate_private_virtual_table.h index c0380c8f2..8ab380cfa 100644 --- a/src/observer/virtual_table/ob_iterate_private_virtual_table.h +++ b/src/observer/virtual_table/ob_iterate_private_virtual_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_VIRTUAL_TABLE_OB_ITERATE_PRIVATE_VIRTUAL_TABLE_H_ diff --git a/src/observer/virtual_table/ob_iterate_virtual_table.cpp b/src/observer/virtual_table/ob_iterate_virtual_table.cpp index 06c4de051..ea0febdbf 100644 --- a/src/observer/virtual_table/ob_iterate_virtual_table.cpp +++ b/src/observer/virtual_table/ob_iterate_virtual_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_iterate_virtual_table.h b/src/observer/virtual_table/ob_iterate_virtual_table.h index 6f5966003..a0c15e2c2 100644 --- a/src/observer/virtual_table/ob_iterate_virtual_table.h +++ b/src/observer/virtual_table/ob_iterate_virtual_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_VIRTUAL_TABLE_OB_ITERATE_VIRTUAL_TABLE_H_ diff --git a/src/observer/virtual_table/ob_mds_event_buffer.h b/src/observer/virtual_table/ob_mds_event_buffer.h index c9865c49a..00f7e51f5 100644 --- a/src/observer/virtual_table/ob_mds_event_buffer.h +++ b/src/observer/virtual_table/ob_mds_event_buffer.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef VEITUAL_TABLE_OB_MDS_EVENT_BUFFER_H diff --git a/src/observer/virtual_table/ob_mem_leak_checker_info.cpp b/src/observer/virtual_table/ob_mem_leak_checker_info.cpp index 1451fbb6d..97a591751 100644 --- a/src/observer/virtual_table/ob_mem_leak_checker_info.cpp +++ b/src/observer/virtual_table/ob_mem_leak_checker_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_mem_leak_checker_info.h" diff --git a/src/observer/virtual_table/ob_mem_leak_checker_info.h b/src/observer/virtual_table/ob_mem_leak_checker_info.h index f1bf2d15c..161a21a08 100644 --- a/src/observer/virtual_table/ob_mem_leak_checker_info.h +++ b/src/observer/virtual_table/ob_mem_leak_checker_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OB_MEM_LEAK_CHECKER_INFO_H_ diff --git a/src/observer/virtual_table/ob_mysql_db_table.cpp b/src/observer/virtual_table/ob_mysql_db_table.cpp index a53b59f41..cf8941c1a 100644 --- a/src/observer/virtual_table/ob_mysql_db_table.cpp +++ b/src/observer/virtual_table/ob_mysql_db_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_mysql_db_table.h" @@ -66,7 +70,7 @@ int ObMySQLDBTable::inner_get_next_row(common::ObNewRow *&row) if ((ObString(ObString(OB_ORA_SYS_SCHEMA_NAME)) == db_priv->get_database_name_str()) || (ObString(ObString(OB_ORA_LBACSYS_NAME)) == db_priv->get_database_name_str()) || (ObString(ObString(OB_ORA_AUDITOR_NAME)) == db_priv->get_database_name_str())) { - // oracle db不需要展示出来 + // oracle db does not need to be displayed continue; } if (OB_FAIL(get_user_info(tenant_id_, db_priv->get_user_id(), user_info))) { diff --git a/src/observer/virtual_table/ob_mysql_db_table.h b/src/observer/virtual_table/ob_mysql_db_table.h index 4488fa13f..365bb330e 100644 --- a/src/observer/virtual_table/ob_mysql_db_table.h +++ b/src/observer/virtual_table/ob_mysql_db_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_MYSQL_DB_TABLE_ diff --git a/src/observer/virtual_table/ob_mysql_proc_table.cpp b/src/observer/virtual_table/ob_mysql_proc_table.cpp index e7ced86f1..7873ed467 100644 --- a/src/observer/virtual_table/ob_mysql_proc_table.cpp +++ b/src/observer/virtual_table/ob_mysql_proc_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_mysql_proc_table.h" diff --git a/src/observer/virtual_table/ob_mysql_proc_table.h b/src/observer/virtual_table/ob_mysql_proc_table.h index 583b7765c..1b21bb6f6 100644 --- a/src/observer/virtual_table/ob_mysql_proc_table.h +++ b/src/observer/virtual_table/ob_mysql_proc_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SRC_OBSERVER_VIRTUAL_TABLE_OB_MYSQL_PROC_TABLE_H_ diff --git a/src/observer/virtual_table/ob_mysql_user_table.cpp b/src/observer/virtual_table/ob_mysql_user_table.cpp index 2b6846310..8abbdeeb6 100644 --- a/src/observer/virtual_table/ob_mysql_user_table.cpp +++ b/src/observer/virtual_table/ob_mysql_user_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_mysql_user_table.h" diff --git a/src/observer/virtual_table/ob_mysql_user_table.h b/src/observer/virtual_table/ob_mysql_user_table.h index 675b2f43d..0ac1c52e1 100644 --- a/src/observer/virtual_table/ob_mysql_user_table.h +++ b/src/observer/virtual_table/ob_mysql_user_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_MYSQL_USER_TABLE_ diff --git a/src/observer/virtual_table/ob_plan_cache_plan_explain.cpp b/src/observer/virtual_table/ob_plan_cache_plan_explain.cpp index 276ff79e1..cee4479f2 100644 --- a/src/observer/virtual_table/ob_plan_cache_plan_explain.cpp +++ b/src/observer/virtual_table/ob_plan_cache_plan_explain.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -379,7 +383,7 @@ int ObPlanCachePlanExplain::inner_open() LOG_WARN("set tenant id and plan id failed", K(ret)); } else if (!scan_all_plan_) { ObPlanCache *plan_cache = NULL; - // !!!引用plan cache资源之前必须加ObReqTimeGuard + // !!!Before referencing plan cache resources, ObReqTimeGuard must be added ObReqTimeGuard req_timeinfo_guard; ObCacheObjGuard guard(PLAN_EXPLAIN_HANDLE); int tmp_ret = OB_SUCCESS; @@ -484,4 +488,4 @@ ObPlanCachePlanExplain::~ObPlanCachePlanExplain() } } // end namespace observr -} // end namespace oceanbase \ No newline at end of file +} // end namespace oceanbase diff --git a/src/observer/virtual_table/ob_plan_cache_plan_explain.h b/src/observer/virtual_table/ob_plan_cache_plan_explain.h index afedd8fcd..27ef1ea93 100644 --- a/src/observer/virtual_table/ob_plan_cache_plan_explain.h +++ b/src/observer/virtual_table/ob_plan_cache_plan_explain.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_PLAN_CACHE_PLAN_EXPLAIN_ @@ -164,4 +168,4 @@ class ObPlanCachePlanExplain : public common::ObVirtualTableScannerIterator } } -#endif \ No newline at end of file +#endif diff --git a/src/observer/virtual_table/ob_session_variables.cpp b/src/observer/virtual_table/ob_session_variables.cpp index dbca002a9..63467d11a 100644 --- a/src/observer/virtual_table/ob_session_variables.cpp +++ b/src/observer/virtual_table/ob_session_variables.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_session_variables.h" diff --git a/src/observer/virtual_table/ob_session_variables.h b/src/observer/virtual_table/ob_session_variables.h index 675a0d765..4ce7b4005 100644 --- a/src/observer/virtual_table/ob_session_variables.h +++ b/src/observer/virtual_table/ob_session_variables.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_SESSION_VARIABLES_ diff --git a/src/observer/virtual_table/ob_show_create_catalog.cpp b/src/observer/virtual_table/ob_show_create_catalog.cpp index 3f9ad2167..abefe789f 100644 --- a/src/observer/virtual_table/ob_show_create_catalog.cpp +++ b/src/observer/virtual_table/ob_show_create_catalog.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_show_create_catalog.h b/src/observer/virtual_table/ob_show_create_catalog.h index 908784433..fd7f7ef17 100644 --- a/src/observer/virtual_table/ob_show_create_catalog.h +++ b/src/observer/virtual_table/ob_show_create_catalog.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_SHOW_CREATE_CATALOG_ diff --git a/src/observer/virtual_table/ob_show_create_database.cpp b/src/observer/virtual_table/ob_show_create_database.cpp index 17bf28b87..b23b32d04 100644 --- a/src/observer/virtual_table/ob_show_create_database.cpp +++ b/src/observer/virtual_table/ob_show_create_database.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_show_create_database.h b/src/observer/virtual_table/ob_show_create_database.h index dd1e191ef..60bdc85a9 100644 --- a/src/observer/virtual_table/ob_show_create_database.h +++ b/src/observer/virtual_table/ob_show_create_database.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_SHOW_CREATE_DATABASE_ diff --git a/src/observer/virtual_table/ob_show_create_procedure.cpp b/src/observer/virtual_table/ob_show_create_procedure.cpp index 58242a897..eba66d10a 100644 --- a/src/observer/virtual_table/ob_show_create_procedure.cpp +++ b/src/observer/virtual_table/ob_show_create_procedure.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_show_create_procedure.h b/src/observer/virtual_table/ob_show_create_procedure.h index 95a17772f..7f39d8fd8 100644 --- a/src/observer/virtual_table/ob_show_create_procedure.h +++ b/src/observer/virtual_table/ob_show_create_procedure.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SRC_OBSERVER_VIRTUAL_TABLE_OB_SHOW_CREATE_PROCEDURE_H_ diff --git a/src/observer/virtual_table/ob_show_create_table.cpp b/src/observer/virtual_table/ob_show_create_table.cpp index 71340d571..4e481f803 100644 --- a/src/observer/virtual_table/ob_show_create_table.cpp +++ b/src/observer/virtual_table/ob_show_create_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_show_create_table.h b/src/observer/virtual_table/ob_show_create_table.h index dba2f6e90..058a54a68 100644 --- a/src/observer/virtual_table/ob_show_create_table.h +++ b/src/observer/virtual_table/ob_show_create_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_SHOW_CREATE_TABLE_ diff --git a/src/observer/virtual_table/ob_show_create_tablegroup.cpp b/src/observer/virtual_table/ob_show_create_tablegroup.cpp index 032e8cea1..2aa419dea 100644 --- a/src/observer/virtual_table/ob_show_create_tablegroup.cpp +++ b/src/observer/virtual_table/ob_show_create_tablegroup.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_show_create_tablegroup.h b/src/observer/virtual_table/ob_show_create_tablegroup.h index 3c3e4e75e..61e06b2f3 100644 --- a/src/observer/virtual_table/ob_show_create_tablegroup.h +++ b/src/observer/virtual_table/ob_show_create_tablegroup.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_SHOW_CREATE_TABLEGROUP_ diff --git a/src/observer/virtual_table/ob_show_create_trigger.cpp b/src/observer/virtual_table/ob_show_create_trigger.cpp index 38f3e8620..34d0d18cf 100644 --- a/src/observer/virtual_table/ob_show_create_trigger.cpp +++ b/src/observer/virtual_table/ob_show_create_trigger.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_show_create_trigger.h b/src/observer/virtual_table/ob_show_create_trigger.h index 097bab1b7..9597d73b6 100644 --- a/src/observer/virtual_table/ob_show_create_trigger.h +++ b/src/observer/virtual_table/ob_show_create_trigger.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SRC_OBSERVER_VIRTUAL_TABLE_OB_SHOW_CREATE_TRIGGER_H_ diff --git a/src/observer/virtual_table/ob_show_database_status.cpp b/src/observer/virtual_table/ob_show_database_status.cpp index b37cbb455..f57a7a04d 100644 --- a/src/observer/virtual_table/ob_show_database_status.cpp +++ b/src/observer/virtual_table/ob_show_database_status.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_show_database_status.h" diff --git a/src/observer/virtual_table/ob_show_database_status.h b/src/observer/virtual_table/ob_show_database_status.h index 0b67da4ba..a47994a82 100644 --- a/src/observer/virtual_table/ob_show_database_status.h +++ b/src/observer/virtual_table/ob_show_database_status.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_SHOW_DATABASE_STATUS_ diff --git a/src/observer/virtual_table/ob_show_grants.cpp b/src/observer/virtual_table/ob_show_grants.cpp index 9c9b5d954..e6482c22a 100644 --- a/src/observer/virtual_table/ob_show_grants.cpp +++ b/src/observer/virtual_table/ob_show_grants.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -169,7 +173,7 @@ int ObShowGrants::inner_get_next_row(common::ObNewRow *&row) if (OB_FAIL(calc_show_user_id(show_user_id, role_ids))) { SERVER_LOG(WARN, "fail to calc show user id", K(ret)); } else if (OB_UNLIKELY(OB_INVALID_ID == show_user_id)) { - ret = OB_ITER_END;//FIXME 暂不支持,返回空集 + ret = OB_ITER_END;//FIXME Not supported yet, return empty set } else if (OB_FAIL(has_show_grants_priv(show_user_id))) { SERVER_LOG(WARN, "There is no show grants priv", K(ret)); } else if (OB_ISNULL(cells = cur_row_.cells_)) { @@ -187,7 +191,7 @@ int ObShowGrants::inner_get_next_row(common::ObNewRow *&row) ObArray column_priv_array; ObArrayobj_priv_array; PRIV_MAP priv_map; - const int64_t PRIV_BUF_LENGTH = 512; + const int64_t PRIV_BUF_LENGTH = 1024; char buf[PRIV_BUF_LENGTH] = {}; int64_t pos = 0; ObString user_name; @@ -695,6 +699,18 @@ int ObShowGrants::print_privs_to_buff( if ((priv_set & OB_PRIV_USE_CATALOG) && OB_SUCCESS == ret) { ret = BUF_PRINTF(" USE CATALOG,"); } + if ((priv_set & OB_PRIV_CREATE_AI_MODEL) && OB_SUCCESS == ret) { + ret = BUF_PRINTF(" CREATE AI MODEL,"); + } + if ((priv_set & OB_PRIV_ALTER_AI_MODEL) && OB_SUCCESS == ret) { + ret = BUF_PRINTF(" ALTER AI MODEL,"); + } + if ((priv_set & OB_PRIV_DROP_AI_MODEL) && OB_SUCCESS == ret) { + ret = BUF_PRINTF(" DROP AI MODEL,"); + } + if ((priv_set & OB_PRIV_ACCESS_AI_MODEL) && OB_SUCCESS == ret) { + ret = BUF_PRINTF(" ACCESS AI MODEL,"); + } if (OB_SUCCESS == ret && pos > 0) { pos--; //Delete last ',' } diff --git a/src/observer/virtual_table/ob_show_grants.h b/src/observer/virtual_table/ob_show_grants.h index 78fcfdf9c..e3b9f0128 100644 --- a/src/observer/virtual_table/ob_show_grants.h +++ b/src/observer/virtual_table/ob_show_grants.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_SHOW_GRANTS_ diff --git a/src/observer/virtual_table/ob_show_processlist.cpp b/src/observer/virtual_table/ob_show_processlist.cpp index 6735db3d2..7d0c7cef0 100644 --- a/src/observer/virtual_table/ob_show_processlist.cpp +++ b/src/observer/virtual_table/ob_show_processlist.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_show_processlist.h" diff --git a/src/observer/virtual_table/ob_show_processlist.h b/src/observer/virtual_table/ob_show_processlist.h index 4352a2823..b43d3bcb2 100644 --- a/src/observer/virtual_table/ob_show_processlist.h +++ b/src/observer/virtual_table/ob_show_processlist.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_SHOW_PROCESSLIST_ diff --git a/src/observer/virtual_table/ob_show_tenant_status.cpp b/src/observer/virtual_table/ob_show_tenant_status.cpp index abda72fb2..114b3725a 100644 --- a/src/observer/virtual_table/ob_show_tenant_status.cpp +++ b/src/observer/virtual_table/ob_show_tenant_status.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_show_tenant_status.h" diff --git a/src/observer/virtual_table/ob_show_tenant_status.h b/src/observer/virtual_table/ob_show_tenant_status.h index 33bcb0443..dcb894fcb 100644 --- a/src/observer/virtual_table/ob_show_tenant_status.h +++ b/src/observer/virtual_table/ob_show_tenant_status.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_SHOW_TENANT_STATUS_ diff --git a/src/observer/virtual_table/ob_table_columns.cpp b/src/observer/virtual_table/ob_table_columns.cpp index 206253e00..c19db3a61 100644 --- a/src/observer/virtual_table/ob_table_columns.cpp +++ b/src/observer/virtual_table/ob_table_columns.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -195,7 +199,7 @@ int ObTableColumns::inner_get_next_row(ObNewRow *&row) LOG_WARN("The column is null", K(ret)); } else if (table_schema->is_heap_organized_table() && col->is_hidden_pk_column_id(col->get_column_id())) { // heap organized table should not output hidden pk columns - } else if (col->is_invisible_column() && lib::is_oracle_mode()) { // 忽略 invisible 列 + } else if (col->is_invisible_column() && lib::is_oracle_mode()) { // ignore invisible column // mysql 8.0.23 has supported invisivle column, we should not ignore them // for mysql } else if (OB_FAIL(fill_row_cells(*table_schema, *col, has_column_priv))) { @@ -492,7 +496,7 @@ int ObTableColumns::fill_row_cells(const ObTableSchema &table_schema, cur_row_.cells_[cell_idx].set_collation_type(ObCharset::get_system_collation()); } else if (def_obj.is_null()) { if (lib::is_oracle_mode()) { - cur_row_.cells_[cell_idx].set_varchar("NULL");//注:default value为NULL时显示的是字符串 + cur_row_.cells_[cell_idx].set_varchar("NULL");// Note: default value is NULL when displayed as a string } else { cur_row_.cells_[cell_idx].set_null();//in mysql mode, should not be filled with string "NULL"; } @@ -524,7 +528,7 @@ int ObTableColumns::fill_row_cells(const ObTableSchema &table_schema, } else if (def_obj.is_varchar()) { cur_row_.cells_[cell_idx].set_varchar(column_schema.get_cur_default_value().get_string()); cur_row_.cells_[cell_idx].set_collation_type(column_schema.get_collation_type()); - } else {//TODO:由于obobj的print函数不够完善,没有与mysql做到兼容,此处是用cast函数来处理 + } else {//TODO:Since the print function of obobj is not complete and does not achieve compatibility with MySQL, we use the cast function here to handle it} const ObDataTypeCastParams dtc_params = ObBasicSessionInfo::create_dtc_params(session_); ObCastCtx cast_ctx(allocator_, &dtc_params, CM_NONE, ObCharset::get_system_collation()); ObObj buf_obj; @@ -1136,7 +1140,7 @@ int ObTableColumns::set_col_attrs_according_binary_expr( LOG_WARN("expr type is unexpected", K(ret), K(expr->get_expr_class())); } else { bexpr = static_cast(expr); - // ObBinaryRefRawExpr中first_id不是真实table_id, TableItem::ref_id才是 + // first_id in ObBinaryRefRawExpr is not the real table_id, TableItem::ref_id is the correct one if (OB_UNLIKELY(NULL == (tbl_item = select_stmt->get_table_item_by_id(bexpr->get_table_id())))) { ret = OB_ERR_UNEXPECTED; LOG_WARN("table item is NULL", K(ret), K(tbl_item)); @@ -1181,9 +1185,8 @@ int ObTableColumns::resolve_view_definition( bool throw_error) { int ret = OB_SUCCESS; /* - 之前这里的逻辑是先切租户再resolve视图定义,然而resolver层已经有一套切租户的 - 逻辑, 两个共存不好维护,也容易出问题, - 现在改造下, 构造select * from view 语句,将切租户的逻辑转移给resolver + The previous logic here was to switch tenants before resolving the view definition, however, the resolver layer already has a set of tenant switching logic, having both coexist is difficult to maintain and prone to issues, + Now we are modifying it, constructing a select * from view statement, transferring the tenant switching logic to the resolver */ bool is_oracle_mode = false; const ObDatabaseSchema *db_schema = NULL; @@ -1276,7 +1279,7 @@ int ObTableColumns::resolve_view_definition( ret = OB_ERR_UNEXPECTED; LOG_WARN("invalid stmt", K(ret)); } else { - // 取出视图展开后的stmt + // Retrieve the stmt after view expansion select_stmt = static_cast(select_resolver.get_basic_stmt()); TableItem *view_item = NULL; if (OB_UNLIKELY(select_stmt->get_table_size() != 1)) { @@ -1385,9 +1388,9 @@ int ObTableColumns::is_multiple_key(const ObTableSchema &table_schema, simple_index_infos))) { LOG_WARN("get simple_index_infos failed", K(ret)); } else { - // 3种情况会使一列显示为MUL - // 1.non-unique index的第一个column - // 2.unique index存在多列时,第一个column + // 3 situations will make a column display as MUL + // 1.first column of non-unique index + // 2.unique index exists in multiple columns, the first column // 3.spatial_index for (int64_t i = 0; OB_SUCC(ret) && i < simple_index_infos.count(); ++i) { const ObTableSchema *index_schema = NULL; diff --git a/src/observer/virtual_table/ob_table_columns.h b/src/observer/virtual_table/ob_table_columns.h index 3c7ed3157..36588c9f9 100644 --- a/src/observer/virtual_table/ob_table_columns.h +++ b/src/observer/virtual_table/ob_table_columns.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_TABLE_COLUMNS_ diff --git a/src/observer/virtual_table/ob_table_index.cpp b/src/observer/virtual_table/ob_table_index.cpp index a97a83951..93d195178 100644 --- a/src/observer/virtual_table/ob_table_index.cpp +++ b/src/observer/virtual_table/ob_table_index.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -428,39 +432,39 @@ int ObTableIndex::add_rowkey_indexes(const ObTableSchema &table_schema, } // collation case OB_APP_MIN_COLUMN_ID + 8: { - cells[cell_idx].set_varchar(ObString("A")); //FIXME 全部是升序吗? + cells[cell_idx].set_varchar(ObString("A")); //FIXME Are all in ascending order? cells[cell_idx].set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); break; } // cardinality case OB_APP_MIN_COLUMN_ID + 9: { - //TODO 索引中唯一值的数目的估计值。通过运行ANALYZE TABLE或myisamchk -a可以更新。 - //基数根据被存储为整数的统计数据来计数,所以即使对于小型表,该值也没有必要是精确的。 - //基数越大,当进行联合时,MySQL使用该索引的机会就越大。 + //TODO Estimate of the number of unique values in the index. Can be updated by running ANALYZE TABLE or myisamchk -a. + //The base is counted according to the statistics stored as integers, so this value does not need to be precise even for small tables. + //The larger the cardinality, the greater the chance MySQL will use this index when performing a join. cells[cell_idx].set_null(); break; } // sub_part case OB_APP_MIN_COLUMN_ID + 10: { - //TODO 如果列只是被部分地编入索引,则为被编入索引的字符的数目。如果整列被编入索引,则为NULL。 + //TODO If the column is indexed only partially, then it is the number of characters that are indexed. If the entire column is indexed, then it is NULL. cells[cell_idx].set_null(); break; } // packed case OB_APP_MIN_COLUMN_ID + 11: { - //TODO 指示关键字如何被压缩。如果没有被压缩,则为NULL。 + //TODO Indicate how the keyword is compressed. If not compressed, it is NULL. cells[cell_idx].set_null(); break; } // null case OB_APP_MIN_COLUMN_ID + 12: { - cells[cell_idx].set_varchar(ObString("")); // 主键一定不能为NULL + cells[cell_idx].set_varchar(ObString("")); // Primary key must not be NULL cells[cell_idx].set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); break; } // index_type case OB_APP_MIN_COLUMN_ID + 13: { - cells[cell_idx].set_varchar(ObString("BTREE")); //FIXME 一定是BTREE吗? + cells[cell_idx].set_varchar(ObString("BTREE")); //FIXME Is it definitely BTREE? cells[cell_idx].set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); break; } @@ -523,6 +527,7 @@ int ObTableIndex::add_normal_indexes(const ObTableSchema &table_schema, { int ret = OB_SUCCESS; bool is_sub_end = false; + if (OB_ISNULL(schema_guard_)) { ret = OB_NOT_INIT; SERVER_LOG(WARN, "schema guard is not init", KR(ret), KP(schema_guard_)); @@ -580,9 +585,11 @@ int ObTableIndex::add_normal_indexes(const ObTableSchema &table_schema, const bool is_fts_index = index_schema->is_fts_index(); uint64_t doc_id_col_id = OB_INVALID_ID; uint64_t ft_col_id = OB_INVALID_ID; + ObDocIDType type = ObDocIDType::INVALID; if (index_schema->is_built_in_fts_index()) { is_sub_end = true; - } else if (is_fts_index && OB_FAIL(index_schema->get_fulltext_column_ids(doc_id_col_id, ft_col_id))) { + } else if (is_fts_index + && OB_FAIL(index_schema->get_fulltext_typed_col_ids(doc_id_col_id, type, ft_col_id))) { LOG_WARN("get generated column ids failed", K(ret)); } else if (is_fts_index) { ObArray dep_column_ids; @@ -590,24 +597,26 @@ int ObTableIndex::add_normal_indexes(const ObTableSchema &table_schema, if (OB_INVALID_ID == static_cast(ft_dep_col_idx_)) { ft_dep_col_idx_ = 0; } - if (OB_UNLIKELY(doc_id_col_id <= OB_APP_MIN_COLUMN_ID || OB_INVALID_ID == doc_id_col_id - || ft_col_id <= OB_APP_MIN_COLUMN_ID || OB_INVALID_ID == ft_col_id)) { + if (OB_UNLIKELY(!ObDocIDUtils::is_docid_col_id_valid(doc_id_col_id) || ft_col_id <= OB_APP_MIN_COLUMN_ID + || OB_INVALID_ID == ft_col_id)) { ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid doc id or fulltext column id", K(ret), K(doc_id_col_id), K(ft_col_id)); } else if (OB_ISNULL(gen_column_schema = table_schema.get_column_schema(ft_col_id))) { ret = OB_SCHEMA_ERROR; SERVER_LOG(WARN, "fail to get data table column schema", K(ret)); - } else if (OB_FAIL(ObFtsIndexBuilderUtil::get_index_column_ids_for_fts(table_schema, *gen_column_schema, dep_column_ids))) { + } else if (OB_FAIL(ObFtsIndexBuilderUtil::get_index_column_ids_for_fts(table_schema, + *gen_column_schema, + dep_column_ids))) { LOG_WARN("get cascaded column ids from column schema failed", K(ret), K(*gen_column_schema)); } else if (dep_column_ids.count() <= ft_dep_col_idx_) { is_sub_end = true; ft_dep_col_idx_ = OB_INVALID_ID; } else if (OB_FAIL(add_fulltext_index_column(database_name, - table_schema, - index_schema, - cells, - col_count, - dep_column_ids[ft_dep_col_idx_]))) { + table_schema, + index_schema, + cells, + col_count, + dep_column_ids[ft_dep_col_idx_]))) { ret = OB_ERR_UNEXPECTED; SERVER_LOG(WARN, "fail to add normal index column", K(ret), K(col_count), K(ft_dep_col_idx_)); } @@ -617,7 +626,9 @@ int ObTableIndex::add_normal_indexes(const ObTableSchema &table_schema, uint64_t vec_column_id = OB_INVALID_ID; if (index_schema->is_vec_spiv_index() && OB_FAIL(index_schema->get_sparse_vec_index_column_id(vec_column_id))) { LOG_WARN("get generated column id failed", K(ret)); - } else if (!index_schema->is_vec_spiv_index() && OB_FAIL(index_schema->get_vec_index_column_id(vec_column_id))) { + } else if (!index_schema->is_vec_spiv_index() && !is_hybrid_vec_index(index_schema->get_index_type()) && OB_FAIL(index_schema->get_vec_index_column_id(vec_column_id))) { + LOG_WARN("get generated column id failed", K(ret)); + } else if (is_hybrid_vec_index(index_schema->get_index_type()) && OB_FAIL(index_schema->get_hybrid_vec_chunk_column_id(vec_column_id))) { LOG_WARN("get generated column id failed", K(ret)); } else { if (OB_INVALID_ID == static_cast(vec_dep_col_idx_)) { @@ -716,12 +727,12 @@ int ObTableIndex::get_normal_index_column(const ObTableSchema &table_schema, SERVER_LOG(WARN, "fail to get data table column schema", K(ret), K(column_desc->col_id_)); } } else if (column_desc->col_type_.get_type() == ObVarcharType) { - is_column_visible = false; // mbr列 + is_column_visible = false; // mbr column if (OB_ISNULL(column_schema = index_schema->get_column_schema(column_desc->col_id_))) { ret = OB_SCHEMA_ERROR; SERVER_LOG(WARN, "fail to get data table mbr column schema", K(ret), K(column_desc->col_id_)); } - } else { // cellid列,获取主表geo列column_name + } else { // cellid column, get the geo column_name from the main table const ObColumnSchemaV2 *cellid_column = NULL; if (OB_ISNULL(cellid_column = index_schema->get_column_schema(column_desc->col_id_))) { ret = OB_SCHEMA_ERROR; @@ -732,7 +743,7 @@ int ObTableIndex::get_normal_index_column(const ObTableSchema &table_schema, } } } else if (column_desc->col_id_ < OB_MIN_SHADOW_COLUMN_ID) { - if (OB_ISNULL(column_schema = table_schema.get_column_schema(column_desc->col_id_))) { // 索引表的column_id跟数据表的对应列的column_id是相等的 + if (OB_ISNULL(column_schema = table_schema.get_column_schema(column_desc->col_id_))) { // The column_id of the index table is equal to the column_id of the corresponding column in the data table ret = OB_SCHEMA_ERROR; SERVER_LOG(WARN, "fail to get data table column schema", K(ret), K(column_desc->col_id_)); } @@ -877,24 +888,24 @@ int ObTableIndex::add_normal_index_column(const ObString &database_name, } // collation case OB_APP_MIN_COLUMN_ID + 8: { - cells[cell_idx].set_varchar(ObString("A")); //FIXME 全部是升序吗? + cells[cell_idx].set_varchar(ObString("A")); //FIXME Is everything in ascending order? cells[cell_idx].set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); break; } // cardinality case OB_APP_MIN_COLUMN_ID + 9: { - //TODO 索引中唯一值的数目的估计值。通过运行ANALYZE TABLE或myisamchk -a可以更新。 - //基数根据被存储为整数的统计数据来计数,所以即使对于小型表,该值也没有必要是精确的。 - //基数越大,当进行联合时,MySQL使用该索引的机会就越大。 + //TODO Estimate of the number of unique values in the index. Can be updated by running ANALYZE TABLE or myisamchk -a. + //The base is counted according to the statistics stored as integers, so this value does not need to be precise even for small tables. + //The larger the cardinality, the greater the chance MySQL will use this index when performing a join. cells[cell_idx].set_null(); break; } // sub_part case OB_APP_MIN_COLUMN_ID + 10: { - //TODO 如果列只是被部分地编入索引,则为被编入索引的字符的数目。如果整列被编入索引,则为NULL。 - cells[cell_idx].reset(); //清空上一行的结果 + //TODO If the column is indexed only partially, then it is the number of characters that are indexed. If the entire column is indexed, then it is NULL. + cells[cell_idx].reset(); // Clear the result of the previous row if (column_schema->is_prefix_column()) { - //打印前缀索引的长度 + //print the length of the prefix index int64_t pos = 0; if (OB_FAIL(databuff_printf(buf, buf_len, pos, "%d", column_schema->get_data_length()))) { LOG_WARN("print prefix column data length failed", K(ret), KPC(column_schema), K(buf), K(buf_len), K(pos)); @@ -907,7 +918,7 @@ int ObTableIndex::add_normal_index_column(const ObString &database_name, } // packed case OB_APP_MIN_COLUMN_ID + 11: { - //TODO 指示关键字如何被压缩。如果没有被压缩,则为NULL。 + //TODO Indicate how the keyword is compressed. If not compressed, it is NULL. cells[cell_idx].set_null(); break; } @@ -928,7 +939,7 @@ int ObTableIndex::add_normal_index_column(const ObString &database_name, } else if (index_schema->is_spatial_index()) { cells[cell_idx].set_varchar(ObString("SPATIAL")); } else { - cells[cell_idx].set_varchar(ObString("BTREE")); //FIXME 一定是BTREE吗? + cells[cell_idx].set_varchar(ObString("BTREE")); //FIXME Is it definitely BTREE? } cells[cell_idx].set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); break; @@ -1082,24 +1093,24 @@ int ObTableIndex::add_fulltext_index_column(const ObString &database_name, } // collation case OB_APP_MIN_COLUMN_ID + 8: { - cells[cell_idx].set_varchar(ObString("A")); //FIXME 全部是升序吗? + cells[cell_idx].set_varchar(ObString("A")); //FIXME Are all in ascending order? cells[cell_idx].set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); break; } // cardinality case OB_APP_MIN_COLUMN_ID + 9: { - //TODO 索引中唯一值的数目的估计值。通过运行ANALYZE TABLE或myisamchk -a可以更新。 - //基数根据被存储为整数的统计数据来计数,所以即使对于小型表,该值也没有必要是精确的。 - //基数越大,当进行联合时,MySQL使用该索引的机会就越大。 + //TODO Estimate of the number of unique values in the index. Can be updated by running ANALYZE TABLE or myisamchk -a. + //The base is counted according to the statistics stored as integers, so this value does not need to be precise even for small tables. + //The larger the cardinality, the greater the chance MySQL will use this index when performing a join. cells[cell_idx].set_null(); break; } // sub_part case OB_APP_MIN_COLUMN_ID + 10: { - //TODO 如果列只是被部分地编入索引,则为被编入索引的字符的数目。如果整列被编入索引,则为NULL。 - cells[cell_idx].reset(); //清空上一行的结果 + //TODO If the column is indexed only partially, then it is the number of characters that are indexed. If the entire column is indexed, then it is NULL. + cells[cell_idx].reset(); // Clear the result of the previous row if (column_schema->is_prefix_column()) { - //打印前缀索引的长度 + //print the length of the prefix index int64_t pos = 0; if (OB_FAIL(databuff_printf(buf, buf_len, pos, "%d", column_schema->get_data_length()))) { LOG_WARN("print prefix column data length failed", K(ret), KPC(column_schema), K(buf), K(buf_len), K(pos)); @@ -1112,7 +1123,7 @@ int ObTableIndex::add_fulltext_index_column(const ObString &database_name, } // packed case OB_APP_MIN_COLUMN_ID + 11: { - //TODO 指示关键字如何被压缩。如果没有被压缩,则为NULL。 + //TODO Indicate how the keyword is compressed. If not compressed, it is NULL. cells[cell_idx].set_null(); break; } @@ -1269,24 +1280,24 @@ int ObTableIndex::add_vec_index_column(const ObString &database_name, } // collation case OB_APP_MIN_COLUMN_ID + 8: { - cells[cell_idx].set_varchar(ObString("A")); //FIXME 全部是升序吗? + cells[cell_idx].set_varchar(ObString("A")); //FIXME Is everything in ascending order? cells[cell_idx].set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); break; } // cardinality case OB_APP_MIN_COLUMN_ID + 9: { - //TODO 索引中唯一值的数目的估计值。通过运行ANALYZE TABLE或myisamchk -a可以更新。 - //基数根据被存储为整数的统计数据来计数,所以即使对于小型表,该值也没有必要是精确的。 - //基数越大,当进行联合时,MySQL使用该索引的机会就越大。 + //TODO Estimate of the number of unique values in the index. Can be updated by running ANALYZE TABLE or myisamchk -a. + //The base is counted according to the statistics stored as integers, so this value does not need to be precise even for small tables. + //The larger the cardinality, the greater the chance MySQL will use this index when performing a join. cells[cell_idx].set_null(); break; } // sub_part case OB_APP_MIN_COLUMN_ID + 10: { - //TODO 如果列只是被部分地编入索引,则为被编入索引的字符的数目。如果整列被编入索引,则为NULL。 - cells[cell_idx].reset(); //清空上一行的结果 + //TODO If the column is indexed only partially, then it is the number of characters that are indexed. If the entire column is indexed, then it is NULL. + cells[cell_idx].reset(); // Clear the result of the previous row if (column_schema->is_prefix_column()) { - //打印前缀索引的长度 + //print the length of the prefix index int64_t pos = 0; if (OB_FAIL(databuff_printf(buf, buf_len, pos, "%d", column_schema->get_data_length()))) { LOG_WARN("print prefix column data length failed", K(ret), KPC(column_schema), K(buf), K(buf_len), K(pos)); @@ -1299,7 +1310,7 @@ int ObTableIndex::add_vec_index_column(const ObString &database_name, } // packed case OB_APP_MIN_COLUMN_ID + 11: { - //TODO 指示关键字如何被压缩。如果没有被压缩,则为NULL。 + //TODO Indicate how the keyword is compressed. If not compressed, it is NULL. cells[cell_idx].set_null(); break; } @@ -1373,7 +1384,7 @@ int ObTableIndex::get_show_column_name(const ObTableSchema &table_schema, { int ret = OB_SUCCESS; if (column_schema.is_prefix_column()) { - //前缀索引生成的列,需要获取到原始列 + //Prefix index generated column, need to obtain the original column ObSEArray deps_column_ids; const ObColumnSchemaV2 *deps_column = NULL; if (OB_FAIL(column_schema.get_cascaded_column_ids(deps_column_ids))) { diff --git a/src/observer/virtual_table/ob_table_index.h b/src/observer/virtual_table/ob_table_index.h index cb13e98b3..df576c736 100644 --- a/src/observer/virtual_table/ob_table_index.h +++ b/src/observer/virtual_table/ob_table_index.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_TABLE_INDEX_ diff --git a/src/observer/virtual_table/ob_tenant_all_tables.cpp b/src/observer/virtual_table/ob_tenant_all_tables.cpp index 1c91cf423..7cd3c2518 100644 --- a/src/observer/virtual_table/ob_tenant_all_tables.cpp +++ b/src/observer/virtual_table/ob_tenant_all_tables.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -109,7 +113,7 @@ int ObTenantAllTables::inner_open() }//for if (OB_SUCC(ret)) { if (OB_UNLIKELY(!is_valid_id(database_id_))) { - // FIXME(tingshuai.yts):暂时定为显示该错误信息,只有直接查询该虚拟表才可能出现 + // FIXME(tingshuai.yts): Temporarily set to display this error message, which will only occur when directly querying this virtual table ret = OB_NOT_SUPPORTED; LOG_USER_ERROR(OB_NOT_SUPPORTED, "select a table which is used for show clause"); } else { @@ -574,7 +578,7 @@ int ObTenantAllTables::inner_get_next_row() break; } case COMMENT: { - //对于comment列mysql中system view和base table均正常显示;而user view仅显示VIEW即可 + //For the comment column, MySQL displays normally for both system view and base table; while user view only displays VIEW if (table_schema->is_user_view()) { cells[cell_idx].set_varchar(ObString::make_string("VIEW")); cells[cell_idx].set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); diff --git a/src/observer/virtual_table/ob_tenant_all_tables.h b/src/observer/virtual_table/ob_tenant_all_tables.h index d415ed942..3e0d0eb0f 100644 --- a/src/observer/virtual_table/ob_tenant_all_tables.h +++ b/src/observer/virtual_table/ob_tenant_all_tables.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_TENANT_ALL_TABLES_ diff --git a/src/observer/virtual_table/ob_tenant_show_catalog_databases.cpp b/src/observer/virtual_table/ob_tenant_show_catalog_databases.cpp index 1cff635c0..e66ebe6fd 100644 --- a/src/observer/virtual_table/ob_tenant_show_catalog_databases.cpp +++ b/src/observer/virtual_table/ob_tenant_show_catalog_databases.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -153,4 +157,4 @@ int ObTenantShowCatalogDatabases::fill_scanner() } // namespace observer -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/observer/virtual_table/ob_tenant_show_catalog_databases.h b/src/observer/virtual_table/ob_tenant_show_catalog_databases.h index 14a9c6eef..db9777a6e 100644 --- a/src/observer/virtual_table/ob_tenant_show_catalog_databases.h +++ b/src/observer/virtual_table/ob_tenant_show_catalog_databases.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_TENANT_SHOW_CATALOG_DATABASES_ diff --git a/src/observer/virtual_table/ob_tenant_show_restore_preview.cpp b/src/observer/virtual_table/ob_tenant_show_restore_preview.cpp index 7be48401b..bb0d2f1bf 100644 --- a/src/observer/virtual_table/ob_tenant_show_restore_preview.cpp +++ b/src/observer/virtual_table/ob_tenant_show_restore_preview.cpp @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. - */ +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #include "observer/virtual_table/ob_tenant_show_restore_preview.h" #include "rootserver/restore/ob_restore_util.h" @@ -319,4 +323,4 @@ int ObTenantShowRestorePreview::get_backup_desc_(common::ObString &str) } // end namespace observer -} // end namespace oceanbase \ No newline at end of file +} // end namespace oceanbase diff --git a/src/observer/virtual_table/ob_tenant_show_restore_preview.h b/src/observer/virtual_table/ob_tenant_show_restore_preview.h index 5fa30f2f1..6561bae7e 100644 --- a/src/observer/virtual_table/ob_tenant_show_restore_preview.h +++ b/src/observer/virtual_table/ob_tenant_show_restore_preview.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_TENANT_SHOW_RESTORE_PREVIEW_H_ @@ -73,4 +77,4 @@ class ObTenantShowRestorePreview : public common::ObVirtualTableIterator } // end namespace observer } // end namespace oceanbase -#endif \ No newline at end of file +#endif diff --git a/src/observer/virtual_table/ob_tenant_show_tables.cpp b/src/observer/virtual_table/ob_tenant_show_tables.cpp index 8bf56faf6..80eef43f7 100644 --- a/src/observer/virtual_table/ob_tenant_show_tables.cpp +++ b/src/observer/virtual_table/ob_tenant_show_tables.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_tenant_show_tables.h" @@ -68,7 +72,7 @@ int ObTenantShowTables::inner_open() } if (OB_SUCC(ret)) { if (OB_UNLIKELY(!is_valid_id(database_id_))) { - // FIXME(tingshuai.yts):暂时定为显示该错误信息,只有直接查询该虚拟表才可能出现 + // FIXME(tingshuai.yts): Temporarily set to display this error message, which will only occur when directly querying this virtual table ret = OB_NOT_SUPPORTED; LOG_USER_ERROR(OB_NOT_SUPPORTED, "select a table which is used for show clause"); } else if (is_external_object_id(database_id_)) { diff --git a/src/observer/virtual_table/ob_tenant_show_tables.h b/src/observer/virtual_table/ob_tenant_show_tables.h index 74fadf93b..d9ad0463c 100644 --- a/src/observer/virtual_table/ob_tenant_show_tables.h +++ b/src/observer/virtual_table/ob_tenant_show_tables.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_TENANT_SHOW_TABLES_ diff --git a/src/observer/virtual_table/ob_tenant_virtual_charset.cpp b/src/observer/virtual_table/ob_tenant_virtual_charset.cpp index b368193bd..87a0490f8 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_charset.cpp +++ b/src/observer/virtual_table/ob_tenant_virtual_charset.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_tenant_virtual_charset.h b/src/observer/virtual_table/ob_tenant_virtual_charset.h index 0a6d17402..2ae7af393 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_charset.h +++ b/src/observer/virtual_table/ob_tenant_virtual_charset.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_TENANT_VIRTUAL_CHARSET_ diff --git a/src/observer/virtual_table/ob_tenant_virtual_collation.cpp b/src/observer/virtual_table/ob_tenant_virtual_collation.cpp index dc0d35ade..27b4c08af 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_collation.cpp +++ b/src/observer/virtual_table/ob_tenant_virtual_collation.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_tenant_virtual_collation.h b/src/observer/virtual_table/ob_tenant_virtual_collation.h index 4763d074b..6df7921d2 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_collation.h +++ b/src/observer/virtual_table/ob_tenant_virtual_collation.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_TENANT_VIRTUAL_COLLATION_ diff --git a/src/observer/virtual_table/ob_tenant_virtual_concurrent_limit_sql.cpp b/src/observer/virtual_table/ob_tenant_virtual_concurrent_limit_sql.cpp index 9818325a7..531d32400 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_concurrent_limit_sql.cpp +++ b/src/observer/virtual_table/ob_tenant_virtual_concurrent_limit_sql.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_tenant_virtual_concurrent_limit_sql.h b/src/observer/virtual_table/ob_tenant_virtual_concurrent_limit_sql.h index bc84368e7..07b179615 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_concurrent_limit_sql.h +++ b/src/observer/virtual_table/ob_tenant_virtual_concurrent_limit_sql.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_TENANT_VIRTUAL_CONCURRENT_LIMIT_SQL_ diff --git a/src/observer/virtual_table/ob_tenant_virtual_current_tenant.cpp b/src/observer/virtual_table/ob_tenant_virtual_current_tenant.cpp index ca0e73e87..51d0c219b 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_current_tenant.cpp +++ b/src/observer/virtual_table/ob_tenant_virtual_current_tenant.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_tenant_virtual_current_tenant.h" @@ -83,7 +87,7 @@ int ObTenantVirtualCurrentTenant::inner_get_next_row(ObNewRow *&row) ret = OB_ALLOCATE_MEMORY_FAILED; SERVER_LOG(ERROR, "fail to alloc memory", K(ret)); } else if (OB_UNLIKELY(OB_INVALID_ID == show_tenant_id)) { - // FIXME(tingshuai.yts):暂时定为显示该错误信息,只有直接查询该虚拟表才可能出现 + // FIXME(tingshuai.yts): Temporarily set to display this error message, which will only occur when directly querying this virtual table ret = OB_NOT_SUPPORTED; LOG_USER_ERROR(OB_NOT_SUPPORTED, "select a table which is used for show clause"); } else if (OB_FAIL(schema_guard_->get_tenant_info(show_tenant_id, tenant_schema))) { diff --git a/src/observer/virtual_table/ob_tenant_virtual_current_tenant.h b/src/observer/virtual_table/ob_tenant_virtual_current_tenant.h index 326d15366..f0853517a 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_current_tenant.h +++ b/src/observer/virtual_table/ob_tenant_virtual_current_tenant.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_TENANT_VIRTUAL_CURRENT_TENANT_ diff --git a/src/observer/virtual_table/ob_tenant_virtual_event_name.cpp b/src/observer/virtual_table/ob_tenant_virtual_event_name.cpp index 69de337d0..9ddc2fd54 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_event_name.cpp +++ b/src/observer/virtual_table/ob_tenant_virtual_event_name.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_tenant_virtual_event_name.h" diff --git a/src/observer/virtual_table/ob_tenant_virtual_event_name.h b/src/observer/virtual_table/ob_tenant_virtual_event_name.h index c371fc850..709549a95 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_event_name.h +++ b/src/observer/virtual_table/ob_tenant_virtual_event_name.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_TENANT_VIRTUAL_EVENT_NAME_H_ diff --git a/src/observer/virtual_table/ob_tenant_virtual_get_object_definition.cpp b/src/observer/virtual_table/ob_tenant_virtual_get_object_definition.cpp index 613e9aaee..612b662e4 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_get_object_definition.cpp +++ b/src/observer/virtual_table/ob_tenant_virtual_get_object_definition.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -166,8 +170,8 @@ int ObGetObjectDefinition::get_ddl_creation_str(ObString &ddl_str, int ret = OB_SUCCESS; switch(object_type) { case T_GET_DDL_TABLE: - // table, procedure, package仍使用原来的实现方式,未使用tenant_virtual_object_definition虚拟表 - // 在下一个barrier版本的下一个版本改为使用tenant_virtual_object_definition虚拟表,并删去旧的虚拟表 + // table, procedure, package still use the original implementation method, without using the tenant_virtual_object_definition virtual table + // In the version after the next barrier version, change to use the tenant_virtual_object_definition virtual table and delete the old virtual table //ret = get_table_definition(ddl_str, object_id); ret = OB_NOT_SUPPORTED; break; @@ -634,8 +638,8 @@ int ObGetObjectDefinition::get_user_definition(ObString &ddl_str, ret = print_error_log(object_type, db_name, user_name); LOG_WARN("user not found", K(ret)); } else if (users_info.count() > 1) { - //用户名不能作为用户的唯一标识,username+hostname才是。 - //但是由于oracle模式创建用户时会同时创建同名数据库,所以不会允许创建username相同的用户,即使它们的hostname不同。 + //Username cannot be used as the unique identifier for a user, username+hostname is required. + //However, since Oracle mode creates a database with the same name as the user when creating a user, it will not allow the creation of users with the same username, even if their hostnames are different. ret = OB_ERR_UNEXPECTED; LOG_WARN("users with same name is not allowed in oracle mode", K(ret)); } else if (OB_ISNULL(user_info = users_info.at(0))) { diff --git a/src/observer/virtual_table/ob_tenant_virtual_get_object_definition.h b/src/observer/virtual_table/ob_tenant_virtual_get_object_definition.h index 1f2c61082..b49f34e12 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_get_object_definition.h +++ b/src/observer/virtual_table/ob_tenant_virtual_get_object_definition.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_GET_OBJECT_DEFINITION_ diff --git a/src/observer/virtual_table/ob_tenant_virtual_outline.cpp b/src/observer/virtual_table/ob_tenant_virtual_outline.cpp index 1d69c41cf..6c299413a 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_outline.cpp +++ b/src/observer/virtual_table/ob_tenant_virtual_outline.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_tenant_virtual_outline.h b/src/observer/virtual_table/ob_tenant_virtual_outline.h index b5eaad058..af8a4116c 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_outline.h +++ b/src/observer/virtual_table/ob_tenant_virtual_outline.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_TENANT_VIRTUAL_OUTLINE_ diff --git a/src/observer/virtual_table/ob_tenant_virtual_privilege.cpp b/src/observer/virtual_table/ob_tenant_virtual_privilege.cpp index fbe7435f9..ae14009ed 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_privilege.cpp +++ b/src/observer/virtual_table/ob_tenant_virtual_privilege.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -106,4 +110,4 @@ int ObTenantVirtualPrivilege::fill_scanner() } } -} \ No newline at end of file +} diff --git a/src/observer/virtual_table/ob_tenant_virtual_privilege.h b/src/observer/virtual_table/ob_tenant_virtual_privilege.h index e7e8ebc72..bf6a0e7c1 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_privilege.h +++ b/src/observer/virtual_table/ob_tenant_virtual_privilege.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_TENANT_VIRTUAL_PRIVILEGE_ @@ -41,4 +45,4 @@ class ObTenantVirtualPrivilege : public ObVirtualTableScannerIterator }; } } -#endif \ No newline at end of file +#endif diff --git a/src/observer/virtual_table/ob_tenant_virtual_statname.cpp b/src/observer/virtual_table/ob_tenant_virtual_statname.cpp index 51442ee95..ea1c128b1 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_statname.cpp +++ b/src/observer/virtual_table/ob_tenant_virtual_statname.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_tenant_virtual_statname.h" diff --git a/src/observer/virtual_table/ob_tenant_virtual_statname.h b/src/observer/virtual_table/ob_tenant_virtual_statname.h index a1444e2f9..dbb17e2ba 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_statname.h +++ b/src/observer/virtual_table/ob_tenant_virtual_statname.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_TENANT_VIRTUAL_STATNAME_H_ diff --git a/src/observer/virtual_table/ob_tenant_virtual_warning.cpp b/src/observer/virtual_table/ob_tenant_virtual_warning.cpp index 36c98b38e..8e886aea2 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_warning.cpp +++ b/src/observer/virtual_table/ob_tenant_virtual_warning.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_tenant_virtual_warning.h" diff --git a/src/observer/virtual_table/ob_tenant_virtual_warning.h b/src/observer/virtual_table/ob_tenant_virtual_warning.h index a0af3419f..aa5bac4eb 100644 --- a/src/observer/virtual_table/ob_tenant_virtual_warning.h +++ b/src/observer/virtual_table/ob_tenant_virtual_warning.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_TENANT_VIRTUAL_WARNING_ diff --git a/src/observer/virtual_table/ob_virtual_ash.cpp b/src/observer/virtual_table/ob_virtual_ash.cpp index 8e022abf8..fbe363fba 100644 --- a/src/observer/virtual_table/ob_virtual_ash.cpp +++ b/src/observer/virtual_table/ob_virtual_ash.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -553,4 +557,4 @@ int ObVirtualASHI1::init_next_query_range() } } return ret; -} \ No newline at end of file +} diff --git a/src/observer/virtual_table/ob_virtual_ash.h b/src/observer/virtual_table/ob_virtual_ash.h index f51ddd056..dde6b5f80 100644 --- a/src/observer/virtual_table/ob_virtual_ash.h +++ b/src/observer/virtual_table/ob_virtual_ash.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_VIRTUAL_ASH_H diff --git a/src/observer/virtual_table/ob_virtual_data_access_service.cpp b/src/observer/virtual_table/ob_virtual_data_access_service.cpp index 8d97e517e..28b239a66 100644 --- a/src/observer/virtual_table/ob_virtual_data_access_service.cpp +++ b/src/observer/virtual_table/ob_virtual_data_access_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "ob_virtual_data_access_service.h" diff --git a/src/observer/virtual_table/ob_virtual_data_access_service.h b/src/observer/virtual_table/ob_virtual_data_access_service.h index e20cf8438..cec474079 100644 --- a/src/observer/virtual_table/ob_virtual_data_access_service.h +++ b/src/observer/virtual_table/ob_virtual_data_access_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OB_VIRTUAL_DATA_ACCESS_SERVICE_H_ diff --git a/src/observer/virtual_table/ob_virtual_flt_config.cpp b/src/observer/virtual_table/ob_virtual_flt_config.cpp index 8885912ad..44a31014a 100644 --- a/src/observer/virtual_table/ob_virtual_flt_config.cpp +++ b/src/observer/virtual_table/ob_virtual_flt_config.cpp @@ -1,17 +1,17 @@ /* - * Copyright (c) 2022 OceanBase Technology Co.,Ltd. - * OceanBase is licensed under Mulan PubL v1. - * You can use this software according to the terms and conditions of the Mulan PubL v1. - * You may obtain a copy of Mulan PubL v1 at: - * http://license.coscl.org.cn/MulanPubL-1.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v1 for more details. - * --------------------------------------------------------------------------------------- - * Authors: - * Juehui <> - * --------------------------------------------------------------------------------------- + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_virtual_flt_config.h" diff --git a/src/observer/virtual_table/ob_virtual_flt_config.h b/src/observer/virtual_table/ob_virtual_flt_config.h index 385a305e6..ebaf49aab 100644 --- a/src/observer/virtual_table/ob_virtual_flt_config.h +++ b/src/observer/virtual_table/ob_virtual_flt_config.h @@ -1,17 +1,17 @@ /* - * Copyright (c) 2022 OceanBase Technology Co.,Ltd. - * OceanBase is licensed under Mulan PubL v1. - * You can use this software according to the terms and conditions of the Mulan PubL v1. - * You may obtain a copy of Mulan PubL v1 at: - * http://license.coscl.org.cn/MulanPubL-1.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v1 for more details. - * --------------------------------------------------------------------------------------- - * Authors: - * Juehui <> - * --------------------------------------------------------------------------------------- + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_VIRTUAL_FLT_CONF_H_ #define OB_VIRTUAL_FLT_CONF_H_ diff --git a/src/observer/virtual_table/ob_virtual_obrpc_send_stat.cpp b/src/observer/virtual_table/ob_virtual_obrpc_send_stat.cpp index 526e3ad78..88de46ac4 100644 --- a/src/observer/virtual_table/ob_virtual_obrpc_send_stat.cpp +++ b/src/observer/virtual_table/ob_virtual_obrpc_send_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_virtual_obrpc_send_stat.h b/src/observer/virtual_table/ob_virtual_obrpc_send_stat.h index 679386068..76d1d69c0 100644 --- a/src/observer/virtual_table/ob_virtual_obrpc_send_stat.h +++ b/src/observer/virtual_table/ob_virtual_obrpc_send_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef _OCEABASE_OBSERVER_VIRTUAL_TABLE_OB_VIRTUAL_OBRPC_SEND_STAT_H_ diff --git a/src/observer/virtual_table/ob_virtual_open_cursor_table.cpp b/src/observer/virtual_table/ob_virtual_open_cursor_table.cpp index 15c43d3fe..b81dd8595 100644 --- a/src/observer/virtual_table/ob_virtual_open_cursor_table.cpp +++ b/src/observer/virtual_table/ob_virtual_open_cursor_table.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_virtual_open_cursor_table.h b/src/observer/virtual_table/ob_virtual_open_cursor_table.h index 7a7e7914c..25f76de17 100644 --- a/src/observer/virtual_table/ob_virtual_open_cursor_table.h +++ b/src/observer/virtual_table/ob_virtual_open_cursor_table.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_OPEN_CURSOR diff --git a/src/observer/virtual_table/ob_virtual_proxy_server_stat.cpp b/src/observer/virtual_table/ob_virtual_proxy_server_stat.cpp index a0c8b955c..10d38b876 100644 --- a/src/observer/virtual_table/ob_virtual_proxy_server_stat.cpp +++ b/src/observer/virtual_table/ob_virtual_proxy_server_stat.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_virtual_proxy_server_stat.h b/src/observer/virtual_table/ob_virtual_proxy_server_stat.h index d5a461711..e95a68517 100644 --- a/src/observer/virtual_table/ob_virtual_proxy_server_stat.h +++ b/src/observer/virtual_table/ob_virtual_proxy_server_stat.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_PROXY_SERVER_STAT_H_ diff --git a/src/observer/virtual_table/ob_virtual_proxy_sys_variable.cpp b/src/observer/virtual_table/ob_virtual_proxy_sys_variable.cpp index da65eb0ab..f6d28c8a8 100644 --- a/src/observer/virtual_table/ob_virtual_proxy_sys_variable.cpp +++ b/src/observer/virtual_table/ob_virtual_proxy_sys_variable.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_virtual_proxy_sys_variable.h b/src/observer/virtual_table/ob_virtual_proxy_sys_variable.h index 9d78c10e3..8f8036efb 100644 --- a/src/observer/virtual_table/ob_virtual_proxy_sys_variable.h +++ b/src/observer/virtual_table/ob_virtual_proxy_sys_variable.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_PROXY_SYS_VARIABLE_H_ diff --git a/src/observer/virtual_table/ob_virtual_show_trace.cpp b/src/observer/virtual_table/ob_virtual_show_trace.cpp index 0f49d15ed..5e47a533d 100644 --- a/src/observer/virtual_table/ob_virtual_show_trace.cpp +++ b/src/observer/virtual_table/ob_virtual_show_trace.cpp @@ -1,17 +1,17 @@ /* - * Copyright (c) 2022 OceanBase Technology Co.,Ltd. - * OceanBase is licensed under Mulan PubL v1. - * You can use this software according to the terms and conditions of the Mulan PubL v1. - * You may obtain a copy of Mulan PubL v1 at: - * http://license.coscl.org.cn/MulanPubL-1.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v1 for more details. - * --------------------------------------------------------------------------------------- - * Authors: - * Juehui <> - * --------------------------------------------------------------------------------------- + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER #include "observer/ob_sql_client_decorator.h" diff --git a/src/observer/virtual_table/ob_virtual_show_trace.h b/src/observer/virtual_table/ob_virtual_show_trace.h index a8ee485df..a71c6d4f7 100644 --- a/src/observer/virtual_table/ob_virtual_show_trace.h +++ b/src/observer/virtual_table/ob_virtual_show_trace.h @@ -1,17 +1,17 @@ /* - * Copyright (c) 2022 OceanBase Technology Co.,Ltd. - * OceanBase is licensed under Mulan PubL v1. - * You can use this software according to the terms and conditions of the Mulan PubL v1. - * You may obtain a copy of Mulan PubL v1 at: - * http://license.coscl.org.cn/MulanPubL-1.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v1 for more details. - * --------------------------------------------------------------------------------------- - * Authors: - * Juehui <> - * --------------------------------------------------------------------------------------- + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_VIRTUAL_SHOW_TRACE_H_ #define OB_VIRTUAL_SHOW_TRACE_H_ diff --git a/src/observer/virtual_table/ob_virtual_span_info.cpp b/src/observer/virtual_table/ob_virtual_span_info.cpp index 2f805dfac..1a1b821af 100644 --- a/src/observer/virtual_table/ob_virtual_span_info.cpp +++ b/src/observer/virtual_table/ob_virtual_span_info.cpp @@ -1,17 +1,17 @@ /* - * Copyright (c) 2022 OceanBase Technology Co.,Ltd. - * OceanBase is licensed under Mulan PubL v1. - * You can use this software according to the terms and conditions of the Mulan PubL v1. - * You may obtain a copy of Mulan PubL v1 at: - * http://license.coscl.org.cn/MulanPubL-1.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v1 for more details. - * --------------------------------------------------------------------------------------- - * Authors: - * Juehui <> - * --------------------------------------------------------------------------------------- + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_virtual_span_info.h" @@ -279,9 +279,9 @@ int ObVirtualSpanInfo::check_ip_and_port(bool &is_valid) { int ret = OB_SUCCESS; is_valid = true; - // is_serving_tenant被改成 (svr_ip, svr_port) in (ip1, port1), (ip2, port2), ... - // 抽出来的query range为[(ip1, port1), (ip1, port1)], [(ip2, port2), (ip2, port2)], ... - // 需要遍历所有query range,判断本机的ip & port是否落在某一个query range中 + // is_serving_tenant changed to (svr_ip, svr_port) in (ip1, port1), (ip2, port2), ... + // The extracted query range is [(ip1, port1), (ip1, port1)], [(ip2, port2), (ip2, port2)], ... + // Need to traverse all query ranges, and determine if the local ip & port falls within any one of the query ranges if (key_ranges_.count() >= 1) { is_valid = false; for (int64_t i = 0; OB_SUCC(ret) && !is_valid && i < key_ranges_.count(); i++) { diff --git a/src/observer/virtual_table/ob_virtual_span_info.h b/src/observer/virtual_table/ob_virtual_span_info.h index e2b4325d8..f95fb5b57 100644 --- a/src/observer/virtual_table/ob_virtual_span_info.h +++ b/src/observer/virtual_table/ob_virtual_span_info.h @@ -1,17 +1,17 @@ /* - * Copyright (c) 2022 OceanBase Technology Co.,Ltd. - * OceanBase is licensed under Mulan PubL v1. - * You can use this software according to the terms and conditions of the Mulan PubL v1. - * You may obtain a copy of Mulan PubL v1 at: - * http://license.coscl.org.cn/MulanPubL-1.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v1 for more details. - * --------------------------------------------------------------------------------------- - * Authors: - * Juehui <> - * --------------------------------------------------------------------------------------- + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_VIRTUAL_SPAN_INFO_H_ #define OB_VIRTUAL_SPAN_INFO_H_ diff --git a/src/observer/virtual_table/ob_virtual_sql_monitor.cpp b/src/observer/virtual_table/ob_virtual_sql_monitor.cpp index 6af1dd432..6bd17dcd0 100644 --- a/src/observer/virtual_table/ob_virtual_sql_monitor.cpp +++ b/src/observer/virtual_table/ob_virtual_sql_monitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -164,7 +168,7 @@ int ObVirtualSqlMonitor::inner_get_next_row(common::ObNewRow *&row) ret= OB_NOT_INIT; SERVER_LOG(WARN, "invalid arugment", K(ret), K(cells), K(allocator_), K(monitor_manager_)); } else { - while (OB_SUCC(get_next_monitor_info())) { //处理可能的空洞 + while (OB_SUCC(get_next_monitor_info())) { // handle possible gaps if (NULL != plan_info_) { start_id_++; break; diff --git a/src/observer/virtual_table/ob_virtual_sql_monitor.h b/src/observer/virtual_table/ob_virtual_sql_monitor.h index 83382ad45..3658c3414 100644 --- a/src/observer/virtual_table/ob_virtual_sql_monitor.h +++ b/src/observer/virtual_table/ob_virtual_sql_monitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_VIRTUAL_SQL_MONITOR_H diff --git a/src/observer/virtual_table/ob_virtual_sql_monitor_statname.cpp b/src/observer/virtual_table/ob_virtual_sql_monitor_statname.cpp index bcdb696be..9b35cc4fc 100644 --- a/src/observer/virtual_table/ob_virtual_sql_monitor_statname.cpp +++ b/src/observer/virtual_table/ob_virtual_sql_monitor_statname.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_virtual_sql_monitor_statname.h" @@ -30,7 +34,7 @@ ObVirtualSqlMonitorStatname::~ObVirtualSqlMonitorStatname() void ObVirtualSqlMonitorStatname::reset() { ObVirtualTableScannerIterator::reset(); - stat_iter_ = 1; // 第一项是 MONITOR_STATNAME_BEGIN,跳过 + stat_iter_ = 1; // The first item is MONITOR_STATNAME_BEGIN, skip for (int64_t i = 0; i < OB_ROW_MAX_COLUMNS_COUNT; i++) { cells_[i].reset(); } diff --git a/src/observer/virtual_table/ob_virtual_sql_monitor_statname.h b/src/observer/virtual_table/ob_virtual_sql_monitor_statname.h index 27ff252eb..f2c0c2e32 100644 --- a/src/observer/virtual_table/ob_virtual_sql_monitor_statname.h +++ b/src/observer/virtual_table/ob_virtual_sql_monitor_statname.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OB_VIRTUAL_SQL_MONITOR_STATNAME_H_ diff --git a/src/observer/virtual_table/ob_virtual_sql_plan_monitor.cpp b/src/observer/virtual_table/ob_virtual_sql_plan_monitor.cpp index cd15a86d1..e138eaf71 100644 --- a/src/observer/virtual_table/ob_virtual_sql_plan_monitor.cpp +++ b/src/observer/virtual_table/ob_virtual_sql_plan_monitor.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER diff --git a/src/observer/virtual_table/ob_virtual_sql_plan_monitor.h b/src/observer/virtual_table/ob_virtual_sql_plan_monitor.h index c702e7911..c7048a473 100644 --- a/src/observer/virtual_table/ob_virtual_sql_plan_monitor.h +++ b/src/observer/virtual_table/ob_virtual_sql_plan_monitor.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_VIRTUAL_SQL_PLAN_MONITOR_H diff --git a/src/observer/virtual_table/ob_virtual_sql_plan_statistics.cpp b/src/observer/virtual_table/ob_virtual_sql_plan_statistics.cpp index 3af2f2c3d..31b79ea65 100644 --- a/src/observer/virtual_table/ob_virtual_sql_plan_statistics.cpp +++ b/src/observer/virtual_table/ob_virtual_sql_plan_statistics.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "observer/virtual_table/ob_virtual_sql_plan_statistics.h" @@ -118,7 +122,7 @@ int ObVirtualSqlPlanStatistics::inner_open() SERVER_LOG(WARN, "invalid tenant id range, can only search one tenant", K(ret), K(start_tenant_id), K(end_tenant_id)); } else if (OB_SYS_TENANT_ID == start_tenant_id) { - //查询租户为系统租户,可以查询所有的plan cache + //Query tenant as system tenant, can query all plan cache if (OB_FAIL(get_all_tenant_id())) { SERVER_LOG(WARN, "fail to get all tenant id", K(ret)); } @@ -143,7 +147,7 @@ int ObVirtualSqlPlanStatistics::get_all_tenant_id() int ObVirtualSqlPlanStatistics::get_row_from_specified_tenant(uint64_t tenant_id, bool &is_end) { int ret = OB_SUCCESS; - // !!! 引用plan cache资源之前必须加ObReqTimeGuard + // !!! Must add ObReqTimeGuard before referencing plan cache resources ObReqTimeGuard req_timeinfo_guard; is_end = false; sql::ObPlanCache *plan_cache = NULL; diff --git a/src/observer/virtual_table/ob_virtual_sql_plan_statistics.h b/src/observer/virtual_table/ob_virtual_sql_plan_statistics.h index f430a54e2..8534c022c 100644 --- a/src/observer/virtual_table/ob_virtual_sql_plan_statistics.h +++ b/src/observer/virtual_table/ob_virtual_sql_plan_statistics.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_OB_VIRTUAL_SQL_PLAN_STATISTICS_H diff --git a/src/observer/virtual_table/ob_virtual_table_iterator_factory.cpp b/src/observer/virtual_table/ob_virtual_table_iterator_factory.cpp index 53627cb7f..56fcdf370 100644 --- a/src/observer/virtual_table/ob_virtual_table_iterator_factory.cpp +++ b/src/observer/virtual_table/ob_virtual_table_iterator_factory.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX SERVER @@ -60,7 +64,6 @@ #include "observer/virtual_table/ob_all_virtual_tablet_info.h" #include "observer/virtual_table/ob_all_virtual_sys_parameter_stat.h" #include "observer/virtual_table/ob_all_virtual_tenant_parameter_stat.h" -#include "observer/virtual_table/ob_all_virtual_tenant_parameter_info.h" #include "observer/virtual_table/ob_all_virtual_memstore_info.h" #include "observer/virtual_table/ob_all_virtual_minor_freeze_info.h" #include "observer/virtual_table/ob_gv_sql_audit.h" @@ -709,14 +712,6 @@ int ObVTIterCreator::create_vt_iter(ObVTableScanParam ¶ms, } break; } - case OB_ALL_VIRTUAL_TENANT_PARAMETER_INFO_TID: { - ObAllVirtualTenantParameterInfo *all_virtual_tenant_parameter_info = nullptr; - if (OB_SUCC(NEW_VIRTUAL_TABLE(ObAllVirtualTenantParameterInfo, - all_virtual_tenant_parameter_info))) { - vt_iter = static_cast(all_virtual_tenant_parameter_info); - } - break; - } case OB_ALL_VIRTUAL_MEMSTORE_INFO_TID: { ObAllVirtualMemstoreInfo *all_virtual_memstore_info = NULL; if (OB_FAIL(NEW_VIRTUAL_TABLE(ObAllVirtualMemstoreInfo, all_virtual_memstore_info))) { diff --git a/src/observer/virtual_table/ob_virtual_table_iterator_factory.h b/src/observer/virtual_table/ob_virtual_table_iterator_factory.h index 3b84a4be3..9e27ae475 100644 --- a/src/observer/virtual_table/ob_virtual_table_iterator_factory.h +++ b/src/observer/virtual_table/ob_virtual_table_iterator_factory.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_OBSERVER_VIRTUAL_TABLE_OB_ALL_VIRTUAL_TABLE_ITERATOR_FACTORY_ diff --git a/src/observer/virtual_table/ob_virtual_table_tablet_iter.cpp b/src/observer/virtual_table/ob_virtual_table_tablet_iter.cpp index 5d80cabf2..9f7866bb9 100644 --- a/src/observer/virtual_table/ob_virtual_table_tablet_iter.cpp +++ b/src/observer/virtual_table/ob_virtual_table_tablet_iter.cpp @@ -1,12 +1,18 @@ -//Copyright (c) 2022 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #include "observer/virtual_table/ob_virtual_table_tablet_iter.h" #include "storage/tx_storage/ob_ls_service.h" diff --git a/src/observer/virtual_table/ob_virtual_table_tablet_iter.h b/src/observer/virtual_table/ob_virtual_table_tablet_iter.h index 4197aa232..4d4a4b19e 100644 --- a/src/observer/virtual_table/ob_virtual_table_tablet_iter.h +++ b/src/observer/virtual_table/ob_virtual_table_tablet_iter.h @@ -1,12 +1,18 @@ -//Copyright (c) 2022 OceanBase -// OceanBase is licensed under Mulan PubL v2. -// You can use this software according to the terms and conditions of the Mulan PubL v2. -// You may obtain a copy of Mulan PubL v2 at: -// http://license.coscl.org.cn/MulanPubL-2.0 -// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -// See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. + */ #ifndef SRC_OBSERVER_VIRTUAL_TABLE_TABLET_ITER_H_ #define SRC_OBSERVER_VIRTUAL_TABLE_TABLET_ITER_H_ diff --git a/src/pl/CMakeLists.txt b/src/pl/CMakeLists.txt index 4a51f331c..f1a689d72 100644 --- a/src/pl/CMakeLists.txt +++ b/src/pl/CMakeLists.txt @@ -64,8 +64,10 @@ ob_set_subtarget(ob_pl sys_package sys_package/ob_pl_dbms_trusted_certificate_manager.cpp sys_package/ob_dbms_limit_calculator_mysql.cpp sys_package/ob_dbms_vector_mysql.cpp + sys_package/ob_dbms_hybrid_vector_mysql.cpp sys_package/ob_dbms_external_table.cpp sys_package/ob_dbms_partition.cpp + sys_package/ob_dbms_ai_service.cpp ) ob_set_subtarget(ob_pl pl_recompile diff --git a/src/pl/diagnosis/ob_pl_sql_audit_guard.cpp b/src/pl/diagnosis/ob_pl_sql_audit_guard.cpp index d5b406947..be135f08e 100644 --- a/src/pl/diagnosis/ob_pl_sql_audit_guard.cpp +++ b/src/pl/diagnosis/ob_pl_sql_audit_guard.cpp @@ -1,14 +1,18 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL @@ -58,7 +62,7 @@ ObPLSqlAuditGuard::ObPLSqlAuditGuard( sqlstat_record_.set_is_in_retry(session_info_.get_is_in_retry()); session_info_.sql_sess_record_sql_stat_start_value(sqlstat_record_); } - // 监控项统计开始 + // Monitoring item statistics start record_.time_record_.set_send_timestamp(ObTimeUtility::current_time()); session_info_.get_raw_audit_record().sql_memory_used_ = &sql_used_memory_size_; plsql_compile_time_ = session_info_.get_plsql_compile_time(); diff --git a/src/pl/diagnosis/ob_pl_sql_audit_guard.h b/src/pl/diagnosis/ob_pl_sql_audit_guard.h index 0e21e0605..39b8a09c6 100644 --- a/src/pl/diagnosis/ob_pl_sql_audit_guard.h +++ b/src/pl/diagnosis/ob_pl_sql_audit_guard.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SRC_PL_SQL_AUDIT_GUARD_OB_PL_H_ @@ -137,4 +141,4 @@ class ObPLSqlAuditGuard } } -#endif /*OCEANBASE_SRC_PL_SQL_AUDIT_GUARD_OB_PL_H_*/ \ No newline at end of file +#endif /*OCEANBASE_SRC_PL_SQL_AUDIT_GUARD_OB_PL_H_*/ diff --git a/src/pl/ob_pl.cpp b/src/pl/ob_pl.cpp index f9b51768f..8fe3a13c3 100644 --- a/src/pl/ob_pl.cpp +++ b/src/pl/ob_pl.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL @@ -208,8 +212,7 @@ int ObPL::init(common::ObMySQLProxy &sql_proxy) OX (composite_serialize_size_callback = ObUserDefinedType::get_serialize_obj_size); return ret; } - -// 存到objects_的obobj, 其内存必须是exec ctx的allocator来分配的 +// Store to obobj of objects_, its memory must be allocated by the allocator of exec ctx void ObPLCtx::reset_obj() { int tmp_ret = OB_SUCCESS; @@ -350,7 +353,7 @@ int ObPL::execute_proc(ObPLExecCtx &ctx, } } } - ctx.exec_ctx_->get_sql_ctx()->schema_guard_ = old_schema_guard; //这里其实没有必要置回来,但是不置的话schema_guard的生命周期结束后会变成野指针太危险了 + ctx.exec_ctx_->get_sql_ctx()->schema_guard_ = old_schema_guard; //Here it is actually unnecessary to reset, but if not reset, schema_guard will become a dangling pointer when its lifecycle ends, which is too dangerous. // support `SHOW WARNINGS` in mysql PL if (OB_FAIL(ret)) { ctx.exec_ctx_->get_my_session()->set_show_warnings_buf(ret); @@ -473,8 +476,8 @@ void ObPLContext::register_after_begin_autonomous_session_for_deadlock_(ObSQLSes const ObTransID last_trans_id) { ObTransID now_trans_id = session_info.get_tx_id(); - // 上一个事务等自治事务结束,若自治事务要加上一个事务已经持有的锁,则会死锁 - // 为检测死锁,需要注册上一个事务到自治事务的等待关系 + // Wait for the previous autonomous transaction to end, if the autonomous transaction needs to add a lock held by an existing transaction, it will cause a deadlock + // To detect deadlocks, the waiting relationship of the previous transaction to the autonomous transaction needs to be registered if (last_trans_id != now_trans_id && last_trans_id.is_valid() && now_trans_id.is_valid()) { @@ -577,14 +580,14 @@ int ObPLContext::init(ObSQLSessionInfo &session_info, OX (need_remove_top_stack = true); OX (session_info.set_pl_can_retry(true)); } else if (is_function_or_trigger && lib::is_mysql_mode()) { - //mysql模式, 内层function或者trigger不需要创建隐式savepoint, 只需要重置ac - //如果是procedure调udf场景: - // ac = 0时, udf内部的dml操作需要回滚, 需要创建隐式savepoint - // ac = 1时, procedure内部的dml语句执行完立即提交了, 所以只考虑执行udf语句本身: - // 1. dml触发udf, 语句本身开事务, udf执行报错时, 内部无需回滚, 跟随外面的dml语句回滚即可 - // 2. 不开事务的dml语句, 没有事务, 无需创建隐式回滚点, 内部无需回滚, 跟随外面的dml语句回滚即可 - // 3. pl内部表达式中调用udf, 没有事务, 无需创建隐式回滚点, 内层udf内部如果开事务了, destory阶段整体回滚或提交即可 - //如果是udf调udf场景, 外层udf已经重置ac, 且内层udf跟随外层udf在destory阶段的回滚或提交 + //mysql mode, inner function or trigger does not need to create an implicit savepoint, only need to reset ac + //If it is a procedure calling UDF scenario: + // When ac = 0, the DML operations inside the UDF need to be rolled back, an implicit savepoint needs to be created + // When ac = 1, the DML statements inside the procedure are committed immediately after execution, so only consider executing the UDF statement itself: + // 1. dml triggers udf, the statement itself starts a transaction, if udf execution fails, no internal rollback is needed, it will follow the rollback of the outer dml statement + // 2. DML statements without transaction, no transaction needed, no need to create an implicit rollback point, no internal rollback required, just follow the rollback of the outer DML statements + // 3. internal expression in pl calls udf, no transaction, no need to create implicit rollback point, if inner udf opens a transaction, rollback or commit as a whole in the destroy phase + // If it is a udf calling udf scenario, the outer udf has already reset ac, and the inner udf follows the outer udf's rollback or commit in the destroy phase if (OB_NOT_NULL(session_info.get_tx_desc()) && session_info.get_tx_desc()->in_tx_or_has_extra_state() && !in_nested_sql_ctrl()) { OZ (ObSqlTransControl::create_savepoint(ctx, PL_IMPLICIT_SAVEPOINT)); @@ -599,8 +602,8 @@ int ObPLContext::init(ObSQLSessionInfo &session_info, if (OB_SUCC(ret) && is_function_or_trigger && lib::is_mysql_mode() && routine->get_has_parallel_affect_factor()) { - // 并行场景下不能创建stash savepoint, 只有当udf/trigger内部有tcl语句时, stash savepoint才有意义 - // udf内部有tcl语句时,该标记为true + // In parallel scenarios, stash savepoint cannot be created; stash savepoint is only meaningful when there are TCL statements inside udf/trigger + // The flag is true when there are tcl statements inside the udf const ObString stash_savepoint_name("PL stash savepoint"); OZ (ObSqlTransControl::create_stash_savepoint(ctx, stash_savepoint_name)); OX (has_stash_savepoint_ = true); @@ -768,7 +771,7 @@ void ObPLContext::destory( LOG_WARN("not supported cmd execute udf which has dml stmt", K(ret)); LOG_USER_ERROR(OB_NOT_SUPPORTED, "use cmd stmt execute udf which has dml stmt"); } - if (OB_SUCCESS != ret && session_info.is_in_transaction()) { // PL执行失败, 需要回滚 + if (OB_SUCCESS != ret && session_info.is_in_transaction()) { // PL execution failed, need to rollback int tmp_ret = OB_SUCCESS; if (has_implicit_savepoint_) { // ORACLE: alreay rollback to PL/SQL start. @@ -785,8 +788,8 @@ void ObPLContext::destory( session_info.set_pl_can_retry(false); } } else if (!in_nested_sql_ctrl() && session_info.get_in_transaction()) { - // 如果没有隐式的检查点且不再嵌套事务中, 说明当前事务中仅包含该PL, 直接回滚事务 - // 嵌套语句中的PL会随着顶层的语句一起回滚, 不需要单独回滚 + // If there is no implicit checkpoint and not nested within a transaction, it means the current transaction contains only this PL, directly rollback the transaction + // PL in nested statements will roll back with the top-level statement, no separate rollback is needed // ORACLE: alreay rollback to PL/SQL start. // MYSQL : rollback only if OB_TRY_LOCK_ROW_CONFLICT==ret and PL/SQL can retry. if ((lib::is_mysql_mode() && @@ -800,27 +803,27 @@ void ObPLContext::destory( ret = OB_SUCCESS == ret ? tmp_ret : ret; } else if (!is_autonomous_ && reset_autocommit_ && !in_nested_sql_ctrl() && ((lib::is_mysql_mode() && is_function_or_trigger_))) { - /* 非dml出发点的udf, 如set @a= f1(), 需要在udf内部提交 */ + /* Non-DML trigger point UDF, such as set @a = f1(), needs to be committed within the UDF */ if (has_implicit_savepoint_) { // reset_autocommit_ && has_implicit_savepoint_ equal to scene of ac=1 && explict transaction. // no need to commit } else if (!session_info.associated_xa()) { - //如果当前事务是xa事务,则不提交当前事务,只设置ac=true.否则提交当前事务 - // 先COMMIT, 然后再修改AutoCommit + // If the current transaction is an xa transaction, then do not commit the current transaction, only set ac=true. Otherwise, commit the current transaction + // First COMMIT, then modify AutoCommit int tmp_ret = OB_SUCCESS; if (OB_SUCCESS == ret - //异步提交无法带给proxy未hit信息(ObPartitionHitInfo默认值是Hit),如果未hit走同步提交 + //Asynchronous submission cannot provide proxy with unhit information (ObPartitionHitInfo default value is Hit), if unhit, use synchronous submission && session_info_->partition_hit().get_bool() - // 如果顶层调用有出参也不走异步提交, 因为要向客户端回数据 + // If the top-level call has out parameters, it does not go through asynchronous submission, because data needs to be returned to the client && !has_output_arguments()) { if (OB_SUCCESS != (tmp_ret = implicit_end_trans(session_info, ctx, false, true))) { - // 不覆盖原来的错误码 + // Do not overwrite the original error code LOG_WARN("failed to explicit end trans", K(ret), K(tmp_ret)); } else { LOG_DEBUG("explicit end trans success!", K(ret)); } - } else { // 不确定上层是否会扔回队列重试,因此失败了一定要走同步提交 + } else { // Uncertain if the upper layer will requeue for retry, so failure must take the synchronous submission path // always call commit/rollback txn in order to reset txn because of autocommit tmp_ret = implicit_end_trans(session_info, ctx, ret != OB_SUCCESS); } @@ -836,8 +839,7 @@ void ObPLContext::destory( ctx.set_need_disconnect(false); } } - - // 清理serially package + // clean serially package int tmp_ret = OB_SUCCESS; if (OB_SUCCESS != (tmp_ret = session_info.reset_all_serially_package_state())) { @@ -853,16 +855,16 @@ void ObPLContext::destory( } session_info.reset_top_query_string(); } - // 无论如何恢复session上的状态 + // Restore the state on the session in any case session_info.set_pl_stack_ctx(NULL); session_info_ = NULL; IGNORE_RETURN ObPLContext::debug_stop(&session_info); #undef IS_DBLINK_TRANS } else if (lib::is_mysql_mode() && is_function_or_trigger_) { - // 非嵌套场景: 内层udf一定是在表达式里面, 提交由spi_calc_expr处来保证 - // 嵌套场景: 内层udf被dml语句触发, 回滚或提交由外层dml语句保证 - if (OB_SUCCESS != ret && session_info.is_in_transaction()) { // PL执行失败, 需要回滚 + // Non-nested scenario: The inner udf must be inside the expression, submission is guaranteed by spi_calc_expr + // Nested scenario: Inner UDF is triggered by DML statement, rollback or commit is guaranteed by the outer DML statement + if (OB_SUCCESS != ret && session_info.is_in_transaction()) { // PL execution failed, need to rollback int tmp_ret = OB_SUCCESS; if (has_implicit_savepoint_) { if (OB_SUCCESS != (tmp_ret = ObSqlTransControl::rollback_savepoint(ctx, PL_IMPLICIT_SAVEPOINT))) { @@ -873,7 +875,7 @@ void ObPLContext::destory( } ret = OB_SUCCESS == ret ? tmp_ret : ret; } - // 无论如何都还原autocommit值 + // Restore autocommit value in any case if (reset_autocommit_) { int tmp_ret = OB_SUCCESS; tmp_ret = session_info.set_autocommit(true); @@ -889,7 +891,7 @@ void ObPLContext::destory( ret = OB_SUCCESS == ret ? end_trans_ret : ret; } if (is_top_stack_) { - // 无论如何都还原autocommit值 + // Restore the autocommit value in any case if (reset_autocommit_) { int tmp_ret = OB_SUCCESS; tmp_ret = session_info.set_autocommit(true); @@ -995,7 +997,7 @@ void ObPLContext::dec_and_check_depth(int64_t package_id, int ObPLContext::check_routine_legal(ObPLFunction &routine, bool in_function, bool in_tg) { int ret = OB_SUCCESS; - // 检查routine中语句的合法性 + // Check the legality of statements in the routine if (in_function || in_tg) { if (routine.get_contain_dynamic_sql() && lib::is_mysql_mode()) { ret = OB_ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG; @@ -1055,17 +1057,17 @@ void ObPLContext::reset_exec_env(int &ret) // because sql_mode may be change inside PL. ObExecEnv curr_env; if (OB_SUCCESS != (tmp_ret = curr_env.load(*session_info_))) { - ret = OB_SUCCESS == ret ? tmp_ret : ret; // 不覆盖错误码 + ret = OB_SUCCESS == ret ? tmp_ret : ret; // Do not overwrite error code LOG_WARN("failed to load current exec_env", K(ret), K(tmp_ret), K(exec_env_), K(curr_env)); } else if (curr_env == exec_env_) { // do nothing } else if (OB_SUCCESS != (tmp_ret = exec_env_.store(*session_info_))) { - ret = OB_SUCCESS == ret ? tmp_ret : ret; // 不覆盖错误码 + ret = OB_SUCCESS == ret ? tmp_ret : ret; // Do not overwrite error code LOG_WARN("failed to set exec_env", K(ret), K(tmp_ret), K(exec_env_), K(curr_env)); } } else { // oracle mode if (OB_SUCCESS != (tmp_ret = exec_env_.store(*session_info_))) { - ret = OB_SUCCESS == ret ? tmp_ret : ret; // 不覆盖错误码 + ret = OB_SUCCESS == ret ? tmp_ret : ret; // Do not overwrite error code LOG_WARN("failed to set exec_env", K(ret), K(tmp_ret), K(exec_env_)); } } @@ -1081,8 +1083,8 @@ int ObPLContext::set_role_id_array(ObPLFunction &routine, and you cannot set roles within a definer's rights procedure. */ if (lib::is_mysql_mode() && !routine.is_invoker_right() && 0 != routine.get_priv_user().length() - /* 兼容存量存储过程,存量存储过程的priv_user为空。mysql存储过程默认为definer行为, - 当前ob mysql模式做成了默认invoker行为,支持definer后,ob mysql模式也默认为definer行为 */) { + /* Compatible with existing stored procedures, where the priv_user of existing stored procedures is empty. MySQL stored procedures default to definer behavior, + after OB MySQL mode is made to default to invoker behavior, OB MySQL mode will also default to definer behavior after supporting definer */) { ObString priv_user = routine.get_priv_user(); ObString user_name = priv_user.split_on('@'); ObString host_name = priv_user; @@ -1199,7 +1201,7 @@ void ObPLContext::reset_default_database(int &ret) LOG_ERROR("current session info is null", K(ret), K(session_info_)); } else if (OB_SUCCESS != (tmp_ret = session_info_->set_default_database(database_name_.string()))) { - ret = OB_SUCCESS == ret ? tmp_ret : ret; // 不覆盖错误码 + ret = OB_SUCCESS == ret ? tmp_ret : ret; // Do not overwrite error code LOG_ERROR("failed to reset default database", K(ret), K(tmp_ret), K(database_name_)); } else { session_info_->set_database_id(database_id_); @@ -1330,7 +1332,7 @@ int ObPL::execute(ObExecContext &ctx, ctx, package_guard, routine, - local_result, // 这里不直接传result而是用local_result,是因为调用内部要检查OB_ER_SP_NORETURNEND错误 + local_result, // Here we do not directly pass result but use local_result, because the internal call needs to check for OB_ER_SP_NORETURNEND error NULL != status ? *status : local_status, is_top_stack, is_inner_call, @@ -1421,7 +1423,7 @@ int ObPL::execute(ObExecContext &ctx, } } } - // 释放参数列表入参基础类型和init param阶段产生的复杂数据类型 + // Release base types of parameters in the parameter list and complex data types generated during the init param phase for (int i = 0; i < routine.get_arg_count(); ++i) { if (!pl.get_params().at(i).is_pl_extend()) { ObUserDefinedType::destruct_objparam(pl_sym_allocator, @@ -1446,7 +1448,7 @@ int ObPL::execute(ObExecContext &ctx, K(ref_cursor->get_ref_count())); } } else { - // do nothing, 有可能return一个null出来 + // do nothing, there might be a return of null } } // process function return value @@ -1459,8 +1461,7 @@ int ObPL::execute(ObExecContext &ctx, && routine.has_incomplete_rt_dep_error()) { LOG_USER_WARN(OB_ERR_COMPILE_RESULT_NOT_ADD_CACHE, routine.get_function_name().length(), routine.get_function_name().ptr()); } - - //当前层 pl 执行时间 + //Current layer pl execution time int64_t execute_end = ObTimeUtility::current_time(); pl.add_pl_exec_time(execute_end - execute_start - pl.get_pure_sql_exec_time(), is_called_from_sql); #ifndef NDEBUG @@ -1507,7 +1508,7 @@ int ObPL::trans_sql(PlTransformTreeCtx &trans_ctx, ParseNode *root, ObExecContex LOG_WARN("fail to alloc memory for pc param", K(ret), K(ptr)); } for (int64_t i = 0; - OB_SUCC(ret) && i < param_num && NULL != trans_ctx.p_list_;//p_list包含所有表达式和sql的raw param + OB_SUCC(ret) && i < param_num && NULL != trans_ctx.p_list_;//p_list contains all expressions and sql raw params ++i) { pc_param = new(ptr)ObPCParam(); ptr += sizeof(ObPCParam); @@ -1608,7 +1609,7 @@ int ObPL::transform_tree(PlTransformTreeCtx &trans_ctx, ParseNode *root, ParseNo LOG_WARN("arg is null", K(ret)); } else if (OB_NOT_NULL(root) && OB_NOT_NULL(no_param_root) && (!trans_ctx.is_ps_mode_ || trans_ctx.ps_pc_ctx_->ps_need_parameterized_)) { if (T_QUESTIONMARK == no_param_root->type_ && trans_ctx.is_ps_mode_) { - // ps模式下, pl侧解析的?需要统计到raw params中 + // ps mode, need to count the parsed by pl side into raw params ObPCParam *pc_param = nullptr; char *ptr = (char *)trans_ctx.allocator_->alloc(sizeof(ObPCParam)); if (OB_ISNULL(ptr)) { @@ -1623,12 +1624,12 @@ int ObPL::transform_tree(PlTransformTreeCtx &trans_ctx, ParseNode *root, ParseNo } } else if (T_EXPR == no_param_root->type_) { ParseNode *expr_node = NULL; - /* 调整语法树结构, 避免语法树分析阶段因为结构不同报错 */ + /* Adjust the syntax tree structure, to avoid errors during syntax tree analysis due to different structures */ if (OB_ISNULL(expr_node = new_non_terminal_node(trans_ctx.allocator_, T_EXPR, 1, root))) { ret = OB_ALLOCATE_MEMORY_FAILED; LOG_WARN("failed to alloc memory", K(ret)); } else { - /* 语法树分析时会修改node上部分属性, 这里提前记录 */ + /* Syntax tree analysis will modify some attributes of the node, so we record them in advance */ int64_t raw_pos = expr_node->children_[0]->pos_ - trans_ctx.raw_anonymous_off_; int64_t raw_str_off = expr_node->children_[0]->text_len_; trans_ctx.raw_sql_or_expr_.assign_ptr(expr_node->children_[0]->raw_text_, expr_node->children_[0]->text_len_); @@ -1849,7 +1850,7 @@ int ObPL::execute(ObExecContext &ctx, ParamStore ¶ms, const ObStmtNodeTree * int64_t old_worker_timeout_ts = 0; ObPLASHGuard guard(ObPLResolver::ANONYMOUS_VIRTUAL_OBJECT_ID, OB_INVALID_ID); /* !!! - * PL,req_timeinfo_guard一定要在执行前定义 + * PL, req_timeinfo_guard must be defined before execution * !!! */ observer::ObReqTimeGuard req_timeinfo_guard; @@ -2011,7 +2012,7 @@ int ObPL::execute(ObExecContext &ctx, ObPLASHGuard guard(ObPLResolver::ANONYMOUS_VIRTUAL_OBJECT_ID, OB_INVALID_ID); /* !!! - * PL,req_timeinfo_guard一定要在执行前定义 + * PL, req_timeinfo_guard must be defined before execution * !!! */ observer::ObReqTimeGuard req_timeinfo_guard; @@ -2129,7 +2130,7 @@ int ObPL::execute(ObExecContext &ctx, ObCurTraceId::TraceId parent_trace_id; ObPLASHGuard guard(package_id, routine_id); /* !!! - * PL,req_timeinfo_guard一定要在执行前定义 + * PL, req_timeinfo_guard must be defined before execution * !!! */ SMART_VAR(ObPLContext, stack_ctx) { @@ -2582,7 +2583,7 @@ int ObPL::add_pl_lib_cache(ObPLFunction *pl_func, ObPLCacheCtx &pc_ctx) ret = OB_SUCCESS; LOG_WARN("this plan has been added by others, need not add again", KPC(pl_func)); } else if (OB_REACH_MEMORY_LIMIT == ret || OB_SQL_PC_PLAN_SIZE_LIMIT == ret) { - if (REACH_TIME_INTERVAL(1000000)) { //1s, 当内存达到上限时, 该日志打印会比较频繁, 所以以1s为间隔打印 + if (REACH_TIME_INTERVAL(1000000)) { //1s, When memory reaches its limit, this log print will be quite frequent, so it is printed at an interval of 1s LOG_WARN("can't add plan to plan cache", K(ret), K(pl_func->get_mem_size()), K(pc_ctx.key_), K(plan_cache->get_mem_used())); @@ -2592,8 +2593,8 @@ int ObPL::add_pl_lib_cache(ObPLFunction *pl_func, ObPLCacheCtx &pc_ctx) ret = OB_SUCCESS; LOG_WARN("plan cache don't support add this kind of plan now", KPC(pl_func)); } else { - if (OB_REACH_MAX_CONCURRENT_NUM != ret) { //如果是达到限流上限, 则将错误码抛出去 - ret = OB_SUCCESS; //add plan出错, 覆盖错误码, 确保因plan cache失败不影响正常执行路径 + if (OB_REACH_MAX_CONCURRENT_NUM != ret) { //if it reaches the rate limit upper bound, then throw out the error code + ret = OB_SUCCESS; // add plan error, overwrite error code, ensure that plan cache failure does not affect the normal execution path LOG_WARN("Failed to add plan to ObPlanCache", K(ret)); } } @@ -2896,7 +2897,7 @@ bool ObPLExecCtx::valid() { return OB_NOT_NULL(allocator_) && OB_NOT_NULL(exec_ctx_) - // 通过interface机制映射进来的接口无法提供、也不会使用func_指针。 + // The interface mapped in through the interface mechanism cannot provide or use the func_ pointer. // && OB_NOT_NULL(func_) && OB_NOT_NULL(exec_ctx_->get_sql_ctx()) && OB_NOT_NULL(exec_ctx_->get_my_session()); @@ -2992,8 +2993,7 @@ int ObPLExecState::final(int ret) } } } - - // 异常场景下,释放参数列表 + // In abnormal scenarios, release the parameter list for (int i = 0; OB_SUCCESS != ret && i < func_.get_arg_count() && i < get_params().count(); ++i) { if (!get_params().at(i).is_pl_extend()) { ObUserDefinedType::destruct_objparam(*get_allocator(), @@ -3005,10 +3005,9 @@ int ObPLExecState::final(int ret) ctx_.exec_ctx_->get_my_session()); } } - - // 1. inner call inout 非nocopy参数会深拷一份, 执行异常时需要释放 - // 2. inner call 纯out属性复杂数据类型参数, 会生成一个新的obj, 执行失败时会抛出异常, 不会走到geneate_out_param里面的释放内存逻辑 - // 需要提前释放内存 + // 1. inner call inout non-nocopy parameters will be deep copied, and need to be released in case of execution exceptions + // 2. inner call pure out attribute complex data type parameter, will generate a new obj, execution failure will throw an exception, will not go to geneate_out_param inside the memory release logic + // Need to release memory in advance for (int64_t i = 0; OB_SUCCESS != ret && inner_call_ && !func_.is_function() && i < func_.get_arg_count(); ++i) { if (func_.get_variables().at(i).is_composite_type() && i < get_params().count() && get_params().at(i).is_ext()) { @@ -3063,8 +3062,8 @@ int ObPLExecState::final(int ret) ret = OB_SUCCESS == ret ? tmp_ret : ret; LOG_INFO("close session cursor after pl exec.", K(ret), K(tmp_ret), K(cursor->get_id())); } else if (OB_FAIL(ret)) { - // 函数结束这儿还需要close cursor,因为如果有异常,block结束除的close cursor就走不到,这儿还需要关闭 - // 这儿为啥可能为null + // The function ends here, we still need to close the cursor, because if there is an exception, the close cursor in the block end will not be reached, so we need to close it here as well + // Why might this be null here /* * * create or replace procedure pp(a number) is @@ -3084,8 +3083,7 @@ int ObPLExecState::final(int ret) dbms_output.put_line('catch exception'); end; * - * 上例中c1 调用了cursor init,但是c2没有调用,因为被execption打断,这个时候在final函数里面调用cursor close - * 函数,这个obj就是null,因为c2没有调用cursor init。 另外goto也可能导致执行流变动,没有open就去close + * In the example above, c1 called cursor init, but c2 did not call it because it was interrupted by the exception. At this point, calling the cursor close function in the final function, this obj will be null because c2 did not call cursor init. Additionally, goto may also cause changes in the execution flow, attempting to close without opening. */ if (OB_SUCCESS != ObSPIService::spi_cursor_close(&ctx_, func_.get_package_id(), func_.get_routine_id(), i, true)) { @@ -3518,7 +3516,7 @@ int ObPLExecState::init_params(const ParamStore *params, bool is_anonymous) OX (param.set_is_ref_cursor_type(true)); OX (param.set_extend(0, PL_REF_CURSOR_TYPE)); OX (param.set_udt_id(func_.get_variables().at(i).get_user_type_id())); - // CURSOR初始化为NULL + // CURSOR initialized to NULL } else if (func_.get_variables().at(i).is_cursor_type()) { // leave obj as null type, spi_init wil init it. } else if (func_.get_variables().at(i).is_subtype()) { @@ -3591,7 +3589,7 @@ do { \ } else { OX (get_params().at(i) = params->at(i)); } - } else if (params->at(i).is_pl_mock_default_param()) { // 使用参数默认值 + } else if (params->at(i).is_pl_mock_default_param()) { // Use parameter default value ObObjParam result; sql::ObSqlExpression *default_expr = func_.get_default_expr(i); OV (OB_NOT_NULL(default_expr), OB_ERR_UNEXPECTED, K(i), K(func_.get_default_idxs())); @@ -3616,19 +3614,19 @@ do { \ } else if (pl_type.is_composite_type() && (params->at(i).is_null() || (params->at(i).is_ext() && params->at(i).get_ext() == 0))) { - // 如果复杂类型传入了null则构造一个初始化的值 + // If a complex type is passed as null, construct an initialized value OZ (init_complex_obj((*get_allocator()), func_.get_variables().at(i), get_params().at(i))); - //if (!func_.get_out_args().has_member(i)) { //纯in场景需要在执行完释放 + //if (!func_.get_out_args().has_member(i)) { //pure in scenario needs to be released after execution OX (need_free_.at(i) = true); //} - } else if (pl_type.is_obj_type() // 复杂类型不需要做类型转换(不支持复杂类型的转换), 直接赋值 + } else if (pl_type.is_obj_type() // Complex types do not require type conversion (complex type conversion is not supported), direct assignment && (params->at(i).get_meta() != get_params().at(i).get_meta() || params->at(i).get_accuracy() != get_params().at(i).get_accuracy())) { if (params->at(i).is_null()) { ObObjMeta param_meta = get_params().at(i).get_param_meta(); - get_params().at(i) = params->at(i); // 空值不做cast + get_params().at(i) = params->at(i); // Null value does not do cast params->at(i).is_null() ? get_params().at(i).set_param_meta(param_meta) : (void)NULL; } else if (params->at(i).get_meta().get_type() == get_params().at(i).get_meta().get_type() && ob_is_enumset_tc(params->at(i).get_meta().get_type())) { get_params().at(i) = params->at(i); // they are both of enum/set type, no cast is performed. @@ -3639,7 +3637,7 @@ do { \ } else if (get_params().at(i).get_meta().is_null() && is_anonymous && func_.get_is_all_sql_stmt()) { - // 匿名块中全部是SQL语句, 需要向Null转的情况, 这里直接跳过 + // All statements in the anonymous block are SQL statements, and cases where conversion to Null is needed, we skip directly here get_params().at(i) = params->at(i); } else { LOG_DEBUG("column convert", @@ -3655,7 +3653,7 @@ do { \ result_type.set_meta(func_.get_variables().at(i).get_data_type()->get_meta_type()); result_type.set_accuracy(func_.get_variables().at(i).get_data_type()->get_accuracy()); ObObj tmp, copy_obj; - // CHARSET_ANY代表接受任何字符集,因此不能改变入参的字符集 + // CHARSET_ANY represents accepting any character set, therefore the character set of the input parameter cannot be changed if (CS_TYPE_ANY == result_type.get_collation_type()) { if (params->at(i).get_meta().is_string_or_lob_locator_type()) { result_type.set_collation_type(params->at(i).get_meta().get_collation_type()); @@ -3687,7 +3685,7 @@ do { \ K(ret), K(copy_obj), K(i), K(params->count())); } else { // - // 由存储层传入的数据未设置collation_level, 这里设置下 + // The collation_level is not set for the data passed in from the storage layer, setting it here if (get_params().at(i).is_string_type()) { get_params().at(i).set_collation_level(result_type.get_collation_level()); } @@ -3746,8 +3744,8 @@ do { \ CHECK_NOT_NULL_VIOLATED(i, params->at(i)); if (OB_FAIL(ret)) { } else if (pl_type.is_obj_type()) { - // 纯OUT参数, 对于基础类型直接传入NULL的ObObj - ObObj obj; // 基础类型apply一个空的OBJECT + // Pure OUT parameter, for basic types directly pass in NULL ObObj + ObObj obj; // Basic type apply an empty OBJECT ObObjMeta null_meta = get_params().at(i).get_meta(); OZ (get_params().at(i).apply(obj)); OX (get_params().at(i).set_collation_level(null_meta.get_collation_level())); @@ -3763,8 +3761,8 @@ do { \ ret = OB_NOT_SUPPORTED; LOG_WARN("not support nested table type", K(ret)); } else { - // 纯OUT参数, 对于复杂类型需要重新初始化值; 如果传入的复杂类型值为NULL(PS协议), 则初始化一个新的复杂类型 - // 这里先copy入参的值, 由init_complex_obj函数判断是否重新分配内存 + // Pure OUT parameter, for complex types the value needs to be re-initialized; if the passed complex type value is NULL (PS protocol), initialize a new complex type + // Here we first copy the input parameter values, by the init_complex_obj function to determine if memory should be reallocated OX (get_params().at(i) = params->at(i)); OZ (init_complex_obj(*(get_allocator()), pl_type, @@ -3870,7 +3868,7 @@ int ObPLExecRecursionCtx::init(sql::ObSQLSessionInfo &session_info) SYS_VAR_MAX_SP_RECURSION_DEPTH, max_recursion_value))) { LOG_WARN("fail to get system variable value", K(ret), K(SYS_VAR_MAX_SP_RECURSION_DEPTH)); } else { - // Oracle兼容: 不限制递归的层次 + // Oracle compatible: no restriction on recursion depth max_recursion_depth_ = max_recursion_value.get_int(); init_ = true; } @@ -3882,7 +3880,7 @@ int ObPLExecRecursionCtx::inc_and_check_depth(uint64_t package_id, uint64_t proc int ret = OB_SUCCESS; int64_t recursion_depth = 0; int64_t *depth_store = NULL; - // 兼容mysql, function不允许嵌套 + // Compatible with MySQL, function does not allow nesting int64_t max_recursion_depth = is_function && lib::is_mysql_mode() ? 0 : max_recursion_depth_; if (!init_) { ret = OB_NOT_INIT; @@ -3987,7 +3985,7 @@ int ObPLExecRecursionCtx::dec_and_check_depth(uint64_t package_id, uint64_t proc return ret; } -/* check用户是否有调用存储过程的权限 */ +/* check if the user has permission to call the stored procedure */ int ObPL::check_exec_priv( ObExecContext &exec_ctx, const ObString &database_name, @@ -4282,7 +4280,7 @@ int ObPLExecState::execute() if (eptr != nullptr) { ret = OB_SUCCESS == ret ? (NULL != ctx_.status_ ? *ctx_.status_ : OB_ERR_UNEXPECTED) : ret; - final(ret); // 避免当前执行的pl内数组内存泄漏, 捕获到异常后先执行final, 然后将异常继续向上抛 + final(ret); // Avoid memory leak of array in the currently executing pl, execute final before throwing the exception upwards after capturing it _Unwind_RaiseException(eptr); } } else { @@ -4661,12 +4659,12 @@ int ObPLINS::init_complex_obj(ObIAllocator &allocator, void *ptr = NULL; CK (pl_type.is_composite_type()); OZ (get_size(PL_TYPE_INIT_SIZE, pl_type, init_size, &expr_allocator)); - // 如果原来已经有值,则不重新分配, 直接在此基础上修改 + // If there is already a value, do not reallocate, modify directly based on this if (obj.is_ext() && obj.get_ext() != 0) { ObObj out_param = obj; OZ (ObUserDefinedType::destruct_obj(out_param, nullptr, true)); CK (OB_NOT_NULL(ptr = reinterpret_cast(obj.get_ext()))); - } else { // 如果原来没有值, 重新分配内存, PS协议的情况, 前端发过来的纯OUT参数是NULL + } else { // If there was no original value, reallocate memory, in the case of the PS protocol, the pure OUT parameter sent from the frontend is NULL if (OB_SUCC(ret) && OB_ISNULL(ptr = allocator.alloc(init_size))) { ret = OB_ALLOCATE_MEMORY_FAILED; LOG_WARN("failed to allocate memory", K(ret), K(init_size)); diff --git a/src/pl/ob_pl.h b/src/pl/ob_pl.h index b44333597..adcf6de79 100644 --- a/src/pl/ob_pl.h +++ b/src/pl/ob_pl.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SRC_PL_OB_PL_H_ @@ -213,7 +217,7 @@ class ObPLFunctionBase } private: - //基础信息 + //Basic information ObProcType proc_type_; uint64_t routine_id_; uint64_t package_id_; @@ -224,7 +228,7 @@ class ObPLFunctionBase uint64_t priv_user_; int64_t gmt_create_; ObPLDataType ret_type_; - int64_t arg_count_; //参数一定在符号表的最前面 + int64_t arg_count_; //Parameters must be at the very front of the symbol table ObPLFlag flag_; DISALLOW_COPY_AND_ASSIGN(ObPLFunctionBase); @@ -533,8 +537,8 @@ class ObPLFunction : public ObPLFunctionBase, public ObPLCompileUnit K_(stack_size)); private: - //符号表信息 - common::ObFixedArray variables_; //根据ObPLSymbolTable的全局符号表生成,所有输入输出参数和PL体内使用的所有变量 + //symbol table information + common::ObFixedArray variables_; //Generated from the global symbol table of ObPLSymbolTable, all input and output parameters and all variables used within the PL body common::ObFixedArray variables_debuginfo_; common::ObFixedArray default_idxs_; common::ObFixedArray sql_infos_; @@ -621,10 +625,10 @@ struct ObPLCtx void reset_obj_range_to_end(int64_t index); common::ObIArray& get_objects() { return objects_; } private: - // 用于收集在PL执行过程中使用到的Allocator, - // 有些数据的生命周期是整个执行期的, 所以不能在PL执行完成后马上释放, 如OUT参数 - // 这里的Allocator需要保证由ObExecContext->allocator分配, - // 这样才能保证释放这里的allocator时指针是有效的 + // Used to collect Allocators used during PL execution, + // Some data has a lifecycle for the entire execution period, so it cannot be released immediately after PL execution is complete, such as OUT parameters + // The Allocator here needs to ensure allocation by ObExecContext->allocator, + // This is to ensure that the pointer is valid when the allocator here is released ObSEArray objects_; }; @@ -674,17 +678,23 @@ struct ObPLExecCtx : public ObPLINS const ObUserDefinedType *&user_type, ObIAllocator *allocator = NULL) const; virtual int calc_expr(uint64_t package_id, int64_t expr_idx, ObObjParam &result); + void set_is_sensitive(bool is_sensitive) const + { + if (OB_NOT_NULL(exec_ctx_) && OB_NOT_NULL(exec_ctx_->get_sql_ctx())) { + exec_ctx_->get_sql_ctx()->is_sensitive_ = is_sensitive; + } + } common::ObIAllocator *allocator_; sql::ObExecContext *exec_ctx_; - ParamStore *params_; // param stroe, 对应PL Function的符号表 + ParamStore *params_; // param store, corresponding to the symbol table of PL Function common::ObObj *result_; - int *status_; //PL里面的sql发生错误会直接抛出异常,走不到函数正常结束的返回值返回错误码,所以要在这里记录错误码 - ObPLFunction *func_; // 对应该执行上下文的func_ - bool in_function_; //记录当前是否在function中 + int *status_; // SQL errors in PL will directly throw exceptions and will not reach the normal return value of the function to return an error code, so the error code needs to be recorded here + ObPLFunction *func_; // corresponds to the func_ of the context to be executed + bool in_function_; // Record whether the current state is inside a function ObPLContext *pl_ctx_; // for error stack - const common::ObIArray *nocopy_params_; //用于描述nocopy参数 - ObPLPackageGuard *guard_; //对应该次执行的package_guard + const common::ObIArray *nocopy_params_; // used to describe nocopy parameters + ObPLPackageGuard *guard_; //corresponding package_guard for this execution ObArenaAllocator expr_alloc_; }; @@ -832,7 +842,7 @@ class ObPLExecState private: private: ObPLFunction &func_; - sql::ObPhysicalPlanCtx phy_plan_ctx_; //运行态的param值放在这里面,跟ObPLFunction里的variables_一一对应,初始化的时候需要设置default值 + sql::ObPhysicalPlanCtx phy_plan_ctx_; //The runtime param values are stored here, corresponding one-to-one with variables_ in ObPLFunction, default values need to be set during initialization sql::ObEvalCtx eval_ctx_; common::ObObj &result_; ObPLExecCtx ctx_; @@ -1070,16 +1080,16 @@ struct PlTransformTreeCtx { ObIAllocator *allocator_; ParamStore *params_; - char *buf_; // 反拼后的参数化字符串 + char *buf_; // parameterized string after reverse concatenation int64_t buf_len_; int64_t buf_size_; - ObString raw_sql_; // 原始匿名块字符串 - int64_t raw_anonymous_off_; // 原始匿名块相对于用户输入首字符的偏移, 解决单个分隔符内存在多个sql场景 - ObString raw_sql_or_expr_; // 匿名块内部单个expr或者sql原始字符串 - ObString no_param_sql_; // 匿名块内部单个expr或者sql对应的fast parser后字符串 + ObString raw_sql_; // original anonymous block string + int64_t raw_anonymous_off_; // The offset of the original anonymous block relative to the first character of user input, solving the scenario where multiple SQL statements exist within a single delimiter + ObString raw_sql_or_expr_; // Raw string of a single expr or sql inside an anonymous block + ObString no_param_sql_; // fast parser string corresponding to a single expr or sql inside the anonymous block int64_t copied_idx_; - ParamList *p_list_; // 存储匿名块内部所有expr和sql语句fast parser后得到的raw param node - int64_t raw_param_num_; // 匿名块内部单个expr或者sql fast parser后raw param node的个数, 每个expr和sql fast parser后, 会将param num存储在node节点中 + ParamList *p_list_; // Store all expr and sql statement raw param nodes obtained after fast parsing inside the anonymous block + int64_t raw_param_num_; // The number of raw param nodes for a single expr or SQL after fast parsing within an anonymous block, the param num will be stored in the node after each expr and SQL fast parsing bool is_ps_mode_; int64_t total_param_nums_; ObPlanCacheCtx *ps_pc_ctx_; diff --git a/src/pl/ob_pl_adt_service.cpp b/src/pl/ob_pl_adt_service.cpp index c02aecffa..200b4af60 100644 --- a/src/pl/ob_pl_adt_service.cpp +++ b/src/pl/ob_pl_adt_service.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL @@ -44,7 +48,7 @@ int ObPLADTService::get_objmeta(ObLLVMType &type) uint8_t type_; uint8_t cs_level_; // collation level uint8_t cs_type_; // collation type - int8_t scale_; // scale, 当type_ 为ObBitType时,该字段存储bit的length + int8_t scale_; // scale, when type_ is ObBitType, this field stores the length of bit */ if (OB_FAIL(obj_meta.push_back(int8_type))) { LOG_WARN("push_back error", K(ret)); @@ -452,7 +456,7 @@ int ObPLADTService::get_unwind_exception(ObLLVMType &type) _Unwind_Word private_1; _Unwind_Word private_2; */ - //只映射第一项exception_class + //Only map the first item exception_class ObLLVMType int64_type; if (OB_FAIL(helper_.get_llvm_type(ObIntType, int64_type))) { LOG_WARN("failed to get_llvm_type", K(ret)); @@ -566,9 +570,9 @@ int ObPLADTService::get_seg_pointer_array(jit::ObLLVMType &type) T *data_; int64_t count_; char local_data_buf_[LOCAL_ARRAY_SIZE * sizeof(T)]; - int64_t block_size_; // 申请内存的块单位 - int64_t capacity_; // 标记ObSEArray的内部可用空间 - int64_t max_print_count_; //表示最大需要打印的元素数量; + int64_t block_size_; // memory block unit for allocation + int64_t capacity_; // marks the internal available space of ObSEArray + int64_t max_print_count_; // indicates the maximum number of elements to be printed; int32_t error_; // ObWrapperAllocator block_allocator_; bool has_alloc_; diff --git a/src/pl/ob_pl_adt_service.h b/src/pl/ob_pl_adt_service.h index 1b1d87507..52f3c1bba 100644 --- a/src/pl/ob_pl_adt_service.h +++ b/src/pl/ob_pl_adt_service.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SRC_PL_OB_PL_ADT_SERVICE_H_ diff --git a/src/pl/ob_pl_allocator.cpp b/src/pl/ob_pl_allocator.cpp index 462e68f77..89aae66bd 100644 --- a/src/pl/ob_pl_allocator.cpp +++ b/src/pl/ob_pl_allocator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL diff --git a/src/pl/ob_pl_allocator.h b/src/pl/ob_pl_allocator.h index 0b072a46e..9e0fb31ff 100644 --- a/src/pl/ob_pl_allocator.h +++ b/src/pl/ob_pl_allocator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef PL_MOD_DEF diff --git a/src/pl/ob_pl_code_generator.cpp b/src/pl/ob_pl_code_generator.cpp index f1241ab0f..efa86a646 100644 --- a/src/pl/ob_pl_code_generator.cpp +++ b/src/pl/ob_pl_code_generator.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL @@ -41,7 +45,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLStmtBlock &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(generator_.get_helper().set_insert_point(generator_.get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else if (OB_FAIL(generator_.generate_goto_label(s))) { @@ -71,13 +75,13 @@ int ObPLCodeGenerateVisitor::visit(const ObPLStmtBlock &s) } else { /*do nothing*/ } } if (OB_SUCC(ret)) { - if (s.has_eh()) { //如果有eh,跳到eh的exit分支 + if (s.has_eh()) { //if there is an eh, jump to the exit branch of eh if (NULL != generator_.get_current_exception()->exit_.get_v()) { if (OB_FAIL(generator_.finish_current(generator_.get_current_exception()->exit_))) { LOG_WARN("failed to finish current", K(s.get_stmts()), K(ret)); } else if (NULL != exit.get_v()) { if (generator_.get_current_exception()->exit_.get_v() == generator_.get_exit().get_v()) { - //exit是终点,不再跳转 + //exit is the endpoint, no further jumps } else if (OB_FAIL(generator_.get_helper().set_insert_point(generator_.get_current_exception()->exit_))) { LOG_WARN("failed to set insert point", K(ret)); } else if (OB_FAIL(generator_.get_helper().create_br(exit))) { @@ -95,7 +99,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLStmtBlock &s) LOG_WARN("failed to reset exception", K(ret)); } } - } else if (NULL != exit.get_v()) { //如果没有eh,调到BLOCK自己的exit分支 + } else if (NULL != exit.get_v()) { // If there is no eh, jump to the exit branch of BLOCK itself if (NULL == generator_.get_current().get_v()) { // do nothing... } else if (OB_FAIL(generator_.get_helper().create_br(exit))) { @@ -113,8 +117,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLStmtBlock &s) } } } - - //释放内存 + //release memory if (OB_SUCC(ret) && NULL != generator_.get_current().get_v()) { // close cursor for (int64_t i = 0; OB_SUCC(ret) && i < s.get_namespace().get_cursors().count(); ++i) { @@ -130,7 +133,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareUserTypeStmt &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(generator_.get_helper().set_insert_point(generator_.get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else { @@ -149,7 +152,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareVarStmt &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else { OZ (generator_.get_helper().set_insert_point(generator_.get_current())); OZ (generator_.generate_spi_pl_profiler_before_record(s)); @@ -166,7 +169,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareVarStmt &s) if (OB_SUCC(ret)) { if (var->get_type().is_obj_type()) { // do nothing - } else { // Record和Collection的内存不在栈上申请, 统一在Allocator中申请, 执行结束后统一释放 + } else { // Record and Collection memory is not allocated on the stack, it is uniformly allocated in Allocator and released after execution ends ObSEArray args; ObLLVMValue var_idx, init_value, var_value, extend_value; ObLLVMValue ret_err; @@ -174,7 +177,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareVarStmt &s) ObLLVMValue null_int; int64_t init_size = 0; is_complex_type_var = true; - // Step 1: 初始化内存 + // Step 1: Initialize memory CK (OB_NOT_NULL(s.get_namespace())); OZ (args.push_back(generator_.get_vars().at(generator_.CTX_IDX))); OZ (generator_.get_helper().get_int8(var->get_type().get_type(), var_type)); @@ -196,7 +199,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareVarStmt &s) OZ (generator_.check_success(ret_err, s.get_stmt_id(), s.get_block()->in_notfound(), s.get_block()->in_warning())); - // Step 2: 初始化类型内容, 如Collection的rowsize,element type等 + // Step 2: Initialize type content, such as Collection's rowsize, element type, etc. if (OB_SUCC(ret) && !var->get_type().is_opaque_type()) { OZ (generator_.extract_objparam_from_context( generator_.get_vars().at(generator_.CTX_IDX), @@ -215,7 +218,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareVarStmt &s) } #endif } - // Step 3: 默认值是构造函数,调用构造函数的初始化 + // Step 3: The default value is the constructor, calling the constructor for initialization if (OB_SUCC(ret) && var->get_type().is_collection_type() && PL_CONSTRUCT_COLLECTION == s.get_default()) { @@ -231,7 +234,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareVarStmt &s) } } } - // 处理变量默认值 + // Handle variable default values if (OB_SUCC(ret) && OB_INVALID_INDEX != s.get_default() && PL_CONSTRUCT_COLLECTION != s.get_default()) { @@ -245,8 +248,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareVarStmt &s) is_complex_type_var ? OB_INVALID_ID : s.get_index(0), p_result_obj)); CK (OB_NOT_NULL(s.get_default_expr())); - - // 检查notnull约束 + // check notnull constraint CK (OB_NOT_NULL(s.get_var(0))); OZ (generator_.generate_check_not_null(s, s.get_var(0)->is_not_null(), p_result_obj)); @@ -258,7 +260,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareVarStmt &s) for (int64_t i = 0; OB_SUCC(ret) && i < s.get_index().count(); ++i) { const ObPLVar *var = s.get_var(i); CK (OB_NOT_NULL(var)); - // 将默认值存储到paramstore, 第0个变量已经在generate_expr处理过了 + // Store the default value to paramstore, the 0th variable has already been processed in generate_expr if (OB_SUCC(ret) && (is_complex_type_var || 0 != i)) { ObLLVMValue into_meta_p, ori_meta_p, ori_meta; ObLLVMValue into_accuracy_p, ori_accuracy_p, ori_accuracy; @@ -301,9 +303,9 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareVarStmt &s) NULL != s.get_symbol_table()->get_symbol(const_expr->get_value().get_unknown())->get_pl_data_type().get_data_type() && ObNullType == s.get_symbol_table()->get_symbol(const_expr->get_value().get_unknown())->get_pl_data_type().get_data_type()->get_obj_type())) { /* - * allocator可以是null,因为这儿只是修改原复杂类型的属性信息 - * 对于record来说把内部的元素初始化成一个null, - * 对于collection来说把count改为-1标记为未初始化状态 + * allocator can be null, because here we are only modifying the property information of the original complex type + * For record, initialize the internal elements to null, + * For collection, change count to -1 to mark it as uninitialized state */ OZ (generator_.extract_extend_from_objparam(into_obj, var->get_type(), @@ -381,14 +383,14 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareVarStmt &s) } /***************************************************************************************/ -/* 注意:以下是内存排列有关的代码,修改这里一定要十分理解各种数据类型在LLVM端和SQL端的内存排列和生命周期。 - * 如有问题请联系如颠ryan.ly +/* Note: The following code is related to memory layout, any modifications here must be done with a thorough understanding of the memory layout and lifecycle of various data types on the LLVM side and SQL side. + * For any issues, please contact Ruyan ly ***************************************************************************************/ int ObPLCodeGenerateVisitor::visit(const ObPLAssignStmt &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(generator_.get_helper().set_insert_point(generator_.get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else if (s.get_into().count() != s.get_value().count()) { @@ -471,24 +473,24 @@ int ObPLCodeGenerateVisitor::visit(const ObPLAssignStmt &s) || (ObObjAccessIdx::IS_PKG != alloc_scop)) { alloc_scop = ObObjAccessIdx::IS_LOCAL; } - if (OB_SUCC(ret) && ObObjAccessIdx::IS_PKG == alloc_scop) { // 如果是Package变量, 记录下PackageId + if (OB_SUCC(ret) && ObObjAccessIdx::IS_PKG == alloc_scop) { // If it is a Package variable, record the PackageId OZ (ObObjAccessIdx::get_package_id(into_expr, package_id, &var_idx)); } if (OB_SUCC(ret)) { - //如果是LOCAL,使用运行时语句级allocator + //If it is LOCAL, use the runtime statement-level allocator if (ObObjAccessIdx::IS_LOCAL == alloc_scop) { /* - * 如果不是Collection,原则上应该进一步向上找到母体Collection的allocator,这样太复杂了,我们放弃这么做,直接用生命周期更长的运行时语句级allocator - * 这样的后果是:Collection里的string和number类型数据有的是在NestedTable自己的allocator里,有的不是。 - * 这其实没有问题,基础数据类型不会占用过多内存,而且语句级内存最终会释放,不会泄漏。 + * If it is not a Collection, in principle, we should further find the allocator of the parent Collection, but this is too complicated, so we abandon this approach and directly use the longer-lived runtime statement-level allocator. + * The consequence of this is that string and number type data within the Collection may be allocated in NestedTable's own allocator, and some may not. + * This is actually fine, as basic data types do not consume a lot of memory, and statement-level memory will eventually be released and will not leak. */ if (OB_FAIL(generator_.extract_allocator_from_context(generator_.get_vars().at(generator_.CTX_IDX), allocator))) { LOG_WARN("Failed to extract_allocator_from_nestedtable", K(*into_expr), K(ret)); } } else { - //如果不是LOCAL,那么一定是PKG或者是INVALID,传入NULL allocator; - //对于PKG, 由SPI根据package_id从Session上获取对应PackageState上的Allocator; - if (OB_FAIL(generator_.generate_null(ObIntType, allocator))) { //初始化一个空的allocator + //If not LOCAL, then it must be PKG or INVALID, pass in NULL allocator; + //For PKG, by SPI get the corresponding Allocator from PackageState on Session based on package_id; + if (OB_FAIL(generator_.generate_null(ObIntType, allocator))) { // initialize an empty allocator LOG_WARN("Failed to extract_allocator_from_nestedtable", K(*into_expr), K(ret)); } } @@ -496,19 +498,19 @@ int ObPLCodeGenerateVisitor::visit(const ObPLAssignStmt &s) if (OB_SUCC(ret)) { /** - * 分三种情况讨论: - * 1、Local变量 - * a、原生基本数据类型(不在母结构中的基本数据类型,通过Question Mark访问):直接找到该变量调用create store,同时需要修改param_store里的值(对于string和number也是如此,指针指向同一份内存) - * b、结构中的基本数据类型(在Record或Collection里中的基本数据类型,通过ObjAccess访问):直接找到该变量的地址调用create store或者调用COPY,不必修改param_store里的值(对于string和number也是如此,指针指向同一份内存) - * 注意: 为什么不全部直接调用COPY函数?————其实全部直接调COPY函数代码更简洁,考虑到大多数情况下不需要内存深拷贝,直接create store性能更好。 - * 这样会造成一种可能性:NestedTable里的string和number类型数据有的是在Collection自己的allocator里,有的不是。————这其实不一定有问题,只要目的端数据的内存生命周期比源端长就可以。 - * c、集合数据类型(通过ObjAccess访问):调用该类型的COPY函数,其COPY函数递归进行子域的COPY,不必修改param_store里的值 - * 注意: NestedTable的数据域的结构内存是自身的allocator_分配的,同时String/Number指针指向的内存也是。 - * copy之后的Collection同样也是这样。如果有母子关系,Collection的allocator_也相互独立,没有任何所属关系。 - * 2、PKG变量 - * PKG变量只能通过通过ObjAccess访问访问,同1.b和1.c - * 3、USER/SYS变量 - * 通过SPI直接赋值。 + * Discuss in three cases: + * 1、Local variable + * a、Native basic data type (basic data types not in the parent structure, accessed via Question Mark): Directly find this variable and call create store, at the same time, modify the value in param_store (this is also true for string and number, as pointers point to the same memory) + * b、Basic data type in structure (basic data types in Record or Collection, accessed via ObjAccess): Directly find the address of this variable and call create store or call COPY, no need to modify the value in param_store (this is also true for string and number, as pointers point to the same memory) + * Note: Why not directly call the COPY function for all? ———— Actually, directly calling the COPY function for all would make the code simpler, considering that deep copying of memory is not needed in most cases, directly calling create store performs better. + * This could lead to a possibility: String and number type data in NestedTable may be in Collection's own allocator, or not. ———— This is not necessarily a problem, as long as the memory lifecycle of the destination data is longer than the source. + * c、Collection data type (accessed via ObjAccess): Call the COPY function of this type, its COPY function recursively copies sub-domains, no need to modify the value in param_store + * Note: The structure memory of NestedTable's data domain is allocated by its own allocator_, and the memory pointed to by String/Number pointers is also. + * The copied Collection is the same. If there is a parent-child relationship, Collection's allocator_ are independent of each other, with no ownership relationship. + * 2、PKG variable + * PKG variables can only be accessed via ObjAccess, same as 1.b and 1.c + * 3、USER/SYS variable + * Directly assign values via SPI. * */ if (into_expr->is_const_raw_expr()) { //Local Basic Variables const ObConstRawExpr *const_expr = static_cast(into_expr); @@ -554,7 +556,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLAssignStmt &s) package_id)); } } - // 处理Nocopy参数 + // Handle Nocopy parameter if (OB_SUCC(ret) && generator_.get_param_size() > 0) { ObSEArray args; ObLLVMValue ret_err; @@ -617,7 +619,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLAssignStmt &s) s.get_block()->in_warning(), package_id)); } else { - // 设置复杂类型的ID + // Set the ID of complex type ObLLVMValue dest; ObLLVMValue src; OZ (generator_.extract_accuracy_ptr_from_objparam(into_address, dest)); @@ -625,7 +627,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLAssignStmt &s) OZ (generator_.get_helper().create_store(src, dest)); if (OB_FAIL(ret)) { - } else if (PL_CONSTRUCT_COLLECTION == s.get_value_index(i)){//右值是个数组的构造函数走SPI初始化函数 + } else if (PL_CONSTRUCT_COLLECTION == s.get_value_index(i)){//The right value is a constructor of an array, go through the SPI initialization function} ObSEArray args; ObLLVMValue ret_err; ObLLVMValue v_package_id; @@ -646,9 +648,9 @@ int ObPLCodeGenerateVisitor::visit(const ObPLAssignStmt &s) final_type, dest_datum)); CK (OB_NOT_NULL(value_expr)); - // 这儿的dest_datum不一定是一个复杂类型,它可能是一个null - // 如 rec := null这样的赋值,这个时候如果extract_extend,结果的类型其实是错误的。 - // 所以这儿需要区分一下。 + // Here, dest_datum may not be a complex type; it could be a null + // Like rec := null such assignment, at this time if extract_extend, the type of the result is actually incorrect. + // So here we need to distinguish between them. if (OB_FAIL(ret)) { } else if (T_NULL == value_expr->get_expr_type()) { OZ (final_type.generate_assign_with_null(generator_, @@ -714,7 +716,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLIfStmt &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(generator_.get_helper().set_insert_point(generator_.get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else if (OB_FAIL(generator_.generate_goto_label(s))) { @@ -815,7 +817,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLWhileStmt &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(generator_.get_helper().set_insert_point(generator_.get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else if (OB_FAIL(generator_.generate_goto_label(s))) { @@ -918,7 +920,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLRepeatStmt &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(generator_.get_helper().set_insert_point(generator_.get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else if (OB_FAIL(generator_.generate_goto_label(s))) { @@ -997,7 +999,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLLoopStmt &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(generator_.get_helper().set_insert_point(generator_.get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else if (OB_FAIL(generator_.generate_goto_label(s))) { @@ -1062,7 +1064,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLReturnStmt &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(generator_.get_helper().set_insert_point(generator_.get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else if (OB_FAIL(generator_.generate_goto_label(s))) { @@ -1150,7 +1152,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLReturnStmt &s) int64_t init_size = 0; if (OB_FAIL(ret)) { } else if (generator_.get_ast().get_ret_type().is_composite_type()) { - // Step 1: 初始化内存 + // Step 1: Initialize memory CK (OB_NOT_NULL(s.get_namespace())); OZ (generator_.extract_allocator_from_context(generator_.get_vars().at(generator_.CTX_IDX), allocator)); OZ (args.push_back(generator_.get_vars().at(generator_.CTX_IDX))); @@ -1180,7 +1182,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLReturnStmt &s) OZ (generator_.generate_set_extend(p_obj, var_type, init_value, extend_value)); OZ (generator_.extract_obobj_from_objparam(p_result_obj, result)); OZ (generator_.get_helper().create_store(result, p_result)); - // Step 2: 初始化类型内容, 如Collection的rowsize,element type等 + // Step 2: Initialize type content, such as Collection's rowsize, element type, etc. OZ (generator_.get_llvm_type(*user_type, ir_type)); OZ (ir_type.get_pointer_to(ir_ptr_type)); OZ (generator_.get_helper().create_int_to_ptr(ObString("cast_extend_to_ptr"), extend_value, ir_ptr_type, composite_ptr)); @@ -1208,9 +1210,9 @@ int ObPLCodeGenerateVisitor::visit(const ObPLReturnStmt &s) OZ (args.push_back(generator_.get_vars()[generator_.CTX_IDX])); OZ (args.push_back(p_result)); OZ (args.push_back(addend)); - // 这儿为啥需要对ref count +1, 因为一个被return的ref cursor,在函数block结束的时候,会被dec ref - // 那么这个时候可能会减到0, 从而导致这个被return的ref cursor被close了。 - // 这个+1,在ob_expr_udf那儿会对这个ref cursor -1进行平衡操作。 + // Why is ref count +1 needed here, because a returned ref cursor will be dec ref when the function block ends + // Then it might be reduced to 0, thus causing the ref cursor being returned to be closed. + // This +1 will be balanced by a -1 operation on this ref cursor at ob_expr_udf. OZ (generator_.get_helper().create_call(ObString("spi_add_ref_cursor_refcount"), generator_.get_spi_service().spi_add_ref_cursor_refcount_, args, @@ -1245,7 +1247,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLSqlStmt &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - // 控制流已断,后面的语句不再处理 + // Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(generator_.generate_goto_label(s))) { LOG_WARN("failed to generate goto label", K(ret)); } else { @@ -1262,7 +1264,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLExecuteStmt &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else { ObLLVMType int_type; ObLLVMValue null_pointer; @@ -1290,11 +1292,11 @@ int ObPLCodeGenerateVisitor::visit(const ObPLExecuteStmt &s) OZ (generator_.get_helper().get_llvm_type(ObIntType, int_type)); OZ (generator_.generate_null_pointer(ObIntType, null_pointer)); - OZ (args.push_back(generator_.get_vars().at(generator_.CTX_IDX))); //PL的执行环境 + OZ (args.push_back(generator_.get_vars().at(generator_.CTX_IDX))); // Execution environment of PL /* - * 为什么sql和using同样都是表达式,sql直接传rawexpr,而using调用generate_expr传入obobjparam??? - * 这是因为直接传rawexpr,由spi_execute_immediate进行计算会省掉一次spi交互。 - * 而using不仅是传入参数,还可以做传出参数,所以必须用obobjparam向外传递结果。 + * Why are sql and using both expressions, but sql directly passes rawexpr, while using calls generate_expr to pass obobjparam??? + * This is because directly passing rawexpr and having spi_execute_immediate perform the calculation saves one spi interaction. + * However, using not only passes parameters but can also be used for output parameters, so obobjparam must be used to pass the result outward. */ OZ (generator_.get_helper().get_int64(s.get_sql(), sql_idx)); OZ (args.push_back(sql_idx)); @@ -1420,7 +1422,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLExecuteStmt &s) OZ (generator_.add_out_params(p_result_obj)); OZ (generator_.extract_obobj_ptr_from_objparam(p_result_obj, dest_datum)); OZ (generator_.extract_obobj_ptr_from_objparam(address, src_datum)); - // 这里用blcok级别的allocator + // Here we use block-level allocator OZ (final_type.generate_copy(generator_, *s.get_namespace(), allocator, @@ -1509,7 +1511,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareHandlerStmt &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(generator_.get_helper().set_insert_point(generator_.get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else if (OB_FAIL(generator_.generate_goto_label(s))) { @@ -1733,7 +1735,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareHandlerStmt &s) } else { /*do nothing*/ } if (OB_SUCC(ret)) { - //定义resume出口和exit出口 + //Define resume exit and exit exit ObLLVMBasicBlock resume_handler; ObLLVMBasicBlock exit_handler; @@ -1763,16 +1765,16 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareHandlerStmt &s) } /* - * 如果捕捉到了该exception,处理完body后,视handler的ACTION和level决定下一个目的地: - * EXIT:跳出当前block - * CONTINUE:跳到抛出exception的语句的下一句 - * 我们对Handler做了改写,所以这里的逻辑是: - * 原生EXIT:跳出当前block - * 下降的CONTINUE:跳出当前block - * 下降的EXIT:继续向上抛 + * If this exception is caught, after processing the body, determine the next destination based on the handler's ACTION and level: + * EXIT: exit the current block + * CONTINUE: jump to the statement following the one that threw the exception + * We have rewritten the Handler, so the logic here is: + * Native EXIT: exit the current block + * Descending CONTINUE: exit the current block + * Descending EXIT: continue to throw upwards */ if (OB_SUCC(ret)) { - if (NULL == s.get_handler(i).get_desc()->get_body() || (s.get_handler(i).get_desc()->is_exit() && !s.get_handler(i).is_original())) { //下降的EXIT,不执行body + if (NULL == s.get_handler(i).get_desc()->get_body() || (s.get_handler(i).get_desc()->is_exit() && !s.get_handler(i).is_original())) { // descending EXIT, do not execute body if (OB_FAIL(generator_.get_helper().set_insert_point(case_branch))) { LOG_WARN("failed to set_insert_point", K(ret)); } else if (OB_FAIL(generator_.get_helper().create_br(s.get_handler(i).get_desc()->is_exit() && !s.get_handler(i).is_original() ? resume_handler : exit_handler))) { @@ -1800,8 +1802,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareHandlerStmt &s) OZ (generator_.extract_status_from_context(generator_.get_vars().at(generator_.CTX_IDX), p_status)); OZ (generator_.get_helper().create_load(ObString("load status"), p_status, status)); OZ (generator_.get_helper().create_store(int_value, p_status)); - - // 记录下当前捕获到的ObError, 用于设置再次抛出该异常时设置status + // Record the current captured ObError, used for setting the status when rethrowing this exception OX (old_ob_error = generator_.get_saved_ob_error()); OX (generator_.get_saved_ob_error() = status); @@ -1812,12 +1813,10 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareHandlerStmt &s) OZ (generator_.get_helper().create_call(ObString("spi_get_pl_exception_code"), generator_.get_spi_service().spi_get_pl_exception_code_, args, result)); OZ (generator_.check_success(result, s.get_stmt_id(), s.get_block()->in_notfound(), s.get_block()->in_warning())); OZ (generator_.get_helper().create_load(ObString("old_sqlcode"), p_old_sqlcode, old_code)); - - // 记录下当前捕获到的Exception, 用于SIGNAL语句抛出当前异常 + // Record the current captured Exception for throwing the current exception with a SIGNAL statement OX (old_exception = generator_.get_saved_exception()); OX (generator_.get_saved_exception() = unwindException); - - // 设置当前ExceptionCode到SQLCODE + // Set current ExceptionCode to SQLCODE OX (args.reset()); // OZ (generator_.get_helper().get_llvm_type(ObIntType, int_type)); // OZ (generator_.get_helper().create_alloca(ObString("level"), int_type, p_level)); @@ -1831,7 +1830,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareHandlerStmt &s) OZ (generator_.check_success(result, s.get_stmt_id(), s.get_block()->in_notfound(), s.get_block()->in_warning())); /* - // Check当前是否是嵌套事务的ExceptionHandler, 失效掉嵌套事务内部的Exception Handler + // Check if the current is the ExceptionHandler of a nested transaction, invalidate the Exception Handler inside the nested transaction OX (args.reset()); OZ (args.push_back(generator_.get_vars().at(generator_.CTX_IDX))); OZ (args.push_back(code)); @@ -1846,15 +1845,12 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareHandlerStmt &s) s.get_block()->in_notfound(), s.get_block()->in_warning())); */ - - // Codegen当前Handler的Body + // Codegen current Handler's Body OZ (SMART_CALL(generate(*s.get_handler(i).get_desc()->get_body()))); - - // 恢复原来的Exception + // Restore the original Exception OX (generator_.get_saved_exception() = old_exception); OX (generator_.get_saved_ob_error() = old_ob_error); - - // 恢复原来的SQLCODE + // Restore the original SQLCODE if (OB_SUCC(ret) && OB_NOT_NULL(generator_.get_current().get_v())) { if (OB_ISNULL(old_exception.get_v())) { @@ -1881,7 +1877,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareHandlerStmt &s) OZ (generator_.get_helper().create_call(ObString("spi_set_pl_exception_code"), generator_.get_spi_service().spi_set_pl_exception_code_, args, result)); OZ (generator_.check_success(result, s.get_stmt_id(), s.get_block()->in_notfound(), s.get_block()->in_warning())); } - OZ (generator_.finish_current(s.get_handler(i).get_desc()->is_exit() && !s.get_handler(i).is_original() ? resume_handler : exit_handler)); //下降的EXIT才抛出 + OZ (generator_.finish_current(s.get_handler(i).get_desc()->is_exit() && !s.get_handler(i).is_original() ? resume_handler : exit_handler)); // Throw only for EXIT that is descending OZ (generator_.set_current(current)); } } @@ -1893,7 +1889,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDeclareHandlerStmt &s) ObLLVMType unwind_exception_pointer_type; if (OB_FAIL(generator_.set_exception(exception, exit_handler, - s.get_level()))) { //这里才可以压栈exception + s.get_level()))) { //Here stack exception is allowed LOG_WARN("failed to set_exception", K(ret)); } else if (OB_FAIL(generator_.get_helper().set_insert_point(resume_handler))) { LOG_WARN("failed to set_insert_point", K(ret)); @@ -1940,7 +1936,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLSignalStmt &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else { OZ (generator_.get_helper().set_insert_point(generator_.get_current())); OZ (generator_.generate_goto_label(s)); @@ -2053,7 +2049,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLSignalStmt &s) OZ (generator_.get_helper().create_block(ObString("normal"), generator_.get_func(), normal)); OZ (generator_.generate_global_string(ObString(s.get_str_len(), s.get_sql_state()), sql_state, str_len)); OZ (generator_.get_helper().get_int64(s.get_stmt_id(), stmt_id)); - // 暂时先用stmtid, 这个id就是col和line的组合 + // Temporarily use stmtid, this id is the combination of col and line OZ (generator_.get_helper().get_int64(s.get_stmt_id(), loc)); OZ (generator_.generate_destruct_out_params()); OZ (generator_.generate_exception(type, ob_err_code, err_code, sql_state, str_len, stmt_id, @@ -2069,7 +2065,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLCallStmt &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(generator_.get_helper().set_insert_point(generator_.get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else if (OB_FAIL(generator_.generate_goto_label(s))) { @@ -2087,7 +2083,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLCallStmt &s) LOG_WARN("failed to get_argv_array_buffer", K(ret)); } else { for (int64_t i = 0; OB_SUCC(ret) && i < s.get_params().count(); ++i) { - // 传递入参 + // pass in parameters ObLLVMValue p_result_obj; if (s.is_pure_out(i)) { const ObPLVar *var = @@ -2109,7 +2105,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLCallStmt &s) if (OB_SUCC(ret) && OB_NOT_NULL(pl_type) && pl_type->is_composite_type() - && !pl_type->is_opaque_type()) { // 普通类型构造空的ObjParam即可,复杂类型需要构造对应的指针 + && !pl_type->is_opaque_type()) { // Ordinary type can construct an empty ObjParam, complex types need to construct the corresponding pointer ObLLVMType ir_type, ir_ptr_type; ObLLVMValue var_idx, init_value, extend_ptr, extend_value, composite_ptr, p_obj; ObLLVMValue ret_err; @@ -2297,24 +2293,24 @@ int ObPLCodeGenerateVisitor::visit(const ObPLCallStmt &s) ObLLVMValue array_value; ObLLVMValue nocopy_array_value; uint64_t package_id = s.get_package_id(); - if (OB_FAIL(args.push_back(generator_.get_vars().at(generator_.CTX_IDX)))) { //PL的执行环境 + if (OB_FAIL(args.push_back(generator_.get_vars().at(generator_.CTX_IDX)))) { // Execution environment of PL LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(generator_.get_helper().get_int64(package_id, int_value))) { LOG_WARN("failed to get int64", K(ret)); - } else if (OB_FAIL(args.push_back(int_value))) { //PL的package id + } else if (OB_FAIL(args.push_back(int_value))) { // PL's package id LOG_WARN("push_back error", K(ret)); }else if (OB_FAIL(generator_.get_helper().get_int64(s.get_proc_id(), int_value))) { LOG_WARN("failed to get int64", K(ret)); - } else if (OB_FAIL(args.push_back(int_value))) { //PL的proc id + } else if (OB_FAIL(args.push_back(int_value))) { // PL's proc id LOG_WARN("push_back error", K(ret)); }else if (OB_FAIL(generator_.generate_int64_array(s.get_subprogram_path(), array_value))) { LOG_WARN("failed to get int64", K(ret)); - } else if (OB_FAIL(args.push_back(array_value))) { //PL的subprogram path + } else if (OB_FAIL(args.push_back(array_value))) { // PL's subprogram path LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(generator_.get_helper().get_int64(s.get_subprogram_path().count(), int_value))) { LOG_WARN("failed to get int64", K(ret)); - } else if (OB_FAIL(args.push_back(int_value))) { //subprogram path长度 + } else if (OB_FAIL(args.push_back(int_value))) { // subprogram path length LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(generator_.get_helper().get_int64(static_cast(s.get_stmt_id()), int_value))) { LOG_WARN("failed to get int64", K(ret)); @@ -2335,7 +2331,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLCallStmt &s) LOG_WARN("failed to push back", K(ret)); } else if (OB_FAIL(generator_.get_helper().get_int64(OB_INVALID_ID, int_value))) { LOG_WARN("failed to get int64", K(ret)); - } else if (OB_FAIL(args.push_back(int_value))) { //PL的dblink id + } else if (OB_FAIL(args.push_back(int_value))) { // PL's dblink id LOG_WARN("push_back error", K(ret)); } else { ObLLVMValue result; @@ -2400,7 +2396,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLFetchStmt &s) int ret = OB_SUCCESS; ObLLVMValue ret_err; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else { OZ (generator_.generate_update_location(s)); OZ (generator_.generate_goto_label(s)); @@ -2417,10 +2413,10 @@ int ObPLCodeGenerateVisitor::visit(const ObPLFetchStmt &s) s.get_user_type(), ret_err))) { LOG_WARN("failed to generate fetch", K(ret)); - } else if (lib::is_mysql_mode()) { //Mysql模式直接检查抛出异常 + } else if (lib::is_mysql_mode()) { //MySQL mode directly check and throw exception OZ (generator_.check_success( ret_err, s.get_stmt_id(), s.get_block()->in_notfound(), s.get_block()->in_warning(), true)); - } else { //Oracle模式如果是OB_READ_NOTHING错误,吞掉异常不抛出 + } else { // Oracle mode if it is an OB_READ_NOTHING error, swallow the exception and do not throw it ObLLVMValue is_not_found; ObLLVMBasicBlock fetch_end; ObLLVMBasicBlock fetch_check_success; @@ -2477,7 +2473,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLNullStmt &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(generator_.generate_goto_label(s))) { LOG_WARN("failed to generate goto label", K(ret)); } else if (OB_FAIL(generator_.generate_spi_pl_profiler_before_record(s))) { @@ -2516,7 +2512,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLDoStmt &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(generator_.get_helper().set_insert_point(generator_.get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else if (OB_FAIL(generator_.generate_goto_label(s))) { @@ -2542,7 +2538,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLCaseStmt &s) { int ret = OB_SUCCESS; if (NULL == generator_.get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(generator_.get_helper().set_insert_point(generator_.get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else if (OB_FAIL(generator_.generate_goto_label(s))) { @@ -2858,7 +2854,7 @@ int ObPLCodeGenerator::init() } else { /*do nothing*/ } if (OB_SUCC(ret)) { - if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { //函数第一个参数必须是基础环境信息隐藏参数 + if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { // The first argument of the function must be a hidden parameter of the basic environment information LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(arg_types.push_back(int64_type))) { //uint64_t package id LOG_WARN("push_back error", K(ret)); @@ -2888,7 +2884,7 @@ int ObPLCodeGenerator::init() //declare user type var addr if (OB_SUCC(ret)) { arg_types.reset(); - if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { //函数第一个参数必须是基础环境信息隐藏参数 + if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { //The first argument of the function must be a hidden parameter of the basic environment information LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(arg_types.push_back(int64_type))) { //int64_t var_index LOG_WARN("push_back error", K(ret)); @@ -2905,7 +2901,7 @@ int ObPLCodeGenerator::init() // declare set_implicit_in_forall if (OB_SUCC(ret)) { arg_types.reset(); - if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { //函数第一个参数必须是基础环境信息隐藏参数 + if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { // The first argument of the function must be a hidden parameter of the basic environment information LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(arg_types.push_back(bool_type))) { LOG_WARN("push_back error", K(ret)); @@ -2982,7 +2978,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { //函数第一个参数必须是基础环境信息隐藏参数 + if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { // The first argument of the function must be a hidden parameter of the basic environment information LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(arg_types.push_back(int64_type))) { LOG_WARN("push_back error", K(ret)); @@ -2999,7 +2995,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { //函数第一个参数必须是基础环境信息隐藏参数 + if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { // The first argument of the function must be a hidden parameter of the basic environment information LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(arg_types.push_back(int64_type))) { LOG_WARN("push_back error", K(ret)); @@ -3027,7 +3023,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { //函数第一个参数必须是基础环境信息隐藏参数 + if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { // The first argument of the function must be a hidden parameter of the basic environment information LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(arg_types.push_back(int64_type))) { LOG_WARN("push_back error", K(ret)); @@ -3044,7 +3040,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { //函数第一个参数必须是基础环境信息隐藏参数 + if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { // The first argument of the function must be a hidden parameter of the basic environment information LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(arg_types.push_back(char_type))) { LOG_WARN("push_back error", K(ret)); @@ -3094,7 +3090,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { //函数第一个参数必须是基础环境信息隐藏参数 + if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { // The first argument of the function must be a hidden parameter of the basic environment information LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(arg_types.push_back(char_type))) { LOG_WARN("push_back error", K(ret)); @@ -3133,7 +3129,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { //函数第一个参数必须是基础环境信息隐藏参数 + if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { // The first argument of the function must be a hidden parameter of the basic environment information LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(arg_types.push_back(int64_type))) { LOG_WARN("push_back error", K(ret)); @@ -3212,7 +3208,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - OZ (arg_types.push_back(pl_exec_context_pointer_type)); //函数第一个参数必须是基础环境信息隐藏参数 + OZ (arg_types.push_back(pl_exec_context_pointer_type)); // The first argument of the function must be a hidden parameter containing basic environment information OZ (arg_types.push_back(char_type)); //sql OZ (arg_types.push_back(char_type));//id OZ (arg_types.push_back(int64_type));//type @@ -3233,7 +3229,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - OZ (arg_types.push_back(pl_exec_context_pointer_type)); //函数第一个参数必须是基础环境信息隐藏参数 + OZ (arg_types.push_back(pl_exec_context_pointer_type)); // The first argument of the function must be a hidden parameter containing basic environment information OZ (arg_types.push_back(int64_type)); //sql_expr OZ (arg_types.push_back(int_pointer_type));//sql_param_exprs OZ (arg_types.push_back(int64_type));//sql_param_count @@ -3246,7 +3242,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - OZ (arg_types.push_back(pl_exec_context_pointer_type)); //函数第一个参数必须是基础环境信息隐藏参数 + OZ (arg_types.push_back(pl_exec_context_pointer_type)); // The first argument of the function must be a hidden parameter containing basic environment information OZ (arg_types.push_back(int64_type));//package_id OZ (arg_types.push_back(int64_type));//routine_id OZ (arg_types.push_back(int64_type));//cursor_index @@ -3267,7 +3263,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - OZ (arg_types.push_back(pl_exec_context_pointer_type)); //函数第一个参数必须是基础环境信息隐藏参数 + OZ (arg_types.push_back(pl_exec_context_pointer_type)); // The first argument of the function must be a hidden parameter containing basic environment information OZ (arg_types.push_back(int64_type));//package_id OZ (arg_types.push_back(int64_type));//routine_id OZ (arg_types.push_back(int64_type));//cursor_index @@ -3278,7 +3274,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { //函数第一个参数必须是基础环境信息隐藏参数 + if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { // The first argument of the function must be a hidden parameter of the basic environment information LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(arg_types.push_back(int64_type))) { LOG_WARN("push_back error", K(ret)); @@ -3306,7 +3302,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { // 函数第一个参数必须是基础环境信息隐藏参数 + if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { // The first argument of the function must be a hidden parameter of the basic environment information LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(arg_types.push_back(int64_type))) { //src expr index LOG_WARN("push_back error", K(ret)); @@ -3327,7 +3323,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - OZ (arg_types.push_back(pl_exec_context_pointer_type)); //函数第一个参数必须是基础环境信息隐藏参数 + OZ (arg_types.push_back(pl_exec_context_pointer_type)); // The first argument of the function must be a hidden parameter containing basic environment information OZ (arg_types.push_back(int64_type)); //allocator OZ (arg_types.push_back(obj_pointer_type)); //src OZ (arg_types.push_back(obj_pointer_type)); //dest @@ -3339,7 +3335,7 @@ int ObPLCodeGenerator::init_spi_service() } if (OB_SUCC(ret)) { arg_types.reset(); - OZ (arg_types.push_back(pl_exec_context_pointer_type)); //函数第一个参数必须是基础环境信息隐藏参数 + OZ (arg_types.push_back(pl_exec_context_pointer_type)); // The first argument of the function must be a hidden parameter containing basic environment information OZ (arg_types.push_back(int64_type)); // type info id OZ (arg_types.push_back(obj_pointer_type)); //src OZ (arg_types.push_back(obj_pointer_type)); //dest @@ -3348,7 +3344,7 @@ int ObPLCodeGenerator::init_spi_service() } if (OB_SUCC(ret)) { arg_types.reset(); - OZ (arg_types.push_back(pl_exec_context_pointer_type)); //函数第一个参数必须是基础环境信息隐藏参数 + OZ (arg_types.push_back(pl_exec_context_pointer_type)); // The first argument of the function must be a hidden parameter containing basic environment information OZ (arg_types.push_back(obj_pointer_type)); //src OZ (ObLLVMFunctionType::get(int32_type, arg_types, ft)); OZ (helper_.create_function(ObString("spi_destruct_obj"), ft, spi_service_.spi_destruct_obj_)); @@ -3356,7 +3352,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { //函数第一个参数必须是基础环境信息隐藏参数 + if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { // The first argument of the function must be a hidden parameter of the basic environment information LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(arg_types.push_back(int64_type))) { // error code LOG_WARN("push_back error", K(ret)); @@ -3420,7 +3416,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - OZ (arg_types.push_back(pl_exec_context_pointer_type)); //函数第一个参数必须是基础环境信息隐藏参数 + OZ (arg_types.push_back(pl_exec_context_pointer_type)); // The first argument of the function must be a hidden parameter containing basic environment information OZ (arg_types.push_back(obj_pointer_type)); // ref cursor OZ (arg_types.push_back(int64_type)); OZ (ObLLVMFunctionType::get(int32_type, arg_types, ft)); @@ -3428,7 +3424,7 @@ int ObPLCodeGenerator::init_spi_service() } if (OB_SUCC(ret)) { arg_types.reset(); - OZ (arg_types.push_back(pl_exec_context_pointer_type)); //函数第一个参数必须是基础环境信息隐藏参数 + OZ (arg_types.push_back(pl_exec_context_pointer_type)); // The first argument of the function must be a hidden parameter containing basic environment information OZ (arg_types.push_back(int64_type)); //package id OZ (arg_types.push_back(int64_type)); //routine id OZ (arg_types.push_back(int64_type)); //cursor index @@ -3481,7 +3477,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - OZ (arg_types.push_back(pl_exec_context_pointer_type)); // 函数第一个参数必须是基础环境信息隐藏参数 + OZ (arg_types.push_back(pl_exec_context_pointer_type)); // The first parameter of the function must be a hidden parameter containing basic environment information OZ (arg_types.push_back(int64_type)); // line OZ (arg_types.push_back(int64_type)); // level OZ (ObLLVMFunctionType::get(int32_type, arg_types, ft)); @@ -3513,7 +3509,7 @@ int ObPLCodeGenerator::init_spi_service() if (OB_SUCC(ret)) { arg_types.reset(); - OZ (arg_types.push_back(pl_exec_context_pointer_type)); // 函数第一个参数必须是基础环境信息隐藏参数 + OZ (arg_types.push_back(pl_exec_context_pointer_type)); // The first argument of the function must be a hidden parameter of the base environment information OZ (arg_types.push_back(int64_type)); // line OZ (arg_types.push_back(int64_type)); // level OZ (ObLLVMFunctionType::get(int32_type, arg_types, ft)); @@ -3793,7 +3789,7 @@ int ObPLCodeGenerator::generate_get_collection_attr(ObLLVMValue ¶m_array, { int ret = OB_SUCCESS; ObLLVMValue ret_value; - // 对于数组类型的访问, 需要确保其已经通过构造函数进行了初始化 + // For array type access, it is necessary to ensure that it has been initialized via the constructor ObLLVMValue is_inited, not_init_value, not_init; ObLLVMBasicBlock after_init_block, not_init_block; OZ (helper_.create_block(ObString("after_init_block"), func_, after_init_block)); @@ -3811,20 +3807,20 @@ int ObPLCodeGenerator::generate_get_collection_attr(ObLLVMValue ¶m_array, ObLLVMValue data_value; if (!current_access.is_property()) { - // 取出集合中元素的值ObCollection->data_ - // 当时获取Collection的固有属性时, 不需要这么做, 固有属性都存储在Collection本身上 + // Retrieve the value of elements in the collection ObCollection->data_ + // When obtaining the inherent properties of a Collection, this is not necessary, as inherent properties are stored on the Collection itself OZ (extract_data_from_collection(current_value, data_value)); } - // 获取下标或者固有属性在Collection中的位置信息 + // Get the index or intrinsic attribute position information in the Collection if (OB_SUCC(ret)) { ObLLVMValue element_idx; - // 常量, 直接Codegen掉 + // constant, directly Codegen it if (current_access.is_property()) { //do nothing } else if (current_access.is_const()) { OZ (helper_.get_int64(current_access.var_index_ - 1, element_idx)); } else { - // 非常量,那么首先用obj access中的var_index获取到变量的值,然后再获取element + // non-constant, then first use var_index from obj access to get the value of the variable, and then get the element ObLLVMValue element_idx_ptr; OZ (helper_.create_gep(ObString("param_value"), param_array, @@ -3834,7 +3830,7 @@ int ObPLCodeGenerator::generate_get_collection_attr(ObLLVMValue ¶m_array, OZ (helper_.create_dec(element_idx, element_idx)); } if (OB_SUCC(ret)) { - // 如果不是固有属性, 需要check下标的合法性, 避免访问越界 + // If it is not an inherent property, need to check the legality of the index to avoid out-of-bounds access if (!current_access.is_property()) { ObLLVMValue low, high_ptr, high, is_true; ObLLVMBasicBlock check_block, after_block, error_block; @@ -4004,10 +4000,10 @@ int ObPLCodeGenerator::generate_get_record_attr(const ObObjAccessIdx ¤t_ac int ObPLCodeGenerator::generate_get_attr(ObLLVMValue ¶m_array, const ObIArray &obj_access, bool for_write, - ObLLVMValue &value_ptr, // 读取的值 - ObLLVMValue &allocator_ptr, // 读取的allator - ObLLVMValue &ret_value_ptr, // 标识是否越界 - ObLLVMBasicBlock& exit, // 越界后需要跳转的BLOCK + ObLLVMValue &value_ptr, // read value + ObLLVMValue &allocator_ptr, // read the allocator + ObLLVMValue &ret_value_ptr, // Indicates whether out of bounds + ObLLVMBasicBlock& exit, // BLOCK to jump to after out-of-bounds const sql::ObRawExprResType &res_type) { int ret = OB_SUCCESS; @@ -4021,10 +4017,9 @@ int ObPLCodeGenerator::generate_get_attr(ObLLVMValue ¶m_array, CK (!obj_access.empty()); CK (obj_access.at(0).var_type_.is_composite_type() || obj_access.at(0).var_type_.is_cursor_type()); - - // 获取数据类型 + // Get data type OZ (helper_.get_llvm_type(ObIntType, int64_type)); - // 获取变量首地址 + // Get the starting address of the variable OZ (helper_.get_int32(OB_SUCCESS, ret_value)); OZ (helper_.create_store(ret_value, ret_value_ptr)); OZ (helper_.create_gep(ObString("param_value"), @@ -4032,7 +4027,7 @@ int ObPLCodeGenerator::generate_get_attr(ObLLVMValue ¶m_array, obj_access.at(0).var_index_, composite_addr)); OZ (helper_.create_load(ObString("element_idx"), composite_addr, composite_addr)); - // 逐级解析复杂数据类型 + // Gradually parse complex data types for (int64_t i = 1; OB_SUCC(ret) && i < obj_access.count(); ++i) { const ObPLDataType &parent_type = obj_access.at(i - 1).var_type_; OZ (user_type_map_.get_refactored(parent_type.get_user_type_id(), user_type), @@ -4043,7 +4038,7 @@ int ObPLCodeGenerator::generate_get_attr(ObLLVMValue ¶m_array, OX (value.set_t(user_type)); CK (!obj_access.at(i).is_invalid()); if (OB_SUCC(ret)) { - if (parent_type.is_collection_type()) { //数组类型 + if (parent_type.is_collection_type()) { //array type OZ (generate_get_collection_attr(param_array, obj_access.at(i), i, @@ -4054,7 +4049,7 @@ int ObPLCodeGenerator::generate_get_attr(ObLLVMValue ¶m_array, ret_value_ptr, exit, res_type)); - } else if (parent_type.is_record_type()) { //record类型 + } else if (parent_type.is_record_type()) { // record type OZ (generate_get_record_attr(obj_access.at(i), parent_type.get_user_type_id(), for_write, @@ -4107,12 +4102,12 @@ int ObPLCodeGenerator::generate_declare_cursor(const ObPLStmt &s, const int64_t { int ret = OB_SUCCESS; if (NULL == get_current().get_v()) { - // 控制流已断,后面的语句不再处理 + // Control flow is broken, subsequent statements will not be processed } else { const ObPLCursor *cursor = s.get_cursor(cursor_index); CK (OB_NOT_NULL(cursor)); CK (ObPLCursor::INVALID != cursor->get_state()); - if (OB_SUCC(ret) && ObPLCursor::DUP_DECL != cursor->get_state()) { //如果是无效的cursor跳过即可 + if (OB_SUCC(ret) && ObPLCursor::DUP_DECL != cursor->get_state()) { // If it is an invalid cursor, skip it. ObLLVMValue cursor_index_value; ObLLVMValue cursor_value; ObLLVMValue ret_err; @@ -4134,7 +4129,7 @@ int ObPLCodeGenerator::generate_open( { int ret = OB_SUCCESS; if (NULL == get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(get_helper().set_insert_point(get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else { @@ -4203,7 +4198,7 @@ int ObPLCodeGenerator::generate_fetch(const ObPLStmt &s, { int ret = OB_SUCCESS; if (NULL == get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(get_helper().set_insert_point(get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else { @@ -4307,7 +4302,7 @@ int ObPLCodeGenerator::generate_fetch(const ObPLStmt &s, if (OB_SUCC(ret)) { if (pl_data_type->is_obj_type()) { OZ (store_data_type(*(pl_data_type->get_data_type()), type_value)); - } else { // 构造函数场景 + } else { // constructor scenario ObDataType ext_type; ObObjMeta meta; meta.set_type(ObExtendType); @@ -4346,7 +4341,7 @@ int ObPLCodeGenerator::generate_close(const ObPLStmt &s, { int ret = OB_SUCCESS; if (NULL == get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(get_helper().set_insert_point(get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else { @@ -4425,7 +4420,7 @@ int ObPLCodeGenerator::generate_update_location(const ObPLStmt &s) { int ret = OB_SUCCESS; if (NULL == get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else { ObSEArray args; ObLLVMValue location; @@ -4444,7 +4439,7 @@ int ObPLCodeGenerator::generate_sql(const ObPLSqlStmt &s, ObLLVMValue &ret_err) { int ret = OB_SUCCESS; if (OB_ISNULL(get_current().get_v())) { - // 控制流已断,后面的语句不再处理 + // Control flow is broken, subsequent statements will not be processed } else { OZ (get_helper().set_insert_point(get_current())); OZ (generate_update_location(s)); @@ -4521,7 +4516,7 @@ int ObPLCodeGenerator::generate_sql(const ObPLSqlStmt &s, ObLLVMValue &ret_err) OZ (args.push_back(is_type_record)); OZ (args.push_back(for_update)); OZ (get_helper().create_call(ObString("spi_query_into_expr_idx"), get_spi_service().spi_query_into_expr_idx_, args, ret_err)); - } else { //有外部变量,走prepare/execute接口 + } else { //There are external variables, use the prepare/execute interface ObLLVMValue is_forall; OZ (get_helper().get_int8(static_cast(s.is_forall_sql()), is_forall)); OZ (args.push_back(is_forall)); @@ -4539,7 +4534,7 @@ int ObPLCodeGenerator::generate_after_sql(const ObPLSqlStmt &s, ObLLVMValue &ret { int ret = OB_SUCCESS; if (OB_ISNULL(get_current().get_v())) { - // 控制流已断, 后面的语句不再处理 + // Control flow is broken, subsequent statements will not be processed } else { OZ (check_success(ret_err, s.get_stmt_id(), s.get_block()->in_notfound(), s.get_block()->in_warning())); OZ (generate_into_restore(s.get_into(), s.get_exprs(), s.get_symbol_table())); @@ -5031,13 +5026,13 @@ int ObPLCodeGenerator::generate_spi_calc(int64_t expr_idx, if (OB_FAIL(ret)) { // do nothing - } else if (OB_FAIL(args.push_back(vars_.at(CTX_IDX)))) { //PL的执行环境 + } else if (OB_FAIL(args.push_back(vars_.at(CTX_IDX)))) { // Execution environment of PL LOG_WARN("push_back error", K(ret)); - } else if (OB_FAIL(args.push_back(expr_idx_val))) { //表达式的下标 + } else if (OB_FAIL(args.push_back(expr_idx_val))) { // index of the expression LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(helper_.get_int64(result_idx, int_value))) { LOG_WARN("failed to get int64", K(ret)); - } else if (OB_FAIL(args.push_back(int_value))) { //结果在ObArray里的位置 + } else if (OB_FAIL(args.push_back(int_value))) { // The position of the result in ObArray LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(args.push_back(p_result_obj))) { LOG_WARN("push_back error", K(ret)); @@ -5155,7 +5150,7 @@ int ObPLCodeGenerator::generate_compare_calc(ObLLVMValue &left, LOG_WARN("failed to create block", K(ret)); } else if (OB_FAIL(helper_.create_block(ObString("end_branch"), get_func(), end_branch))) { LOG_WARN("failed to create block", K(ret)); - } else if (OB_FAIL(helper_.create_icmp(left, right, compare_type, is_true))) { //这里的is_true是int1(1 bit),需要转成int8(8 bit) + } else if (OB_FAIL(helper_.create_icmp(left, right, compare_type, is_true))) { // here is_true is int1(1 bit), needs to be converted to int8(8 bit) LOG_WARN("failed to create_icmp_eq", K(ret)); } else if (OB_FAIL(helper_.create_cond_br(is_true, true_branch, false_branch))) { LOG_WARN("failed to create_cond_br", K(ret)); @@ -5219,7 +5214,7 @@ int ObPLCodeGenerator::generate_arith_calc(ObLLVMValue &left, LOG_WARN("Not supported yet", K(type), K(ret)); } - if (OB_SUCC(ret)) { //检查值域 + if (OB_SUCC(ret)) { // check value range ObLLVMBasicBlock succ_block; ObLLVMBasicBlock error_block; ObLLVMBasicBlock check_block; @@ -5272,7 +5267,7 @@ int ObPLCodeGenerator::generate_arith_calc(ObLLVMValue &left, if (OB_SUCC(ret)) { ObObjParam objparam; - objparam.set_type(result_type.get_type()); //计算之后的结果放在int32里 + objparam.set_type(result_type.get_type()); //The result after calculation is stored in int32 objparam.set_param_meta(); if (OB_FAIL(store_objparam(objparam, p_result_obj))) { LOG_WARN("Not supported yet", K(type), K(ret)); @@ -5331,9 +5326,9 @@ int ObPLCodeGenerator::generate_early_exit(ObLLVMValue &count, OZ (generate_debug(ObString("print count value"), count_value)); #endif /*! - * need_check和first_check不等说明需要check, 相等则不需要check - * 因为need_check和firstcheck不可能同时为true; 当同时为false时说明两个条件都没满足; 只有一个true时则说明满足一个条件; - * 引入first_check是为了避免类似下面的匿名块形成的死循环无法退出; + * need_check and first_check are not equal means check is needed, equal means no check is needed + * because need_check and first_check cannot be true at the same time; when both are false it means neither condition is met; only one being true means one condition is met; + * first_check is introduced to avoid infinite loops formed by anonymous blocks like the following; * BEGIN * <> * FOR idx IN 1..10 LOOP @@ -5341,20 +5336,18 @@ int ObPLCodeGenerator::generate_early_exit(ObLLVMValue &count, * END LOOP; * END; */ - OZ (helper_.create_icmp(count_value, EARLY_EXIT_CHECK_CNT, ObLLVMHelper::ICMP_SGE, need_check)); // 到达check次数 - OZ (helper_.create_icmp(count_value, 1, ObLLVMHelper::ICMP_EQ, first_check)); // 该值为1说明是循环的第一次check + OZ (helper_.create_icmp(count_value, EARLY_EXIT_CHECK_CNT, ObLLVMHelper::ICMP_SGE, need_check)); // Reach check count + OZ (helper_.create_icmp(count_value, 1, ObLLVMHelper::ICMP_EQ, first_check)); // This value is 1 indicating it is the first check in the loop OZ (helper_.create_icmp(need_check, first_check, ObLLVMHelper::ICMP_NE, is_true)); OZ (helper_.create_cond_br(is_true, early_exit, after_check)); - - //处理check early exit + //Handle check early exit OZ (set_current(early_exit)); OZ (helper_.create_istore(1, count)); OZ (args.push_back(get_vars().at(CTX_IDX))); OZ (helper_.create_call(ObString("check_early_exit"), get_spi_service().spi_check_early_exit_, args, result)); OZ (check_success(result, stmt_id, in_notfound, in_warning)); OZ (helper_.create_br(after_check)); - - //处理正常流程 + //Handle normal process OZ (set_current(after_check)); return ret; @@ -5437,7 +5430,7 @@ int ObPLCodeGenerator::generate_loop_control(const ObPLLoopControl &control) { int ret = OB_SUCCESS; if (NULL == get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else if (OB_FAIL(helper_.set_insert_point(get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else if (OB_FAIL(generate_goto_label(control))) { @@ -5459,7 +5452,7 @@ int ObPLCodeGenerator::generate_loop_control(const ObPLLoopControl &control) } else if (OB_FAIL(helper_.create_br(next))) { LOG_WARN("failed to create br", K(ret)); } else { - if (OB_FAIL(set_current(after_control))) { //设置CURRENT, 调整INSERT POINT点 + if (OB_FAIL(set_current(after_control))) { // set CURRENT, adjust INSERT POINT point LOG_WARN("failed to set current", K(ret)); } } @@ -5483,7 +5476,7 @@ int ObPLCodeGenerator::generate_loop_control(const ObPLLoopControl &control) LOG_WARN("failed to generate spi adjust error trace", K(ret)); } else if (OB_FAIL(helper_.create_br(next))) { LOG_WARN("failed to create br", K(ret)); - } else if (OB_FAIL(set_current(after_control))) { //设置CURRENT, 调整INSERT POINT点 + } else if (OB_FAIL(set_current(after_control))) { // set CURRENT, adjust INSERT POINT point LOG_WARN("failed to set current", K(ret)); } } @@ -5629,7 +5622,7 @@ int ObPLCodeGenerator::generate_set_variable(int64_t expr, ObLLVMValue expr_idx; ObLLVMValue is_default_value; ObLLVMValue result; - if (OB_FAIL(args.push_back(get_vars().at(CTX_IDX)))) { //PL的执行环境 + if (OB_FAIL(args.push_back(get_vars().at(CTX_IDX)))) { //PL execution environment LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(helper_.get_int64(expr, expr_idx))) { LOG_WARN("failed to generate a pointer", K(ret)); @@ -5793,14 +5786,14 @@ int ObPLCodeGenerator::raise_exception(ObLLVMValue &exception, { int ret = OB_SUCCESS; /* - * MySQL模式下: - * 如果到了顶层handler,都没有捕捉到了该exception,视exception的类型决定下一个目的地: - * SQLEXCEPTION:继续抛出异常 - * SQLWARNING:跳到抛出exception的语句的下一句 - * NOT FOUND:如果显式(raised by SIGNAL or RESIGNAL)抛出,继续抛出异常;如果是隐式抛出(raised normally),跳到抛出exception的语句的下一句 + * MySQL mode: + * If the exception is not caught by the top-level handler, the next destination is determined by the exception type: + * SQLEXCEPTION: continue to throw the exception + * SQLWARNING: jump to the statement following the one that threw the exception + * NOT FOUND: if explicitly raised (by SIGNAL or RESIGNAL), continue to throw the exception; if implicitly raised (raised normally), jump to the statement following the one that threw the exception * - * Oracle模式下: - * 遇到错误都抛出 + * Oracle mode: + * All errors are thrown */ ObLLVMBasicBlock current = get_current(); ObLLVMBasicBlock raise_exception; @@ -5971,7 +5964,7 @@ int ObPLCodeGenerator::check_success(jit::ObLLVMValue &ret_err, int64_t stmt_id, ObLLVMValue str_len; ObLLVMValue stmt_id_value; ObLLVMValue line_number_value; - // stmt id目前是col和line的组合,暂时先用这个 + // stmt id is currently a combination of col and line, temporarily use this if (OB_FAIL(helper_.create_load(ObString("line_number"), stmt_id_, line_number_value))) { LOG_WARN("failed to get_line_number", K(ret)); } else if (OB_FAIL(helper_.create_load(ObString("stmt_id"), stmt_id_, stmt_id_value))) { @@ -6006,9 +5999,9 @@ int ObPLCodeGenerator::finish_current(const ObLLVMBasicBlock &next) { int ret = OB_SUCCESS; if (NULL == get_current().get_v()) { - //如果current为NULL,说明控制流已经被显式切走了(例如Iterate、Leave语句) + // If current is NULL, it means the control flow has been explicitly switched away (e.g., Iterate, Leave statements) } else if (get_current().get_v() == get_exit().get_v()) { - //如果current是exit,说明控制流已经显式结束(如return) + // If current is exit, it means the control flow has explicitly ended (e.g., return) } else if (OB_FAIL(helper_.set_insert_point(get_current()))) { LOG_WARN("failed to set insert point", K(ret)); } else if (OB_FAIL(helper_.create_br(next))) { @@ -6038,13 +6031,13 @@ int ObPLCodeGenerator::generate_prototype() if (OB_SUCC(ret)) { ObLLVMType int64_type; - if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { //函数第一个参数必须是基础环境信息隐藏参数ObPLExecCtx* + if (OB_FAIL(arg_types.push_back(pl_exec_context_pointer_type))) { //The first argument of the function must be a hidden parameter of the basic environment information ObPLExecCtx* LOG_WARN("push_back error", K(ret)); } else if (OB_FAIL(helper_.get_llvm_type(ObIntType, int64_type))) { LOG_WARN("failed to get_llvm_type", K(ret)); - } else if (OB_FAIL(arg_types.push_back(int64_type))) { //第二个参数是int64_t ArgC + } else if (OB_FAIL(arg_types.push_back(int64_type))) { // the second parameter is int64_t ArgC LOG_WARN("push_back error", K(ret)); - } else if (OB_FAIL(arg_types.push_back(argv_pointer_type))) { //第三个参数是int64_t[] ArgV + } else if (OB_FAIL(arg_types.push_back(argv_pointer_type))) { // the third parameter is int64_t[] ArgV LOG_WARN("push_back error", K(ret)); } else { /*do nothing*/ } } @@ -6067,10 +6060,9 @@ int ObPLCodeGenerator::generate_prototype() } else { /*do nothing*/ } } } - - //生成参数 + //Generate parameters if (OB_SUCC(ret)) { - //获取数据类型属性 + //Get data type attributes int64_t size = 0; if (OB_FAIL(func_.get_argument_size(size))) { LOG_WARN("failed to get argument size", K(ret)); @@ -6223,24 +6215,24 @@ int ObPLCodeGenerator::generate_obj_access_expr() } /* - * 把ObObjAccessRawExpr翻译成一个函数,其中的每个ObObjAccessIdx可能是: - * 1、const,即常量,只能出现在表的下标位置,如a(1)里的1; - * 2、property,即固有属性,只能出现在表的属性位置,如a.count里的count; - * 3、local,即PL内部变量,可能出现在 - * 1)、初始内存位置,如a(1)里的a; - * 2)、表的下标位置,如a(i)里的i; - * 3)、record的属性位置,如a.b里的b; - * 4、external(包括IS_PKG、IS_USER、IS_SESSION、IS_GLOBAL),可能出现在 - * 1)、初始内存位置,如a(1)里的a; - * 2)、表的下标位置,如a(i)里的i; - * 3)、record的属性位置,如a.b里的b; - * 5、ns不可能出现,在resolver阶段已经被剥掉了。 - * 对于以上几种情况: - * 1、直接用作解析复杂变量; - * 2、直接用作解析复杂变量; - * 3、因为把变量在param store里的下标放在var_indexs_里,所以根据var_indexs_从param store里取出值使用; - * 4、因为把计算的结果作为ObObjAccessRawExpr的child传给了表达式计算,所以直接取obj_stack的值使用。 - * 函数签名: + * Translate ObObjAccessRawExpr into a function, where each ObObjAccessIdx might be: + * 1、const, i.e., constant, can only appear in the index position of the table, such as the 1 in a(1); + * 2、property, i.e., inherent property, can only appear in the property position of the table, such as the count in a.count; + * 3、local, i.e., internal variable in PL, may appear in + * 1)、initial memory position, such as the a in a(1); + * 2)、index position of the table, such as the i in a(i); + * 3)、property position of the record, such as the b in a.b; + * 4、external (including IS_PKG, IS_USER, IS_SESSION, IS_GLOBAL), may appear in + * 1)、initial memory position, such as the a in a(1); + * 2)、index position of the table, such as the i in a(i); + * 3)、property position of the record, such as the b in a.b; + * 5、ns will not appear, it has been stripped off during the resolver stage. + * For the above cases: + * 1、used directly for parsing complex variables; + * 2、used directly for parsing complex variables; + * 3、since the index of the variable in the param store is placed in var_indexs_, the value is retrieved from the param store using var_indexs_; + * 4、since the result of the calculation is passed as a child to the expression calculation as an ObObjAccessRawExpr, the value is directly taken from obj_stack. + * Function signature: * int32_t get_func(int64_t param_cnt, int64_t* params, int64_t* element_val, int64_t *allocator); * */ int ObPLCodeGenerator::generate_get_attr_func(const ObIArray &idents, @@ -6276,7 +6268,7 @@ int ObPLCodeGenerator::generate_get_attr_func(const ObIArray &id OZ (set_current(entry_)); if (OB_SUCC(ret)) { - //获取数据类型属性 + //Get data type attributes ObLLVMValue param_cnt; ObLLVMValue params_ptr; ObLLVMValue element_value; @@ -6390,9 +6382,9 @@ int ObPLCodeGenerator::generate_goto_label(const ObPLStmt &stmt) if (stmt.get_is_goto_dst()) { if (NULL == get_current().get_v()) { - //控制流已断,后面的语句不再处理 + //Control flow is broken, subsequent statements will not be processed } else { - // 去看一下对应的goto是否已经cg了,没有的话就记录一下这个label地址。 + // Check if the corresponding goto has already been cg'd, if not, record this label address. hash::HashMapPair> pair; int tmp_ret = get_goto_label_map().get_refactored(stmt.get_stmt_id(), pair); if (OB_HASH_NOT_EXIST == tmp_ret) { @@ -6483,7 +6475,7 @@ int ObPLCodeGenerator::generate_out_param( ObLLVMValue p_arg; OZ (get_adt_service().get_objparam(obj_param_type)); OZ (obj_param_type.get_pointer_to(obj_param_type_pointer)); - // 获取输出结果 + // Get the output result OZ (extract_arg_from_argv(params, i, pp_arg)); OZ (get_helper().create_load("load_out_arg_pointer", pp_arg, p_arg)); OZ (get_helper().create_int_to_ptr( @@ -6493,16 +6485,16 @@ int ObPLCodeGenerator::generate_out_param( #define GET_USING_EXPR(idx) (get_ast().get_expr(static_cast(&s)->get_using_index(idx))) if (OB_FAIL(ret)) { - } else if (OB_INVALID_INDEX != param_desc.at(i).out_idx_) { // 处理本地变量 - //存储进全局符号表和param store + } else if (OB_INVALID_INDEX != param_desc.at(i).out_idx_) { // handle local variable + //Store in global symbol table and param store ObLLVMValue result; ObLLVMValue p_param; ObPLDataType pl_type = s.get_variable(param_desc.at(i).out_idx_)->get_type(); if (pl_type.is_composite_type()) { if (param_desc.at(i).is_out()) { uint64_t udt_id = pl_type.get_user_type_id(); - // 对于INOUT参数, execute immediate复杂类型传递的是指针, 什么都不需要做; inner call场景, inout参数会入参会深拷,这里需要重新拷回 - // 对于OUT参数, 复杂类型构造了新的ObjParam, 这里进行COPY; + // For INOUT parameters, execute immediate complex type passing is done via pointers, nothing needs to be done; in the inner call scenario, INOUT parameters are deeply copied on entry, here we need to copy them back + // For OUT parameters, new ObjParam is constructed for complex types, here we perform COPY; if (PL_CALL == s.get_type() && static_cast(&s)->get_nocopy_params().count() > i && OB_INVALID_INDEX != static_cast(&s)->get_nocopy_params().at(i) && @@ -6603,7 +6595,7 @@ int ObPLCodeGenerator::generate_out_param( OZ (extract_obobj_ptr_from_objparam(into_address, dest_datum)); OZ (extract_obobj_from_objparam(p_arg, src_datum)); OZ (get_helper().create_store(src_datum, dest_datum)); - } else { //处理基础类型和refcursor的出参 + } else { // handle basic types and refcursor out parameters ObSEArray args; ObLLVMValue result_idx; ObLLVMValue ret_err; @@ -6628,7 +6620,7 @@ int ObPLCodeGenerator::generate_out_param( OZ (check_success( ret_err, s.get_stmt_id(), s.get_block()->in_notfound(), s.get_block()->in_warning())); } - } else { // 处理外部变量(Sys Var/User Var or PKG Basic Variables or Subprogram Basic Variables) + } else { // handle external variables (Sys Var/User Var or PKG Basic Variables or Subprogram Basic Variables) const ObRawExpr *expr = NULL; CK (OB_NOT_NULL(expr = s.get_expr(param_desc.at(i).param_))); if (OB_FAIL(ret)) { @@ -6719,7 +6711,7 @@ int ObPLCodeGenerator::generate_out_param( if (call_stmt->get_nocopy_params().count() > i && OB_INVALID_INDEX != call_stmt->get_nocopy_params().at(i) && !param_desc.at(i).is_pure_out()) { - // inner call nocopy的inout参数传递是指针, 无需释放 + // inner call nocopy's inout parameter passing is by pointer, no need to release } else { OZ (generate_destruct_obj(s, src_datum)); } @@ -6751,7 +6743,7 @@ int ObPLCodeGenerator::generate_out_params( OZ (nocopy_params.assign(call_stmt->get_nocopy_params())); CK (nocopy_params.count() == 0 || nocopy_params.count() == param_desc.count()); } - // 先处理NoCopy的参数 + // First process the NoCopy parameters for (int64_t i = 0; OB_SUCC(ret) && i < nocopy_params.count(); ++i) { if (nocopy_params.at(i) != OB_INVALID_INDEX && param_desc.at(i).is_out()) { OZ (generate_out_param(s, param_desc, params, i)); @@ -6759,7 +6751,7 @@ int ObPLCodeGenerator::generate_out_params( } for (int64_t i = 0; OB_SUCC(ret) && i < param_desc.count(); ++i) { - // 处理输出参数的情况, NoCopy参数已经处理过了, 处理非NoCopy的参数 + // Handle the case of output parameters, NoCopy parameter has already been processed, handle non-NoCopy parameters if (nocopy_params.count() > 0 && nocopy_params.at(i) != OB_INVALID_INDEX) { // do nothing... } else if (param_desc.at(i).is_out()) { @@ -6853,8 +6845,7 @@ int ObPLCodeGenerator::generate_normal(ObPLFunction &pl_func) ObLLVMType p_uint64_type; ObLLVMType data_type; ObLLVMType p_data_type; - - // 初始化符号表 + // Initialize symbol table for (int64_t i = 0; OB_SUCC(ret) && i < USER_ARG_OFFSET + 1; ++i) { @@ -6988,7 +6979,7 @@ int ObPLCodeGenerator::generate_normal(ObPLFunction &pl_func) || get_ast().get_ret_type().get_data_type()->get_meta_type().is_invalid())) { ret = OB_ERR_UNEXPECTED; LOG_WARN("return type is invalid", K(func_), K(ret)); - } else if (!current_.is_terminated()) { //如果当前block没有终止符,强制跳转 + } else if (!current_.is_terminated()) { // If the current block does not have a terminator, force jump if (OB_FAIL(finish_current(exit_))) { LOG_WARN("failed to finish_current", K(ret)); } @@ -7936,10 +7927,10 @@ int ObPLCodeGenerator::generate_handle_ref_cursor(const ObPLCursor *cursor, cons { int ret = OB_SUCCESS; CK (OB_NOT_NULL(cursor)); - // 以下一些情况不要关闭cursor: - // function (cur out sys_refcursor), out类型参数 - // dup cursor 没有被init,所以不需要关闭,见generate_declare_cursor - // 直接使用subprog 外部的cursor(不是ref cursor),也不要关闭,例如 + // The following situations should not close the cursor: + // function (cur out sys_refcursor), out type parameter + // dup cursor has not been init, so it does not need to be closed, see generate_declare_cursor + // Directly use the cursor outside of subprog (not ref cursor), do not close it, for example /* * DECLARE CURSOR c (job VARCHAR2, max_sal NUMBER) IS @@ -7950,7 +7941,7 @@ int ObPLCodeGenerator::generate_handle_ref_cursor(const ObPLCursor *cursor, cons overpayment_ emp4.salary%TYPE; BEGIN LOOP - FETCH c INTO employee_name_, overpayment_; //这儿直接使用了外部cursor + FETCH c INTO employee_name_, overpayment_; //Here the external cursor is used directly EXIT WHEN c%NOTFOUND; DBMS_OUTPUT.PUT_LINE(employee_name_ || ' (by ' || overpayment_ || ')'); INSERT INTO test2 VALUES(employee_name_, TO_CHAR(overpayment_)); @@ -7959,8 +7950,8 @@ int ObPLCodeGenerator::generate_handle_ref_cursor(const ObPLCursor *cursor, cons */ bool is_pkg_cursor = false; if (OB_SUCC(ret)) { - // 定义在package spec中的才是package id,这种cursor的routine id是无效的 - // 有些定义在package函数中的cursor,它的package id也是有效的,routine id也是有效的。 + // The package id is defined in the package spec, this cursor's routine id is invalid + // Some cursors defined in the package function have a valid package id and a valid routine id. is_pkg_cursor = OB_INVALID_ID != cursor->get_package_id() && OB_INVALID_ID == cursor->get_routine_id(); } diff --git a/src/pl/ob_pl_code_generator.h b/src/pl/ob_pl_code_generator.h index 1da938c96..ec12eff54 100644 --- a/src/pl/ob_pl_code_generator.h +++ b/src/pl/ob_pl_code_generator.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SRC_PL_OB_PL_CODE_GENERATOR_H_ @@ -277,8 +281,8 @@ friend class ObPLCGBufferGuard; const uint64_t &package_id, const uint64_t &routine_id, const int64_t &cursor_index, - bool ignore = false, //是否忽略未打开的游标,不忽略的情况下遇到未打开的游标会报错,默认不忽略 - bool exception = true); //在关闭过程中遇到错误是否抛出exception,默认抛出 + bool ignore = false, //whether to ignore unclosed cursors, if not ignored, an error will be reported when encountering an unclosed cursor, default is not to ignore + bool exception = true); //Whether to throw an exception when an error occurs during shutdown, default is to throw int generate_check_not_null(const ObPLStmt &s, bool is_not_null, jit::ObLLVMValue &p_result_obj); @@ -702,7 +706,7 @@ friend class ObPLCGBufferGuard; ObLLVMTypeMap user_type_map_; jit::ObLLVMValue saved_ob_error_; jit::ObLLVMValue saved_exception_; - ObPLSEArray vars_; //第0个是隐藏ctx参数,从第1个开始与ObPLSymbolTable对应 + ObPLSEArray vars_; // The 0th is the hidden ctx parameter, starting from the 1st it corresponds to ObPLSymbolTable // key: stmt id, value: pair(key: index, -1,) goto_label_map goto_label_map_; diff --git a/src/pl/ob_pl_compile.cpp b/src/pl/ob_pl_compile.cpp index 55bfd5deb..ea7c28f63 100644 --- a/src/pl/ob_pl_compile.cpp +++ b/src/pl/ob_pl_compile.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL @@ -165,7 +169,7 @@ int ObPLCompiler::init_anonymous_ast( } pl_type.reset(); int64_t int_value = 0; - // 参数化整型常量按照会按照numbger来生成param + // Parameterized integer constants will be generated as numbger param if (!is_prepare_protocol && (ObNumberType == params->at(i).get_type() || ObUNumberType == params->at(i).get_type()) && params->at(i).get_number().is_valid_int64(int_value) @@ -195,8 +199,7 @@ int ObPLCompiler::compile( uint64_t block_hash = OB_INVALID_ID; int64_t resolve_end = 0; ObPLASHGuard plash_guard(ObPLASHGuard::ObPLASHStatus::IS_PLSQL_COMPILATION); - - //Step 1:构造匿名块的ObPLFunctionAST + //Step 1: Construct the ObPLFunctionAST for the anonymous block HEAP_VAR(ObPLFunctionAST, func_ast, allocator_) { func_ast.set_db_name(session_info_.get_database_name()); @@ -298,7 +301,7 @@ int ObPLCompiler::compile( } } if (OB_SUCC(ret)) { - //anonymous + ps情况func也需要进plan cache,因此需要设置version + //anonymous + ps situation func also needs to enter plan cache, therefore version needs to be set int64_t tenant_id = session_info_.get_effective_tenant_id(); int64_t tenant_schema_version = OB_INVALID_VERSION; int64_t sys_schema_version = OB_INVALID_VERSION; @@ -631,8 +634,8 @@ int ObPLCompiler::update_schema_object_dep_info(ObIArray &dp dep.set_dep_obj_owner_id(owner_id); dep.set_schema_version(schema_version); OZ (dep.insert_schema_object_dependency(trans)); - // 理论上pl是单线程编译的,但是如果把这个相同的pl在多个observer上同时编译,这个依赖关系可能会多次重建。 - // 发生这种情况下,简单的忽略错误码 + // Theoretically, pl is single-threaded compiled, but if the same pl is compiled simultaneously on multiple observers, this dependency relationship may be rebuilt multiple times. + // In this case, simply ignore the error code if (OB_ERR_PRIMARY_KEY_DUPLICATE == ret) { ret = OB_SUCCESS; } @@ -1026,7 +1029,7 @@ int ObPLCompiler::init_function(const share::schema::ObRoutineInfo *routine, ObP if (routine->is_invoker_right()) { func.set_invoker_right(); } - // 对于function而言,输出参数也在params里面,这里不能简单的按照param_count进行遍历 + // For function, output parameters are also in params, here we cannot simply iterate according to param_count for (int64_t i = 0; OB_SUCC(ret) && i < routine->get_routine_params().count(); ++i) { ObRoutineParam *param = routine->get_routine_params().at(i); int64_t param_pos = param->get_param_position(); @@ -1034,7 +1037,7 @@ int ObPLCompiler::init_function(const share::schema::ObRoutineInfo *routine, ObP ret = OB_ERR_UNEXPECTED; LOG_WARN("routine param is NULL", K(i), K(ret)); } else if (param->is_ret_param()) { - // 对于返回值, 既不是in也不是out, 不做处理 + // For the return value, if it is neither in nor out, do not process } else { if (param->is_inout_sp_param() || param->is_out_sp_param()) { if (OB_FAIL(func.add_out_arg(param_pos - 1))) { @@ -1170,7 +1173,7 @@ int ObPLCompiler::generate_package_cursors( OZ (row_desc->deep_copy(package.get_allocator(), *(ast_cursor->get_row_desc()), false)); } OZ (cursor_type.deep_copy(package.get_allocator(), ast_cursor->get_cursor_type())); - //Sql参数表达式,需要Copy下 + //Sql parameter expression, need to Copy it ObSEArray sql_params; for (int64_t i = 0; OB_SUCC(ret) && i < ast_cursor->get_sql_params().count(); ++i) { ObRawExpr *expr = NULL; @@ -1179,14 +1182,14 @@ int ObPLCompiler::generate_package_cursors( package_ast.get_expr(ast_cursor->get_sql_params().at(i)), expr)); CK (OB_NOT_NULL(expr)); - //不再构造Exprs,直接将表达式存在int64的数组上 + //No longer construct Exprs, directly store the expression in an int64 array OZ (sql_params.push_back(reinterpret_cast(expr))); } OZ (cursor_table.add_cursor(ast_cursor->get_package_id(), ast_cursor->get_routine_id(), - ast_cursor->get_index(),//代表在Package符号表中的位置 + ast_cursor->get_index(),//represents the position in the Package symbol table sql,//Cursor Sql - sql_params,//Cursor参数表达式 + sql_params,//Cursor parameter expression ps_sql, ast_cursor->get_stmt_type(), ast_cursor->is_for_update(), diff --git a/src/pl/ob_pl_compile.h b/src/pl/ob_pl_compile.h index 96b898b40..17d4c99b6 100644 --- a/src/pl/ob_pl_compile.h +++ b/src/pl/ob_pl_compile.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SRC_PL_OB_PL_COMPILE_H_ @@ -75,10 +79,10 @@ class ObPLCompiler const uint64_t stmt_id, ObPLFunction &func, ParamStore *params, - bool is_prepare_protocol); //匿名块接口 + bool is_prepare_protocol); //anonymous block interface - int compile(const uint64_t id, ObPLFunction &func); //Procedure/Function接口 + int compile(const uint64_t id, ObPLFunction &func); //Procedure/Function interface int analyze_package(const ObString &source, const ObPLBlockNS *parent_ns, ObPLPackageAST &package_ast, bool is_for_trigger); diff --git a/src/pl/ob_pl_compile_utils.cpp b/src/pl/ob_pl_compile_utils.cpp index 8214e53f4..0dd334a8b 100644 --- a/src/pl/ob_pl_compile_utils.cpp +++ b/src/pl/ob_pl_compile_utils.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL diff --git a/src/pl/ob_pl_compile_utils.h b/src/pl/ob_pl_compile_utils.h index 77e79e11e..677671065 100644 --- a/src/pl/ob_pl_compile_utils.h +++ b/src/pl/ob_pl_compile_utils.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SRC_PL_OB_PL_COMPILE_UTILS_H_ diff --git a/src/pl/ob_pl_dependency_util.cpp b/src/pl/ob_pl_dependency_util.cpp index f816ff265..f9ae90312 100644 --- a/src/pl/ob_pl_dependency_util.cpp +++ b/src/pl/ob_pl_dependency_util.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL_DEPENDENCY @@ -120,4 +124,4 @@ int ObPLDependencyUtil::add_dependency_objects(ObPLDependencyTable &dep_tbl, } } -} \ No newline at end of file +} diff --git a/src/pl/ob_pl_dependency_util.h b/src/pl/ob_pl_dependency_util.h index 16c971c19..5ab93f318 100644 --- a/src/pl/ob_pl_dependency_util.h +++ b/src/pl/ob_pl_dependency_util.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SRC_PL_OB_PL_DEPENDENCY_MANAGER_H_ @@ -65,4 +69,4 @@ class ObPLDependencyGuard } } -#endif \ No newline at end of file +#endif diff --git a/src/pl/ob_pl_exception_handling.cpp b/src/pl/ob_pl_exception_handling.cpp index 2175c2d9d..ee7fef392 100644 --- a/src/pl/ob_pl_exception_handling.cpp +++ b/src/pl/ob_pl_exception_handling.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL @@ -22,7 +26,7 @@ namespace pl { _RLOCAL(_Unwind_Exception*, tl_eptr); -ObPLException pre_reserved_e(OB_ALLOCATE_MEMORY_FAILED); //预留的exception空间,防止出现没内存的时候抛不出来exception +ObPLException pre_reserved_e(OB_ALLOCATE_MEMORY_FAILED); // reserved exception space to prevent exceptions from not being thrown when there is no memory void ObPLEH::eh_debug_int64(const char *name_ptr, int64_t name_len, int64_t object) { @@ -376,7 +380,7 @@ bool ObPLEH::handleActionValue(int64_t *resultAction, precedence = cur_pre; *resultAction = i + 1; ret = true; - break; //这里其实不应break,应该寻找precedence最高的,但是我们在前面CG阶段已经把condition已经按precedence排过序了,这里可以break提升效率 + break; //Here actually should not break, it should find the one with the highest precedence, but we have already sorted the conditions by precedence in the previous CG phase, so we can break here to improve efficiency } else { /*do nothing*/ } } diff --git a/src/pl/ob_pl_exception_handling.h b/src/pl/ob_pl_exception_handling.h index 5277f8b00..39420198a 100644 --- a/src/pl/ob_pl_exception_handling.h +++ b/src/pl/ob_pl_exception_handling.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef OCEANBASE_SRC_PL_OB_PL_EXCEPTION_HANDLING_H_ diff --git a/src/pl/ob_pl_interface_pragma.cpp b/src/pl/ob_pl_interface_pragma.cpp index f47648565..62cea2931 100644 --- a/src/pl/ob_pl_interface_pragma.cpp +++ b/src/pl/ob_pl_interface_pragma.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL diff --git a/src/pl/ob_pl_interface_pragma.h b/src/pl/ob_pl_interface_pragma.h index 2f9a5a18a..ba48e80b3 100644 --- a/src/pl/ob_pl_interface_pragma.h +++ b/src/pl/ob_pl_interface_pragma.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #include "lib/string/ob_string.h" @@ -31,8 +35,10 @@ #include "pl/sys_package/ob_dbms_limit_calculator_mysql.h" #include "pl/sys_package/ob_dbms_external_table.h" #include "pl/sys_package/ob_dbms_vector_mysql.h" +#include "pl/sys_package/ob_dbms_hybrid_vector_mysql.h" #include "pl/pl_recompile/ob_pl_recompile_task_helper.h" #include "pl/sys_package/ob_dbms_partition.h" +#include "pl/sys_package/ob_dbms_ai_service.h" #ifdef INTERFACE_DEF INTERFACE_DEF(INTERFACE_START, "TEST", (ObPLInterfaceImpl::call)) @@ -113,7 +119,7 @@ INTERFACE_DEF(INTERFACE_DBMS_STATS_SET_SYSTEM_STATS, "SET_SYSTEM_STATS", (ObDbmsStats::set_system_stats)) INTERFACE_DEF(INTERFACE_DBMS_STATS_ASYNC_GATHER_STATS_JOB_PROC, "ASYNC_GATHER_STATS_JOB_PROC", (ObDbmsStats::async_gather_stats_job_proc)) //end of dbms_stat - + //start of dbms xplan INTERFACE_DEF(INTERFACE_DBMS_XPLAN_ENABLE_OPT_TRACE, "ENABLE_OPT_TRACE", (ObDbmsXplan::enable_opt_trace)) INTERFACE_DEF(INTERFACE_DBMS_XPLAN_DISABLE_OPT_TRACE, "DISABLE_OPT_TRACE", (ObDbmsXplan::disable_opt_trace)) @@ -229,6 +235,24 @@ INTERFACE_DEF(INTERFACE_DBMS_PARTITION_MANAGE_DYNAMIC_PARTITION, "DBMS_PARTITION_MANAGE_DYNAMIC_PARTITION", (ObDBMSPartition::manage_dynamic_partition)) // end of dbms_partition + // start of dbms_ai_service + INTERFACE_DEF(INTERFACE_DBMS_AI_SERVICE_CREATE_AI_MODEL_MYSQL, "DBMS_AI_SERVICE_CREATE_AI_MODEL_MYSQL", (ObDBMSAiService::create_ai_model)) + INTERFACE_DEF(INTERFACE_DBMS_AI_SERVICE_DROP_AI_MODEL_MYSQL, "DBMS_AI_SERVICE_DROP_AI_MODEL_MYSQL", (ObDBMSAiService::drop_ai_model)) + INTERFACE_DEF(INTERFACE_DBMS_AI_SERVICE_CREATE_AI_MODEL_ENDPOINT_MYSQL, "DBMS_AI_SERVICE_CREATE_AI_MODEL_ENDPOINT_MYSQL", (ObDBMSAiService::create_ai_model_endpoint)) + INTERFACE_DEF(INTERFACE_DBMS_AI_SERVICE_ALTER_AI_MODEL_ENDPOINT_MYSQL, "DBMS_AI_SERVICE_ALTER_AI_MODEL_ENDPOINT_MYSQL", (ObDBMSAiService::alter_ai_model_endpoint)) + INTERFACE_DEF(INTERFACE_DBMS_AI_SERVICE_DROP_AI_MODEL_ENDPOINT_MYSQL, "DBMS_AI_SERVICE_DROP_AI_MODEL_ENDPOINT_MYSQL", (ObDBMSAiService::drop_ai_model_endpoint)) + // end of dbms_ai_service + + // start of dbms_hybrid_search +#define DEFINE_DBMS_HYBRID_VECTOR_MYSQL_INTERFACE(symbol, func) \ +INTERFACE_DEF(INTERFACE_##symbol, #symbol, (func)) + +DEFINE_DBMS_HYBRID_VECTOR_MYSQL_INTERFACE(DBMS_HYBRID_VECTOR_MYSQL_SEARCH, ObDBMSHybridVectorMySql::search) +DEFINE_DBMS_HYBRID_VECTOR_MYSQL_INTERFACE(DBMS_HYBRID_VECTOR_MYSQL_GET_SQL, ObDBMSHybridVectorMySql::get_sql) + +#undef DEFINE_DBMS_HYBRID_VECTOR_MYSQL_INTERFACE + // end of dbms_hybrid_search + INTERFACE_DEF(INTERFACE_END, "INVALID", (nullptr)) #endif diff --git a/src/pl/ob_pl_package.cpp b/src/pl/ob_pl_package.cpp index 64157b34d..56f460d98 100644 --- a/src/pl/ob_pl_package.cpp +++ b/src/pl/ob_pl_package.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL diff --git a/src/pl/ob_pl_package.h b/src/pl/ob_pl_package.h index 9442a035a..d689f46c4 100644 --- a/src/pl/ob_pl_package.h +++ b/src/pl/ob_pl_package.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_PL_OB_PL_PACKAGE_H_ diff --git a/src/pl/ob_pl_package_encode_info.cpp b/src/pl/ob_pl_package_encode_info.cpp index d5e86d222..45dbd1b05 100644 --- a/src/pl/ob_pl_package_encode_info.cpp +++ b/src/pl/ob_pl_package_encode_info.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL @@ -115,4 +119,4 @@ int ObPackageVarEncodeInfo::decode(const char *src, const int64_t src_len, int64 } } // end namespace pl -} // end namespace oceanbase \ No newline at end of file +} // end namespace oceanbase diff --git a/src/pl/ob_pl_package_encode_info.h b/src/pl/ob_pl_package_encode_info.h index 966db1e85..1344e8a9d 100644 --- a/src/pl/ob_pl_package_encode_info.h +++ b/src/pl/ob_pl_package_encode_info.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2024 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_PL_OB_PL_PACKAGE_ENCODE_INFO_H_ @@ -57,4 +61,4 @@ struct ObPackageVarEncodeInfo } //end namespace pl } //end namespace oceanbase -#endif /* SRC_PL_OB_PL_PACKAGE_STATE_H_ */ \ No newline at end of file +#endif /* SRC_PL_OB_PL_PACKAGE_STATE_H_ */ diff --git a/src/pl/ob_pl_package_guard.cpp b/src/pl/ob_pl_package_guard.cpp index d266d45b0..b6b91c42d 100644 --- a/src/pl/ob_pl_package_guard.cpp +++ b/src/pl/ob_pl_package_guard.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL diff --git a/src/pl/ob_pl_package_guard.h b/src/pl/ob_pl_package_guard.h index b13d98ddd..4aa247a54 100644 --- a/src/pl/ob_pl_package_guard.h +++ b/src/pl/ob_pl_package_guard.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_PL_OB_PL_PACKAGE_GUARD_H_ diff --git a/src/pl/ob_pl_package_manager.cpp b/src/pl/ob_pl_package_manager.cpp index 10e5537ce..d9256d8ef 100644 --- a/src/pl/ob_pl_package_manager.cpp +++ b/src/pl/ob_pl_package_manager.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL @@ -594,7 +598,7 @@ int ObPLPackageManager::get_package_var(const ObPLResolveCtx &resolve_ctx, uint6 } else if (OB_ISNULL(var)) { ret = OB_ERR_UNEXPECTED; LOG_WARN("package var not found", K(package_id), K(var_idx), K(ret)); - } else if (!var->is_readonly() && OB_ISNULL(package_body)) {// 对于非constant值, 需要保证body的合法性 + } else if (!var->is_readonly() && OB_ISNULL(package_body)) {// For non-constant values, need to ensure the validity of the body OZ (get_cached_package(resolve_ctx, package_id, package_spec, package_body, false)); } } @@ -895,7 +899,7 @@ int ObPLPackageManager::get_package_routine(const ObPLResolveCtx &ctx, } else { ObPLPackageState *dummy_state = NULL; if (OB_SUCC(ret) && OB_NOT_NULL(package_body->get_init_routine())) { - // call一个pacakge 函数的时候,去执行package的init 函数 + // call a package function when executing the package's init function OZ (get_package_state(ctx, exec_ctx, package_id, dummy_state)); } } @@ -1511,7 +1515,7 @@ int ObPLPackageManager::get_package_item_state(const ObPLResolveCtx &resolve_ctx if (OB_SUCC(ret) && package.get_expr_op_size() > 0) { OZ (exec_ctx.init_expr_op(package.get_expr_op_size())); } - // 要先加到SESSION上然后在初始化, 反之会造成死循环 + // You need to add it to the SESSION first and then initialize, otherwise it will cause a deadlock OZ (resolve_ctx.session_info_.add_package_state(package_id, package_state)); OX (need_destruct_package_state = false); if (OB_SUCC(ret)) { @@ -1523,14 +1527,14 @@ int ObPLPackageManager::get_package_item_state(const ObPLResolveCtx &resolve_ctx if (OB_FAIL(ret)) { } else if (OB_FAIL(package.instantiate_package_state(resolve_ctx, exec_ctx, *package_state, spec, body))) { if (OB_SUCCESS != (tmp_ret = resolve_ctx.session_info_.del_package_state(package_id))) { - // 删除失败, 为了避免一个未知的状态, 重新初始化这段内存, 使之是无效状态 + // Deletion failed, to avoid an unknown state, reinitialize this memory to be in an invalid state package_state->reset(&(resolve_ctx.session_info_)); package_state->~ObPLPackageState(); new (package_state) ObPLPackageState(package_id, state_version, package.get_serially_reusable()); LOG_WARN("failed to del package state", K(ret), K(package_id), K(tmp_ret)); } else { - // 删除成功将内存释放 + // Deletion successful will release memory package_state->reset(&(resolve_ctx.session_info_)); package_state->~ObPLPackageState(); session_allocator.free(package_state); @@ -1655,15 +1659,15 @@ int ObPLPackageManager::add_package_to_plan_cache(const ObPLResolveCtx &resolve_ LOG_INFO("package has been added by others, need not add again", K(package_id), K(ret)); ret = OB_SUCCESS; } else if (OB_REACH_MEMORY_LIMIT == ret || OB_SQL_PC_PLAN_SIZE_LIMIT == ret) { - if (REACH_TIME_INTERVAL(1000000)) { //1s, 当内存达到上限时, 该日志打印会比较频繁, 所以以1s为间隔打印 + if (REACH_TIME_INTERVAL(1000000)) { //1s, When memory reaches its limit, this log print will be relatively frequent, so it is printed at an interval of 1s LOG_INFO("can't add plan to plan cache", K(package_id), K(package->get_mem_size()), K(plan_cache->get_mem_used()), K(ret)); } ret = OB_SUCCESS; - } else if (OB_REACH_MAX_CONCURRENT_NUM != ret) { //如果是达到限流上限, 则将错误码抛出去 + } else if (OB_REACH_MAX_CONCURRENT_NUM != ret) { // If it reaches the rate limit upper limit, then throw out the error code LOG_WARN("add package to ObPlanCache failed", K(package_id), K(ret), K(package->get_dependency_table())); - ret = OB_SUCCESS; //add package出错, 覆盖错误码, 确保因plan cache失败不影响正常执行路径 + ret = OB_SUCCESS; // add package error, overwrite error code, ensure that plan cache failure does not affect the normal execution path } } else { LOG_INFO("add pl package to plan cache success", diff --git a/src/pl/ob_pl_package_manager.h b/src/pl/ob_pl_package_manager.h index 48e3bb775..78c4ec6a6 100644 --- a/src/pl/ob_pl_package_manager.h +++ b/src/pl/ob_pl_package_manager.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_PL_OB_PL_PACKAGE_MANAGER_H_ diff --git a/src/pl/ob_pl_package_state.cpp b/src/pl/ob_pl_package_state.cpp index 0ee98ad86..1b82d5493 100644 --- a/src/pl/ob_pl_package_state.cpp +++ b/src/pl/ob_pl_package_state.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL @@ -367,7 +371,7 @@ int ObPLPackageState::set_package_var_val(const int64_t var_idx, ret = OB_ARRAY_OUT_OF_RANGE; LOG_WARN("invalid var index", K(var_idx), K(vars_.count()), K(ret)); } else { - // VAR的生命周期是SESSION级, 因此这里需要深拷贝下 + // The lifecycle of VAR is SESSION-level, therefore a deep copy is needed here if (value.need_deep_copy() && deep_copy_complex) { int64_t pos = 0; char *buf = static_cast(inner_allocator_.alloc(value.get_deep_copy_size())); diff --git a/src/pl/ob_pl_package_state.h b/src/pl/ob_pl_package_state.h index fcf3a05cc..da062d559 100644 --- a/src/pl/ob_pl_package_state.h +++ b/src/pl/ob_pl_package_state.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifndef SRC_PL_OB_PL_PACKAGE_STATE_H_ diff --git a/src/pl/ob_pl_persistent.cpp b/src/pl/ob_pl_persistent.cpp index e313dcc15..427b5e957 100644 --- a/src/pl/ob_pl_persistent.cpp +++ b/src/pl/ob_pl_persistent.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL_STORAGEROUTINE @@ -834,4 +838,4 @@ int ObRoutinePersistentInfo::decode_stack_sizes(ObPLCompileUnit &unit, char *buf } } // namespace pl -} // namespace oceanbase \ No newline at end of file +} // namespace oceanbase diff --git a/src/pl/ob_pl_persistent.h b/src/pl/ob_pl_persistent.h index 0ab5d44ad..d582b954c 100644 --- a/src/pl/ob_pl_persistent.h +++ b/src/pl/ob_pl_persistent.h @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2023 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #ifdef ARCH_DEF @@ -182,4 +186,4 @@ class ObRoutinePersistentInfo } } -#endif \ No newline at end of file +#endif diff --git a/src/pl/ob_pl_resolver.cpp b/src/pl/ob_pl_resolver.cpp index 3ea8d06ae..96f138490 100644 --- a/src/pl/ob_pl_resolver.cpp +++ b/src/pl/ob_pl_resolver.cpp @@ -1,13 +1,17 @@ -/** - * Copyright (c) 2021 OceanBase - * OceanBase CE is licensed under Mulan PubL v2. - * You can use this software according to the terms and conditions of the Mulan PubL v2. - * You may obtain a copy of Mulan PubL v2 at: - * http://license.coscl.org.cn/MulanPubL-2.0 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PubL v2 for more details. +/* + * Copyright (c) 2025 OceanBase. + * + * Licensed 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. */ #define USING_LOG_PREFIX PL @@ -74,7 +78,7 @@ int ObPLResolver::init(ObPLFunctionAST &func_ast) OZ (current_block_->get_namespace().get_cursors().push_back( current_block_->get_namespace().get_cursors().count())); } - if (OB_SUCC(ret) && type.is_composite_type()) { // 将参数中的复杂类型在本ns中展开, 避免参数类型在符号表中不全 + if (OB_SUCC(ret) && type.is_composite_type()) { // Expand complex types in this ns from the parameters to avoid incomplete parameter types in the symbol table const ObUserDefinedType *user_type = NULL; if (STANDALONE_ANONYMOUS == func_ast.get_proc_type()) { OZ (ObPLDependencyUtil::add_dependency_objects(func_ast.get_dependency_table(), @@ -220,8 +224,8 @@ int ObPLResolver::resolve(const ObStmtNodeTree *parse_tree, ObPLFunctionAST &fun ObPLLabelTable *pl_label = NULL; int64_t label_idx = OB_INVALID_INDEX; if (T_SP_LABELED_BLOCK == parse_tree->type_ || T_SP_LABELED_CONTROL == parse_tree->type_) { - // Oracle可以只有EndLabel,没有BeginLabel, 且EndLabel可以与BeginLabel不匹配 - // 如下用例在Oracle下是合法的 + // Oracle can have only EndLabel, without BeginLabel, and EndLabel can not match BeginLabel + // The following test case is legal in Oracle // example 1: <