suvodeep-pyne opened a new pull request, #17023:
URL: https://github.com/apache/pinot/pull/17023

   ## Summary
   
   This PR refactors the segment reload functionality in the Pinot controller 
by extracting the core business logic from `PinotTableReloadResource` into a 
new dedicated service class `PinotTableReloadService`.
   
   ## Changes
   
   - **New service class**: Created `PinotTableReloadService` as a singleton 
service to handle all segment reload operations
   - **Separation of concerns**: Moved business logic out of the REST resource 
class, leaving it to handle only HTTP concerns
   - **Dependency injection**: Updated `BaseControllerStarter` to bind the new 
service as a singleton
   - **Cleaner resource class**: `PinotTableReloadResource` now delegates all 
reload operations to the service layer
   - **Maintained functionality**: All existing reload APIs continue to work 
exactly as before with no behavioral changes
   
   ## Benefits
   
   - Improved testability: Service logic can now be unit tested independently 
of JAX-RS concerns
   - Better separation of concerns: REST layer handles HTTP, service layer 
handles business logic
   - Enhanced maintainability: Clear boundaries between API and business logic
   - Easier to extend: Future reload-related features can be added to the 
service class
   
   ## Test Plan
   
   - Existing unit tests continue to pass
   - Manual testing of reload APIs confirms no functional changes
   - All reload endpoints (`/segments/{tableName}/{segmentName}/reload`, 
`/segments/{tableName}/reload`, `/reloadStatus/{jobId}`, 
`/segments/{tableNameWithType}/checkReload`) work as expected


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