From 82e3c61514a3e49661a0404414222d184d3fc89e Mon Sep 17 00:00:00 2001 From: Pranav Date: Tue, 5 Dec 2023 13:22:22 -0800 Subject: [PATCH] Update lookup model in console (#15472) * Update lookup model in console * ran prettify * move Defaults to info * setting defaultValue and removing placeholder --- .../lookup-edit-dialog.spec.tsx.snap | 27 +++++++++++++++ .../druid-models/lookup-spec/lookup-spec.tsx | 33 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/web-console/src/dialogs/lookup-edit-dialog/__snapshots__/lookup-edit-dialog.spec.tsx.snap b/web-console/src/dialogs/lookup-edit-dialog/__snapshots__/lookup-edit-dialog.spec.tsx.snap index e0c415d7bfd5..62407f56eaeb 100644 --- a/web-console/src/dialogs/lookup-edit-dialog/__snapshots__/lookup-edit-dialog.spec.tsx.snap +++ b/web-console/src/dialogs/lookup-edit-dialog/__snapshots__/lookup-edit-dialog.spec.tsx.snap @@ -383,6 +383,33 @@ exports[`LookupEditDialog matches snapshot 1`] = ` ], "type": "duration", }, + Object { + "defaultValue": 0, + "defined": [Function], + "info": "How much jitter to add (in seconds) up to maximum as a delay (actual value will be used as random from 0 to jitterSeconds), used to distribute db load more evenly. Default is 0.", + "name": "extractionNamespace.jitterSeconds", + "required": false, + "suggestions": Array [], + "type": "number", + }, + Object { + "defaultValue": 60, + "defined": [Function], + "info": "How much time (in seconds) it can take to query and populate lookup values. It will be helpful in lookup updates. On lookup update, it will wait maximum of \`loadTimeoutSeconds\` for new lookup to come up and continue serving from old lookup until new lookup successfully loads. Default is 60 Sec.", + "name": "extractionNamespace.loadTimeoutSeconds", + "required": false, + "suggestions": Array [], + "type": "number", + }, + Object { + "defaultValue": 10, + "defined": [Function], + "info": "The maximum percentage of heap size that the lookup should consume. If the lookup grows beyond this size, warning messages will be logged in the respective service logs. Default is 10 % of jvm size.", + "name": "extractionNamespace.maxHeapPercentage", + "required": false, + "suggestions": Array [], + "type": "number", + }, Object { "defaultValue": 0, "defined": [Function], diff --git a/web-console/src/druid-models/lookup-spec/lookup-spec.tsx b/web-console/src/druid-models/lookup-spec/lookup-spec.tsx index e1324ca77d2b..d187c839bc95 100644 --- a/web-console/src/druid-models/lookup-spec/lookup-spec.tsx +++ b/web-console/src/druid-models/lookup-spec/lookup-spec.tsx @@ -41,6 +41,9 @@ export interface ExtractionNamespaceSpec { readonly filter?: any; readonly tsColumn?: string; readonly pollPeriod?: number | string; + readonly jitterSeconds?: number; + readonly loadTimeoutSeconds?: number; + readonly maxHeapPercentage?: number; } export interface NamespaceParseSpec { @@ -458,6 +461,36 @@ export const LOOKUP_FIELDS: Field[] = [ required: true, suggestions: ['PT1M', 'PT10M', 'PT30M', 'PT1H', 'PT6H', 'P1D'], }, + { + name: 'extractionNamespace.jitterSeconds', + type: 'number', + defaultValue: 0, + defined: l => + oneOfKnown(deepGet(l, 'extractionNamespace.type'), KNOWN_EXTRACTION_NAMESPACE_TYPES, 'jdbc'), + info: 'How much jitter to add (in seconds) up to maximum as a delay (actual value will be used as random from 0 to jitterSeconds), used to distribute db load more evenly. Default is 0.', + required: false, + suggestions: [], + }, + { + name: 'extractionNamespace.loadTimeoutSeconds', + type: 'number', + defaultValue: 60, + defined: l => + oneOfKnown(deepGet(l, 'extractionNamespace.type'), KNOWN_EXTRACTION_NAMESPACE_TYPES, 'jdbc'), + info: 'How much time (in seconds) it can take to query and populate lookup values. It will be helpful in lookup updates. On lookup update, it will wait maximum of `loadTimeoutSeconds` for new lookup to come up and continue serving from old lookup until new lookup successfully loads. Default is 60 Sec.', + required: false, + suggestions: [], + }, + { + name: 'extractionNamespace.maxHeapPercentage', + type: 'number', + defaultValue: 10, + defined: l => + oneOfKnown(deepGet(l, 'extractionNamespace.type'), KNOWN_EXTRACTION_NAMESPACE_TYPES, 'jdbc'), + info: 'The maximum percentage of heap size that the lookup should consume. If the lookup grows beyond this size, warning messages will be logged in the respective service logs. Default is 10 % of jvm size.', + required: false, + suggestions: [], + }, // Extra cachedNamespace things {