hongzhi-gao opened a new pull request, #18860:
URL: https://github.com/apache/iotdb/pull/18860

   ## Description
   
   ### C++ Session API
   
   Add `Session::executeFastLastDataQueryForOnePrefixPath(const 
std::vector<std::string>& prefixes)` for tree-model prefix paths. The method 
returns the latest value of each non-template series below the prefix in a 1C1D 
deployment. Results have no guaranteed row order. The C++ client rejects 
wildcard path nodes before sending the request.
   
   ### RPC and result handling
   
   Reuse the existing `executeFastLastDataQueryForOnePrefixPath` Thrift RPC, 
matching the Java Session implementation. The connection layer sends fetch size 
and query redirection settings, refreshes session and statement IDs after 
reconnect, verifies the response status, and returns the existing 
`SessionDataSet` type. No Thrift IDL or server-side behavior changes are 
included. On a complete Last Cache hit, the server builds the response 
directly; on a cache miss, the server uses its existing ordinary Last Query 
fallback.
   
   ### Verification and performance
   
   The new C++ integration test covers latest values across multiple devices 
and sparse timestamps, a missing prefix, and wildcard rejection. It passed 
against a local 1C1D server: **1 test case, 16 assertions**. The same focused 
test passed on a separate test host. C++ session library and test targets built 
successfully, and `mvn -P with-cpp spotless:check -pl iotdb-client/client-cpp 
-q` passed.
   
   Performance workload: 400 devices × 100 aligned, non-template INT64 series 
(40,000 total), one written row per device. Before timing, the benchmark 
compared every Fast Last result with `SELECT LAST **` and completed 20 warm-up 
queries of each kind. Each sample measures the client call, reading all 40,000 
result rows, and closing the operation handle. Fast and ordinary queries were 
alternated. Both test deployments used the same 2.0.11-SNAPSHOT server 
distribution built from base commit `491d9b3590`.
   
   | 1C1D test environment | Query | Samples | Mean | P50 | P95 | P99 | Maximum 
| Over 100 ms |
   | --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
   | Storage host, 16 CPU / 31 GiB RAM, three runs | Fast Last | 300 | 56.84 ms 
| 55.74 ms | 61.02 ms | 62.51 ms | 83.31 ms | 0 |
   | Storage host, 16 CPU / 31 GiB RAM, three runs | Ordinary SQL Last | 300 | 
107.62 ms | 104.45 ms | 119.62 ms | 136.89 ms | 146.81 ms | 300 |
   | Shared test host, load approximately 10, one run | Fast Last | 100 | 92.97 
ms | 91.82 ms | 105.99 ms | 125.27 ms | 139.93 ms | 13 |
   | Shared test host, load approximately 10, one run | Ordinary SQL Last | 100 
| 190.46 ms | 186.25 ms | 231.07 ms | 248.55 ms | 252.26 ms | 100 |
   
   All benchmark runs verified equality for all 40,000 series. The design 
target of at most 100 ms after warm-up was met by every sample on the storage 
host; the shared host had 13 samples above 100 ms. These are end-to-end client 
measurements on warm data, not a concurrency or cold-cache guarantee.
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added comments describing the new public API and its constraints.
   - [x] added an integration test.
   - [x] been tested against a test IoTDB cluster.
   
   <hr>
   
   ##### Key changed/added classes (or packages if there are too many classes) 
in this PR
   
   - `Session` and `SessionConnection` in `iotdb-client/client-cpp`
   - `sessionIT.cpp` in `iotdb-client/client-cpp/test/cpp`
   


-- 
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]

Reply via email to