9aman opened a new pull request, #20010:
URL: https://github.com/apache/pinot/pull/20010

   ## Problem
   `RetentionManager` reads all segment ZK metadata of a table and lists the 
table data dir inside private methods. A subclass that adds per-table work, for 
example a consistency check on the same listing, must repeat both reads. On a 
large table this doubles the ZK round trips and the listing time of each run.
   
   ## Change
   - Add `TableRunContext`, one object per `processTable` call. It reads the 
segment ZK metadata list and the deep-store directory listing on first use and 
memoizes them. The object lives for one call, so the memory for one table is 
released before the next table is processed.
   - Add `processTable(TableConfig, TableRunContext)` as the overridable 
per-table step. The default body runs the same three steps as before.
   - Move the directory listing to `listDeepStoreTableDir(URI)`. The 
untracked-segment sweep reads the listing from the context. The gate for a 
missing data dir and all deletion rules do not change.
   - Add a unit test. It overrides the new step, reads both snapshots from the 
context, and verifies one ZK metadata read and one listing for the table.
   
   ## Behavior
   No functional change. The log line `Found: N segments in deepstore ...` now 
names the directory and comes from the listing method.
   
   ## Testing
   `RetentionManagerTest` (58 tests) passes on JDK 25.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to