Caideyipi opened a new pull request, #18240:
URL: https://github.com/apache/iotdb/pull/18240

   ## Description
   
   ### Lazily compose last-cache values on row inserts
   
   - Introduce a lazy last-cache update source implemented by row insert nodes.
   - Create TimeValuePair and TsPrimitiveType objects only when the target 
last-cache entry exists and its timestamp is eligible for update.
   - Replace the ordinary update path's per-call AtomicInteger and 
per-measurement capturing lambdas with conditional ConcurrentMap.replace loops.
   - Avoid constructing candidate device/schema cache entries when the write 
path is not allowed to create cache entries.
   
   ### Reuse Pipe insert-node estimation state
   
   - Reuse the identity-deduplication set across estimates on each write thread.
   - Clear the set in finally blocks while preserving the exact composite-node 
traversal.
   - Drop sets larger than 1024 entries to avoid retaining unusually large hash 
tables on every write thread.
   - Keep the event-level cached RAM estimate, so reference-count increase and 
decrease do not repeat the traversal.
   
   ### Verification
   
   - mvn spotless:apply -pl iotdb-core/datanode
   - mvn -o checkstyle:check -pl iotdb-core/datanode
   - TableDeviceLastCacheTest: 3 tests passed, including lazy value composition 
coverage
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
       - [x] concurrent read
       - [x] concurrent write
       - [x] concurrent read and write
   - [x] added Javadocs for the new lazy update source.
   - [x] added comments explaining the reuse and retention policy.
   - [x] added or modified unit tests to cover the new last-cache path.
   
   <hr>
   
   ##### Key changed/added classes
   
   - InsertRowNode / RelationalInsertRowNode
   - LastCacheUpdateSource
   - TableDeviceLastCache / TableDeviceSchemaCache
   - InsertNodeMemoryEstimator


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