Implementation:Apache Druid Supervisor Lifecycle Api
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Streaming_Ingestion, Operations |
| Last Updated | 2026-02-10 00:00 GMT |
Overview
Concrete API integration for managing streaming supervisor lifecycle operations through the Druid Supervisor REST API.
Description
The supervisor lifecycle management spans two main components:
- SupervisorsView (L590-L757): Renders action dialogs for individual supervisor operations using AsyncActionDialog for confirmation and execution. Actions include resume, suspend, hard reset, terminate, and set offsets.
- SupervisorResetOffsetsDialog (L97-L246): Specialized dialog for manually setting consumer offsets/sequence numbers per partition, with type-specific labels (offsets for Kafka, sequence numbers for Kinesis).
Bulk operations (L1194-L1270) provide fleet-wide suspend, resume, and terminate for all supervisors.
Usage
These operations are triggered from the supervisor row context menu in the Supervisors view. Each operation shows a confirmation dialog via AsyncActionDialog before executing.
Code Reference
Source Location
- Repository: Apache Druid
- File: web-console/src/views/supervisors-view/supervisors-view.tsx (L590-L757, L1194-L1270)
- File: web-console/src/dialogs/supervisor-reset-offsets-dialog/supervisor-reset-offsets-dialog.tsx (L97-L246)
Signature
// Individual supervisor actions:
Api.instance.post(`/druid/indexer/v1/supervisor/${id}/resume`)
Api.instance.post(`/druid/indexer/v1/supervisor/${id}/suspend`)
Api.instance.post(`/druid/indexer/v1/supervisor/${id}/reset`)
Api.instance.post(`/druid/indexer/v1/supervisor/${id}/terminate`)
Api.instance.post(`/druid/indexer/v1/supervisor/${id}/resetOffsets`, {
type: supervisorType, // 'kafka' or 'kinesis'
partitions: {
type: 'end',
stream: streamName,
partitionOffsetMap: { '0': 12345, '1': 12340 },
},
})
// Bulk actions:
Api.instance.post('/druid/indexer/v1/supervisor/resumeAll')
Api.instance.post('/druid/indexer/v1/supervisor/suspendAll')
Api.instance.post('/druid/indexer/v1/supervisor/terminateAll')
Import
import { Api } from '../../singletons';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| supervisorId | string | Yes | Target supervisor ID |
| supervisorType | string | No | 'kafka' or 'kinesis' (for resetOffsets) |
| partitionOffsetMap | Record<string, number> | No | Partition-to-offset mapping (for resetOffsets) |
Outputs
| Name | Type | Description |
|---|---|---|
| Success/Error | toast notification | Action result shown via AppToaster |
Usage Examples
Supervisor Operations
import { Api } from '../../singletons';
// Suspend a supervisor:
await Api.instance.post('/druid/indexer/v1/supervisor/my-kafka-supervisor/suspend');
// Resume:
await Api.instance.post('/druid/indexer/v1/supervisor/my-kafka-supervisor/resume');
// Reset offsets to specific positions:
await Api.instance.post('/druid/indexer/v1/supervisor/my-kafka-supervisor/resetOffsets', {
type: 'kafka',
partitions: {
type: 'end',
stream: 'events-topic',
partitionOffsetMap: { '0': 1000, '1': 2000, '2': 1500 },
},
});
// Terminate permanently:
await Api.instance.post('/druid/indexer/v1/supervisor/my-kafka-supervisor/terminate');
Related Pages
Implements Principle
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment