Caideyipi opened a new pull request, #18433: URL: https://github.com/apache/iotdb/pull/18433
## Description Optimize the OPC UA sink's client-server TsFile path by reading each timeseries' last point directly from TsFile metadata instead of materializing every Tablet. ### Metadata fast path - Read last points synchronously with `TsFileLastReader`; only BLOB/OBJECT-style types without values in statistics need their last chunk read. - Preserve the original measurement schema alongside each `TimeValuePair`, so logical types such as TIMESTAMP, STRING, and BLOB are not degraded by `TsPrimitiveType`. - Validate the number of values returned against independently read metadata because `TsFileLastReader.hasNext()` logs and suppresses IOExceptions. - Reuse the existing OPC UA row-transfer code for both embedded-server and client modes. ### Compatibility and event semantics - Use the fast path only for client-server events without mods, time/path filtering, or privilege filtering. - Keep the existing Tablet parser as the fallback for filtered events and metadata read failures. - Retain the Tablet path for pub-sub mode, which must publish the full event stream. - Preserve TsFile event reference counting and close ownership across both paths. ### Tests - Added real non-aligned tree and aligned table TsFile coverage. - Covered statistics-backed values, BLOB last-chunk reads, TIMESTAMP schema preservation, DATE conversion, aligned time-column filtering, null values, and null table tags. - Spotless and Checkstyle pass; the 5 focused unit tests pass. <hr> This PR has: - [x] been self-reviewed. - [x] added Javadocs for non-trivial methods. - [x] added comments explaining non-obvious behavior. - [x] added unit tests covering the new code paths. <hr> ##### Key changed/added classes - `OpcUaSink` - `IoTDBOpcUaClient` - `OpcUaNameSpace` - `OpcUaSinkTsFileMetadataTest` - `OpcUaNameSpaceMetadataTest` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
