Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ const CURRENT_YEAR = new Date().getUTCFullYear();

export interface IngestionSpec {
readonly type: IngestionType;
readonly id?: string;
readonly spec: IngestionSpecInner;
readonly context?: { useConcurrentLocks?: boolean };
readonly suspended?: boolean;

// Added by the server
readonly id?: string;
readonly groupId?: string;
readonly resource?: any;
}
Expand Down
4 changes: 4 additions & 0 deletions web-console/src/helpers/spec-conversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export function getSpecDatasourceName(spec: Partial<IngestionSpec>): string | un
return deepGet(spec, 'spec.dataSchema.dataSource');
}

export function getSpecSupervisorId(spec: Partial<IngestionSpec>): string | undefined {
return typeof spec.id === 'string' ? spec.id : getSpecDatasourceName(spec);
}

function convertFilter(filter: any): SqlExpression {
switch (filter.type) {
case 'selector':
Expand Down
18 changes: 16 additions & 2 deletions web-console/src/views/load-data-view/load-data-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ import {
updateSchemaWithSample,
upgradeSpec,
} from '../../druid-models';
import { getSpecDatasourceName } from '../../helpers';
import { getSpecDatasourceName, getSpecSupervisorId } from '../../helpers';
import { getLink } from '../../links';
import { Api, AppToaster, UrlBaser } from '../../singletons';
import {
Expand Down Expand Up @@ -3386,6 +3386,20 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
</>
),
},
{
name: 'id',
label: 'Supervisor ID',
type: 'string',
defined: isStreamingSpec,
placeholder: '(default to the datasource name if not set)',
info: (
<p>
The ID of the supervisor that will manage the ingestion. This should generally
be set to the datasource name (the default if left unset) unless you are setting
up multiple supervisors for the same datasource.
</p>
),
},
{
name: 'spec.ioConfig.appendToExisting',
label: 'Append to existing',
Expand Down Expand Up @@ -3568,7 +3582,7 @@ export class LoadDataView extends React.PureComponent<LoadDataViewProps, LoadDat
}

let currentSupervisorSpec: Partial<IngestionSpec> | undefined;
const supervisorId = getSpecDatasourceName(spec);
const supervisorId = getSpecSupervisorId(spec);
if (isStreamingSpec(spec) && supervisorId) {
try {
currentSupervisorSpec = cleanSpec(
Expand Down
Loading