Implementation:Apache Druid CompactionHistoryDialog
| Knowledge Sources | |
|---|---|
| Domains | Web_Console, Compaction |
| Last Updated | 2026-02-10 10:00 GMT |
Overview
A React dialog component that displays the audit history of compaction configurations for a specific datasource, with diff comparison support.
Description
CompactionHistoryDialog is a memoized React component that renders a Blueprint.js Dialog showing up to 20 historical compaction configuration entries for a given datasource. It fetches history from the /druid/indexer/v1/compaction/config/datasources/{datasource}/history API endpoint. Each history entry is displayed in a vertical Tabs layout with the audit timestamp as the tab title. The panel for each entry shows the serialized JSON configuration (via ShowValue), an optional global config popover (displaying compactionTaskSlotRatio, maxCompactionTaskSlots, useAutoScaleSlots), and a "diff with previous" button that opens a DiffDialog for comparing successive configuration versions.
Usage
This dialog is opened from within the CompactionConfigDialog when the user clicks the "History" button, allowing them to review and compare past compaction configuration changes for the selected datasource.
Code Reference
Source Location
- Repository: Apache Druid
- File: web-console/src/dialogs/compaction-history-dialog/compaction-history-dialog.tsx
- Lines: 1-156
Signature
export interface CompactionHistoryDialogProps {
datasource: string;
onClose(): void;
}
export const CompactionHistoryDialog = React.memo(function CompactionHistoryDialog(
props: CompactionHistoryDialogProps,
): JSX.Element)
Import
import { CompactionHistoryDialog } from '../compaction-history-dialog/compaction-history-dialog';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| datasource | string |
Yes | Name of the datasource whose compaction history to display |
| onClose | () => void |
Yes | Callback invoked when the dialog is closed |
Outputs
| Name | Type | Description |
|---|---|---|
| JSX.Element | React element | Renders a dialog with vertical tabs listing historical compaction configs by audit timestamp, each with JSON display, optional global config popover, diff-with-previous capability, and a Close button |
Usage Examples
Opening the compaction history dialog
{showHistory && (
<CompactionHistoryDialog
datasource="wikipedia"
onClose={() => setShowHistory(false)}
/>
)}