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

   ## Description
   
   Add `ITableSession.testInsert(Tablet)` to the Java table-model SDK, 
including sessions borrowed from `ITableSessionPool`. Tree-model sessions 
already expose test-insert APIs, but table-model callers currently have no 
equivalent public API for measuring client processing and RPC time without 
writing data.
   
   ### Behavior and example
   
   Given an empty `test_insert` table with `device STRING TAG`, `model STRING 
ATTRIBUTE`, and `value INT64 FIELD`, and a Tablet containing `(time=2, 
device=d2, model=m2, value=20)` and `(time=1, device=d1, model=m1, value=10)`:
   
   ```java
   session.testInsert(tablet); // Sends the request; SELECT returns zero rows.
   session.insert(tablet);     // Writes the same Tablet; SELECT ORDER BY time 
returns both rows.
   ```
   
   Before this change, `testInsert` is unavailable through `ITableSession`. 
After this change, the same call works for a direct table session and a session 
borrowed with `pool.getSession()`.
   
   This is a timing API, not a write-validation API: the existing server 
endpoint immediately returns success without validating the schema or executing 
an insert. It does not create tables or write data.
   
   ### Implementation
   
   - `TableSession` and `TableSessionWrapper` delegate to 
`Session.testInsertRelationalTablet`.
   - Reuse the existing Tablet request builder for sorting, null-column 
filtering, column categories, encoding, and optional compression; set 
`writeToTable=true` and invoke the existing 
`SessionConnection.testInsertTablet` RPC.
   - Ignore empty Tablets and requests with no remaining columns. Preserve the 
existing pool cleanup behavior on connection failures.
   - Use the default connection without device-based routing or leader-cache 
updates. Consequently, this measures request preparation and transport, not 
every part of the redirected real-insert path.
   - No server, Thrift, storage, or on-disk format changes. Adding a method to 
`ITableSession` requires third-party implementations to implement the new 
method.
   
   ### Verification
   
   Exactly one IT method is added: 
`IoTDBTableModelSessionIT#testInsertWithoutWriting`. It covers an empty Tablet, 
out-of-order timestamps, TAG/ATTRIBUTE/FIELD values, direct and pooled 
sessions, absence of writes after test-insert, and exact query results after a 
normal insert of the same Tablet.
   
   Executed on a fresh worktree based on upstream/master `ea7b4ffc5d`:
   
   - `python3 .github/scripts/check-it-selection.py` — passed; all 842 IT 
classes satisfy selection checks.
   - `mvn spotless:apply -o -pl 
iotdb-client/isession,iotdb-client/session,integration-test 
-Pwith-integration-tests -Ddevelocity.off=true` — passed.
   - `mvn verify -o -DskipUTs 
'-Dit.test=IoTDBTableModelSessionIT#testInsertWithoutWriting' 
-DfailIfNoTests=false -Dfailsafe.failIfNoSpecifiedTests=false -pl 
integration-test -am -PTableSimpleIT,with-integration-tests 
-Ddevelocity.off=true` — passed. Failsafe confirms exactly 1 IT, 0 failures, 0 
errors, and 0 skipped (1 ConfigNode + 1 DataNode).
   - `mvn test-compile -o -DskipTests -Ddevelocity.off=true` — full default 
reactor compilation passed.
   - `mvn test-compile -o -DskipTests -Pwith-zh-locale -Ddevelocity.off=true` — 
full Chinese-locale reactor compilation passed.
   - `git diff --check` — passed.
   
   The initial sandboxed IT build stopped because Maven could not write its 
cache; the unrestricted rerun above completed successfully. TableClusterIT, 
connection-failure injection, and performance benchmarks were not run. There is 
no claimed performance improvement; the new API reuses existing request 
preparation and retry mechanisms.
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added Javadocs for the new API and its behavior.
   - [x] added one integration test method.
   


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