Closed LinZhihao-723 closed 1 month ago
The pull request introduces several modifications to the clp::ffi::ir_stream
namespace, enhancing serialization and deserialization functionalities. Key updates include the addition of a templated function in the Serializer
class for handling schema tree node IDs, improvements to deserialization methods with updated return types for better error handling, and the introduction of new utility functions. Additionally, protocol constants have been renamed for clarity, and a new template test case has been added to validate the serialization logic.
File Path | Change Summary |
---|---|
components/core/src/clp/ffi/ir_stream/Serializer.cpp |
Refactored serialization methods, introduced encode_and_serialize_schema_tree_node_id , updated serialize_schema_tree_node and serialize_key methods. |
components/core/src/clp/ffi/ir_stream/Serializer.hpp |
Updated method signatures and documentation for clarity on return values. |
components/core/src/clp/ffi/ir_stream/ir_unit_deserialization_methods.cpp |
Modified return types for deserialization functions, added is_encoded_key_id_tag and is_log_event_ir_unit_tag , refactored deserialize_schema . |
components/core/src/clp/ffi/ir_stream/ir_unit_deserialization_methods.hpp |
Updated method signatures to enhance error handling. |
components/core/src/clp/ffi/ir_stream/protocol_constants.hpp |
Updated constants for versioning and encoding identifiers, including renaming for clarity. |
components/core/src/clp/ffi/ir_stream/utils.cpp |
Enhanced error handling functions, added new template functions for serialization and deserialization. |
components/core/src/clp/ffi/ir_stream/utils.hpp |
Added new template functions to improve handling of schema tree node IDs. |
components/core/tests/test-ir_encoding_methods.cpp |
Added new template test case ffi_ir_stream_serialize_schema_tree_node_id for validating serialization and deserialization of schema tree node IDs. |
IrUnitHandlerInterface
, which may be utilized by the main PR for handling IR units during serialization and deserialization.Deserializer
API to handle IR units, aligning with the main PR's changes to serialization and deserialization processes.Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Description
As explained in #556, we want to add support for auto-generated key-value pairs in our current kv pair IR format. This PR implements one's complement encoding to serialize/deserialize encoded schema tree node IDs, and use these new methods to replace the old methods used in the serializer/deserializer implementations.
The serialization/deserialization methods in this PR use templates to reduce code duplication but without introducing runtime overhead. The template is mainly used for:
Notice that the current implementation only uses user-generated node IDs' code path as the auto-generated node IDs are not yet supported. However, this PR changes the IR formats, meaning that the IR format serialized by the old serializer may not be correctly processed by the latest deserializer. As a result, this PR elevates the IR stream version number to
0.1.0-beta.1
.Validation performed
Summary by CodeRabbit
New Features
Bug Fixes
Tests