SpriCoder opened a new pull request, #17817:
URL: https://github.com/apache/iotdb/pull/17817
## Summary
Backports #17800 (*C++ client: add thread-safe SessionPool, enable RPC
compression, and harden buffers*) from `master` to `dev/1.3`.
The PR contains two commits:
1. **Cherry-pick of #17800** (`d9fdf0c`). Three files conflicted and were
resolved keeping the existing `dev/1.3` code style and naming:
- `Common.cpp` — applied the functional fix only (`str.assign` →
`str.append` in `MyStringBuffer::putOrderedByte`).
- `Session.h` — kept the `dev/1.3` `Tablet` (member name
`idColumnIndexes`, no `addBinaryValueWithMeta` overload, which does not exist
on this branch); applied only the relevant changes: add `#include <cstdio>` and
switch the two `addValue` bounds-check messages from `sprintf` to `snprintf`
(bounded by `sizeof` with `(long)` casts).
- `sessionIT.cpp` — added `#include "SessionPool.h"` and the three new
`[sessionPool]` test cases. Dropped the unrelated master-only
`SessionBuilder.h` include and the `Numeric column widening getters` test,
neither of which belongs to #17800 on this branch.
2. **Adapt SessionPool to dev/1.3 APIs** (`eabde55`). The cherry-picked
`SessionPool` targeted master's expanded `AbstractSessionBuilder` (the
`DEFAULT_*` constants plus `nodeUrls` / `connectTimeoutMs` / `useSSL` /
`trustCertFilePath` fields), none of which exist on `dev/1.3`, so the C++
client did not compile. This commit touches **only the newly added
`SessionPool.h` / `SessionPool.cpp`** — no existing `dev/1.3` interface or
implementation is changed:
- Replace `AbstractSessionBuilder::DEFAULT_*` with `dev/1.3`'s literal
defaults.
- Keep `connectTimeoutMs` (still applied via `Session::open()`).
- Drop the multi-node (`nodeUrls`) constructor and the SSL options
(`useSSL` / `trustCertFilePath`), because `dev/1.3`'s
`Session(AbstractSessionBuilder*)` wires neither and would silently ignore them.
## Test plan
- [x] `SessionPool.cpp`, `Common.cpp`, and a TU exercising the full
`SessionPool` public API plus `Tablet::addValue` compile cleanly (`-std=c++11
-Wall`, exit 0) against `dev/1.3` headers + generated Thrift headers + Boost.
- [x] The new `[sessionPool]` integration tests use only the preserved
single-host API; no other code consumes the removed (multi-node / SSL) APIs.
- [ ] Full Maven C++ client build + run the `[sessionPool]` integration
tests against a live `dev/1.3` server.
--
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]