Removed org.apache.druid.discovery.BrokerClient by switching to org.apache.druid.sql.client.BrokerClient. Also upgraded SegmentLoadStatusFetcherTest to reflect changes. #17470
This PR updates the SegmentLoadStatusFetcher to use the new SQL package's BrokerClient implementation, replacing the deprecated discovery-based BrokerClient. This change improves code maintainability and aligns with Druid's ongoing modernization efforts.
Migrated BrokerClient Implementation
Replaced deprecated org.apache.druid.discovery.BrokerClient with org.apache.druid.sql.client.BrokerClient
Updated SQL task handling to use proper task state management through SqlTaskStatus
Fixed locale-dependent string formatting by using StringUtils.format
Updated Test Framework
Refactored SegmentLoadStatusFetcherTest to properly mock SQL task lifecycle
Added proper task state transitions (RUNNING → SUCCESS) in test cases
Maintained existing test coverage while adapting to new API
Release note
Migrated Multi-Stage Query's segment load status checking to use the new SQL package's BrokerClient, removing dependency on the deprecated discovery-based implementation. This change improves code maintainability and provides better SQL task state handling.
Description
This PR updates the
SegmentLoadStatusFetcher
to use the new SQL package'sBrokerClient
implementation, replacing the deprecated discovery-basedBrokerClient
. This change improves code maintainability and aligns with Druid's ongoing modernization efforts.Migrated BrokerClient Implementation
org.apache.druid.discovery.BrokerClient
withorg.apache.druid.sql.client.BrokerClient
SqlTaskStatus
StringUtils.format
Updated Test Framework
SegmentLoadStatusFetcherTest
to properly mock SQL task lifecycleRelease note
Migrated Multi-Stage Query's segment load status checking to use the new SQL package's BrokerClient, removing dependency on the deprecated discovery-based implementation. This change improves code maintainability and provides better SQL task state handling.
Key changed/added classes in this PR
org.apache.druid.msq.exec.SegmentLoadStatusFetcher
org.apache.druid.msq.exec.SegmentLoadStatusFetcherTest
This PR has:
Design Decisions:
Task State Management:
TaskState
for explicit state trackingTest Structure:
Error Handling:
SqlTaskStatus