shounakmk219 opened a new pull request, #17459:
URL: https://github.com/apache/pinot/pull/17459
## Summary
This PR refactors `PinotTaskManager` to eliminate code duplication between
ad-hoc and scheduled task creation flows, and improves overall code readability
and maintainability.
## Changes
Extracted helper methods to reduce duplication between `createTask()`
(ad-hoc) and `scheduleTask()` (periodic) flows:
- `prepTaskQueue()` - Centralizes task queue preparation and metrics
initialization
- `getParentTaskName()` - Handles task name generation, validation, and
duplicate checking
- `getTableNameWithTypes()` - Extracts and validates table names with types
- `getTaskGenerator()` - Retrieves and validates task generator with
proper error handling
- `isExceedingResourceUtilizationLimits()` - Centralizes resource
utilization checking logic
- `acquireTaskLock()` - Unified distributed lock acquisition for both
ad-hoc and scheduled tasks
- `validatePinotTaskConfigs()` - Validates task configs and enforces
maximum subtask limits
- `submitTasks()` - Unified task submission logic for both flows
- `getTableNames()` - Helper to extract table names from table configs
--
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]