Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lookup model in console #15472

Merged
merged 4 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -383,6 +383,33 @@ exports[`LookupEditDialog matches snapshot 1`] = `
],
"type": "duration",
},
Object {
"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",
"placeholder": "30 (optional) ",
"required": false,
"suggestions": Array [],
"type": "number",
},
Object {
"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",
"placeholder": "60 (optional) ",
"required": false,
"suggestions": Array [],
"type": "number",
},
Object {
"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",
"placeholder": "10 (optional) ",
"required": false,
"suggestions": Array [],
"type": "number",
},
Object {
"defaultValue": 0,
"defined": [Function],
Expand Down
33 changes: 33 additions & 0 deletions web-console/src/druid-models/lookup-spec/lookup-spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -458,6 +461,36 @@ export const LOOKUP_FIELDS: Field<LookupSpec>[] = [
required: true,
suggestions: ['PT1M', 'PT10M', 'PT30M', 'PT1H', 'PT6H', 'P1D'],
},
{
name: 'extractionNamespace.jitterSeconds',
type: 'number',
placeholder: '30 (optional) ',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of setting the placeholder this you could just add defaultValue: 30 this basically sets the placeholder to 30. The (optional) label is not needed because visually when you open the form and there is a default value filled in as the placeholder it visually conveys "optional". The placeholder is really there for when you need to override the default behavior that I don't think you need to do here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed
Screenshot 2023-12-04 at 5 18 31 PM

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',
placeholder: '60 (optional) ',
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',
placeholder: '10 (optional) ',
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
{
Expand Down