This topic describes what oblogmsg is and how to install and deploy it.
oblogmsg
oblogmsg is a message format used by obcdc, the incremental data collection module of OceanBase Database, to export incremental data. oblogmsg supports writing incremental data of different types in OceanBase Database. It also supports data serialization and deserialization.
Considerations
Prerequisites
- You have installed CMake: 3.20.0 or later.
- You have installed g++ that supports C++11 standard
Use the source code to make oblogmsg a dependency (recommended)
- Use the
git submodulemethod to make oblogmsg a submodule of the project. - In the
CMakeLists.txtfile of the project, run theadd_subdirectory(submodule_path_to_oblogmsg)command to make the project depend on oblogmsg. After you run this command, two targets are provided:oceanbase::oblogmsg_sharedandoceanbase::oblogmsg_static. - In the
CMakeLists.txtfile of the project, run thetarget_link_libraries(t1 PRIVATE oceanbase::oblogmsg_shared)ortarget_link_libraries(t1 PRIVATE oceanbase::oblogmsg_static)command on Target t1 that needs to depend on oblogmsg.
Use the compiled oblogmsg library as a dependency
Compile and install oblogmsg
# Compile ologmsg git clone https://github.com/oceanbase/oblogmsg.git mkdir oblogmsg-build cd oblogmsg-build cmake -S ../oblogmsg -B . cmake --build . # Local installation cmake --install . --prefix=${OBLOGMSG_INSTALL_PATH}Make the compiled and installed oblogmsg a dependency of the project
- In the
CMakeLists.txtfile of the project, run theset(CMAKE_PREFIX_PATH $ENV{OBLOGMSG_INSTALL_PATH} ${CMAKE_PREFIX_PATH})command to set the search path for the oblogmsg library. - Run the
find_package(oblogmsg REQUIRED)command to load oblogmsg. After you run this command, two targets are provided:oceanbase::oblogmsg_sharedandoceanbase::oblogmsg_static. - In the
CMakeLists.txtfile of the project, run thetarget_link_libraries(t1 PRIVATE oceanbase::oblogmsg_shared)ortarget_link_libraries(t1 PRIVATE oceanbase::oblogmsg_static)command on Target t1 that needs to depend on oblogmsg.
- In the