Caideyipi opened a new pull request, #18384:
URL: https://github.com/apache/iotdb/pull/18384
## Description
Target `master`.
Cherry-pick #18380 from `dev/1.3`.
The OPC UA sink previously issued and awaited one `writeValue` RPC for every
measurement in a tablet. This change collects the writes for a tablet and sends
them through one `writeValues` request.
Missing-node recovery is preserved:
- inspect each returned status and collect only `Bad_NodeIdUnknown` writes;
- deduplicate shared nodes before calling `addNodes`;
- retry only the writes whose nodes were missing;
- continue to fail immediately on other bad statuses with measurement
context.
The cherry-pick keeps the compile-time i18n messages and `Tablet#setRowSize`
API used on `master`.
Unit tests cover a successful multi-measurement batch, missing-node creation
and selective retry, and a non-recoverable write status.
## Verification
```shell
mvn -o -nsu -pl iotdb-core/datanode \
-Ddevelocity.off=true \
-DskipTests \
clean test-compile
mvn -o -nsu -pl iotdb-core/datanode \
-Ddevelocity.off=true \
-Dtest=IoTDBOpcUaClientTest \
-Dsurefire.failIfNoSpecifiedTests=false \
surefire:test
```
Results:
- module main and test compilation passed;
- 3 tests run, 0 failures, 0 errors, 0 skipped;
- Checkstyle and Spotless passed;
- `git diff --check origin/master...HEAD` passed.
### Local synthetic benchmark
The local-only benchmark from #18380 compared the previous per-measurement
request pattern with the batch request under a simulated 5 ms response delay:
| Measurements per tablet | Previous RPCs | Batch RPCs | Previous median |
Batch median | Speedup |
| ---: | ---: | ---: | ---: | ---: | ---: |
| 100 | 100 | 1 | 1547.574 ms/tablet | 15.329 ms/tablet | 100.96x |
This is a synthetic RPC-count and latency comparison rather than a
measurement of production OPC UA server throughput.
<hr>
This PR has:
- [x] been self-reviewed.
- [x] added unit tests for the new batch and recovery paths.
<hr>
##### Key changed/added classes
- `IoTDBOpcUaClient`
- `IoTDBOpcUaClientTest`
--
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]