This is an automated email from the ASF dual-hosted git repository.
lakshsingla pushed a commit to branch 29.0.0
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/29.0.0 by this push:
new 8ed01f73355 [Backport] Web console: update to core Druid changes
(#15866)
8ed01f73355 is described below
commit 8ed01f733550e5ff6a6444dd6db212072631e734
Author: Laksh Singla <[email protected]>
AuthorDate: Fri Feb 9 14:20:59 2024 +0530
[Backport] Web console: update to core Druid changes (#15866)
---
docs/data-management/automatic-compaction.md | 2 +-
docs/ingestion/concurrent-append-replace.md | 4 +-
web-console/lib/keywords.js | 2 +
.../compaction-config-dialog.spec.tsx.snap | 124 +++++++++++++++++----
.../compaction-config-dialog.tsx | 54 +++++++--
.../druid-models/ingestion-spec/ingestion-spec.tsx | 9 +-
.../src/views/load-data-view/load-data-view.tsx | 50 ++++++---
7 files changed, 185 insertions(+), 60 deletions(-)
diff --git a/docs/data-management/automatic-compaction.md
b/docs/data-management/automatic-compaction.md
index 816c6e35d5f..4fe49f8beb5 100644
--- a/docs/data-management/automatic-compaction.md
+++ b/docs/data-management/automatic-compaction.md
@@ -157,7 +157,7 @@ You can use concurrent append and replace to safely replace
the existing data in
To do this, you need to update your datasource to allow concurrent append and
replace tasks:
* If you're using the API, include the following `taskContext` property in
your API call: `"useConcurrentLocks": true`
-* If you're using the UI, enable **Allow concurrent compactions
(experimental)** in the **Compaction config** for your datasource.
+* If you're using the UI, enable **Use concurrent locks (experimental)** in
the **Compaction config** for your datasource.
You'll also need to update your ingestion jobs for the datasource to include
the task context `"useConcurrentLocks": true`.
diff --git a/docs/ingestion/concurrent-append-replace.md
b/docs/ingestion/concurrent-append-replace.md
index 63a47d35545..3b7b74f7571 100644
--- a/docs/ingestion/concurrent-append-replace.md
+++ b/docs/ingestion/concurrent-append-replace.md
@@ -36,7 +36,7 @@ If you want to append data to a datasource while compaction
is running, you need
### Update the compaction settings with the UI
-In the **Compaction config** for a datasource, enable **Allow concurrent
compactions (experimental)**.
+In the **Compaction config** for a datasource, enable **Use concurrent locks
(experimental)**.
For details on accessing the compaction config in the UI, see [Enable
automatic compaction with the web
console](../data-management/automatic-compaction.md#web-console).
@@ -63,7 +63,7 @@ You can provide the context parameter like any other
parameter for ingestion job
### Add a task lock using the Druid console
-As part of the **Load data** wizard for classic batch (JSON-based ingestion)
and streaming ingestion, enable the following config on the **Publish** step:
**Allow concurrent tasks (experimental)**.
+As part of the **Load data** wizard for classic batch (JSON-based ingestion)
and streaming ingestion, enable the following config on the **Publish** step:
**Use concurrent locks (experimental)**.
### Add the task lock through the API
diff --git a/web-console/lib/keywords.js b/web-console/lib/keywords.js
index b22af5f422a..62dec991f86 100644
--- a/web-console/lib/keywords.js
+++ b/web-console/lib/keywords.js
@@ -68,6 +68,8 @@ exports.SQL_KEYWORDS = [
'PRECEDING',
'FOLLOWING',
'EXTEND',
+ 'PIVOT',
+ 'UNPIVOT',
];
exports.SQL_EXPRESSION_PARTS = [
diff --git
a/web-console/src/dialogs/compaction-config-dialog/__snapshots__/compaction-config-dialog.spec.tsx.snap
b/web-console/src/dialogs/compaction-config-dialog/__snapshots__/compaction-config-dialog.spec.tsx.snap
index 7bb67d84f97..2c057819387 100644
---
a/web-console/src/dialogs/compaction-config-dialog/__snapshots__/compaction-config-dialog.spec.tsx.snap
+++
b/web-console/src/dialogs/compaction-config-dialog/__snapshots__/compaction-config-dialog.spec.tsx.snap
@@ -350,11 +350,32 @@ exports[`CompactionConfigDialog matches snapshot with
compactionConfig (dynamic
}
onChange={[Function]}
/>
- <Blueprint4.Switch
- checked={false}
- label="Allow concurrent compactions (experimental)"
- onChange={[Function]}
- />
+ <Memo(FormGroupWithInfo)
+ info={
+ <Memo(PopoverText)>
+ <p>
+ If you want to append data to a datasource while compaction is
running, you need to enable concurrent append and replace for the datasource by
updating the compaction settings.
+ </p>
+ <p>
+ For more information refer to the
+
+ <Memo(ExternalLink)
+
href="https://druid.apache.org/docs/29.0.0/ingestion/concurrent-append-replace.html"
+ >
+ documentation
+ </Memo(ExternalLink)>
+ .
+ </p>
+ </Memo(PopoverText)>
+ }
+ inlineInfo={true}
+ >
+ <Blueprint4.Switch
+ checked={false}
+ label="Use concurrent locks (experimental)"
+ onChange={[Function]}
+ />
+ </Memo(FormGroupWithInfo)>
</React.Fragment>
</div>
<div
@@ -739,11 +760,32 @@ exports[`CompactionConfigDialog matches snapshot with
compactionConfig (hashed p
}
onChange={[Function]}
/>
- <Blueprint4.Switch
- checked={false}
- label="Allow concurrent compactions (experimental)"
- onChange={[Function]}
- />
+ <Memo(FormGroupWithInfo)
+ info={
+ <Memo(PopoverText)>
+ <p>
+ If you want to append data to a datasource while compaction is
running, you need to enable concurrent append and replace for the datasource by
updating the compaction settings.
+ </p>
+ <p>
+ For more information refer to the
+
+ <Memo(ExternalLink)
+
href="https://druid.apache.org/docs/29.0.0/ingestion/concurrent-append-replace.html"
+ >
+ documentation
+ </Memo(ExternalLink)>
+ .
+ </p>
+ </Memo(PopoverText)>
+ }
+ inlineInfo={true}
+ >
+ <Blueprint4.Switch
+ checked={false}
+ label="Use concurrent locks (experimental)"
+ onChange={[Function]}
+ />
+ </Memo(FormGroupWithInfo)>
</React.Fragment>
</div>
<div
@@ -1128,11 +1170,32 @@ exports[`CompactionConfigDialog matches snapshot with
compactionConfig (range pa
}
onChange={[Function]}
/>
- <Blueprint4.Switch
- checked={false}
- label="Allow concurrent compactions (experimental)"
- onChange={[Function]}
- />
+ <Memo(FormGroupWithInfo)
+ info={
+ <Memo(PopoverText)>
+ <p>
+ If you want to append data to a datasource while compaction is
running, you need to enable concurrent append and replace for the datasource by
updating the compaction settings.
+ </p>
+ <p>
+ For more information refer to the
+
+ <Memo(ExternalLink)
+
href="https://druid.apache.org/docs/29.0.0/ingestion/concurrent-append-replace.html"
+ >
+ documentation
+ </Memo(ExternalLink)>
+ .
+ </p>
+ </Memo(PopoverText)>
+ }
+ inlineInfo={true}
+ >
+ <Blueprint4.Switch
+ checked={false}
+ label="Use concurrent locks (experimental)"
+ onChange={[Function]}
+ />
+ </Memo(FormGroupWithInfo)>
</React.Fragment>
</div>
<div
@@ -1517,11 +1580,32 @@ exports[`CompactionConfigDialog matches snapshot
without compactionConfig 1`] =
}
onChange={[Function]}
/>
- <Blueprint4.Switch
- checked={false}
- label="Allow concurrent compactions (experimental)"
- onChange={[Function]}
- />
+ <Memo(FormGroupWithInfo)
+ info={
+ <Memo(PopoverText)>
+ <p>
+ If you want to append data to a datasource while compaction is
running, you need to enable concurrent append and replace for the datasource by
updating the compaction settings.
+ </p>
+ <p>
+ For more information refer to the
+
+ <Memo(ExternalLink)
+
href="https://druid.apache.org/docs/29.0.0/ingestion/concurrent-append-replace.html"
+ >
+ documentation
+ </Memo(ExternalLink)>
+ .
+ </p>
+ </Memo(PopoverText)>
+ }
+ inlineInfo={true}
+ >
+ <Blueprint4.Switch
+ checked={false}
+ label="Use concurrent locks (experimental)"
+ onChange={[Function]}
+ />
+ </Memo(FormGroupWithInfo)>
</React.Fragment>
</div>
<div
diff --git
a/web-console/src/dialogs/compaction-config-dialog/compaction-config-dialog.tsx
b/web-console/src/dialogs/compaction-config-dialog/compaction-config-dialog.tsx
index ec2135e43aa..6ff324f77fb 100644
---
a/web-console/src/dialogs/compaction-config-dialog/compaction-config-dialog.tsx
+++
b/web-console/src/dialogs/compaction-config-dialog/compaction-config-dialog.tsx
@@ -20,12 +20,20 @@ import { Button, Callout, Classes, Code, Dialog, Intent,
Switch } from '@bluepri
import React, { useState } from 'react';
import type { FormJsonTabs } from '../../components';
-import { AutoForm, FormJsonSelector, JsonInput } from '../../components';
+import {
+ AutoForm,
+ ExternalLink,
+ FormGroupWithInfo,
+ FormJsonSelector,
+ JsonInput,
+ PopoverText,
+} from '../../components';
import type { CompactionConfig } from '../../druid-models';
import {
COMPACTION_CONFIG_FIELDS,
compactionConfigHasLegacyInputSegmentSizeBytesSet,
} from '../../druid-models';
+import { getLink } from '../../links';
import { deepDelete, deepGet, deepSet, formatBytesCompact } from '../../utils';
import { CompactionHistoryDialog } from
'../compaction-history-dialog/compaction-history-dialog';
@@ -102,17 +110,39 @@ export const CompactionConfigDialog = React.memo(function
CompactionConfigDialog
model={currentConfig}
onChange={m => setCurrentConfig(m as CompactionConfig)}
/>
- <Switch
- label="Allow concurrent compactions (experimental)"
- checked={typeof deepGet(currentConfig,
'taskContext.taskLockType') === 'string'}
- onChange={() => {
- setCurrentConfig(
- (typeof deepGet(currentConfig, 'taskContext.taskLockType')
=== 'string'
- ? deepDelete(currentConfig, 'taskContext.taskLockType')
- : deepSet(currentConfig, 'taskContext.taskLockType',
'REPLACE')) as any,
- );
- }}
- />
+ <FormGroupWithInfo
+ inlineInfo
+ info={
+ <PopoverText>
+ <p>
+ If you want to append data to a datasource while
compaction is running, you need
+ to enable concurrent append and replace for the datasource
by updating the
+ compaction settings.
+ </p>
+ <p>
+ For more information refer to the{' '}
+ <ExternalLink
+
href={`${getLink('DOCS')}/ingestion/concurrent-append-replace.html`}
+ >
+ documentation
+ </ExternalLink>
+ .
+ </p>
+ </PopoverText>
+ }
+ >
+ <Switch
+ label="Use concurrent locks (experimental)"
+ checked={Boolean(deepGet(currentConfig,
'taskContext.useConcurrentLocks'))}
+ onChange={() => {
+ setCurrentConfig(
+ (deepGet(currentConfig, 'taskContext.useConcurrentLocks')
+ ? deepDelete(currentConfig,
'taskContext.useConcurrentLocks')
+ : deepSet(currentConfig,
'taskContext.useConcurrentLocks', true)) as any,
+ );
+ }}
+ />
+ </FormGroupWithInfo>
</>
) : (
<JsonInput
diff --git a/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx
b/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx
index eac783baf9e..54a1cb241c6 100644
--- a/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx
+++ b/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx
@@ -72,7 +72,7 @@ const CURRENT_YEAR = new Date().getUTCFullYear();
export interface IngestionSpec {
readonly type: IngestionType;
readonly spec: IngestionSpecInner;
- readonly context?: { taskLockType?: 'APPEND' | 'REPLACE' };
+ readonly context?: { useConcurrentLocks?: boolean };
readonly suspended?: boolean;
}
@@ -438,13 +438,6 @@ export function normalizeSpec(spec:
Partial<IngestionSpec>): IngestionSpec {
spec = deepSetIfUnset(spec, 'spec.ioConfig.type', specType);
spec = deepSetIfUnset(spec, 'spec.tuningConfig.type', specType);
- if (spec.context?.taskLockType !== undefined) {
- spec.context.taskLockType =
- isStreamingSpec(spec) || deepGet(spec, 'spec.ioConfig.appendToExisting')
- ? 'APPEND'
- : 'REPLACE';
- }
-
return spec as IngestionSpec;
}
diff --git a/web-console/src/views/load-data-view/load-data-view.tsx
b/web-console/src/views/load-data-view/load-data-view.tsx
index ef3fb8ec838..4f748ad945a 100644
--- a/web-console/src/views/load-data-view/load-data-view.tsx
+++ b/web-console/src/views/load-data-view/load-data-view.tsx
@@ -3254,23 +3254,39 @@ export class LoadDataView extends
React.PureComponent<LoadDataViewProps, LoadDat
model={spec}
onChange={this.updateSpec}
/>
- <Switch
- label="Allow concurrent tasks (experimental)"
- checked={typeof deepGet(spec, 'context.taskLockType') === 'string'}
- onChange={() => {
- this.updateSpec(
- typeof deepGet(spec, 'context.taskLockType') === 'string'
- ? deepDelete(spec, 'context.taskLockType')
- : deepSet(
- spec,
- 'context.taskLockType',
- isStreamingSpec(spec) || deepGet(spec,
'spec.ioConfig.appendToExisting')
- ? 'APPEND'
- : 'REPLACE',
- ),
- );
- }}
- />
+ <FormGroupWithInfo
+ inlineInfo
+ info={
+ <PopoverText>
+ <p>
+ If you want to append data to a datasource while compaction
is running, you need
+ to enable concurrent append and replace for the datasource
by updating the
+ compaction settings.
+ </p>
+ <p>
+ For more information refer to the{' '}
+ <ExternalLink
+
href={`${getLink('DOCS')}/ingestion/concurrent-append-replace.html`}
+ >
+ documentation
+ </ExternalLink>
+ .
+ </p>
+ </PopoverText>
+ }
+ >
+ <Switch
+ label="Use concurrent locks (experimental)"
+ checked={Boolean(deepGet(spec, 'context.useConcurrentLocks'))}
+ onChange={() => {
+ this.updateSpec(
+ deepGet(spec, 'context.useConcurrentLocks')
+ ? deepDelete(spec, 'context.useConcurrentLocks')
+ : deepSet(spec, 'context.useConcurrentLocks', true),
+ );
+ }}
+ />
+ </FormGroupWithInfo>
</div>
<div className="other">
<H5>Parse error reporting</H5>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]