-
Notifications
You must be signed in to change notification settings - Fork 58
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
added fix for jobs and cache Support for workbench ,MDS support #1739
added fix for jobs and cache Support for workbench ,MDS support #1739
Conversation
Signed-off-by: sumukhswamy <[email protected]>
Signed-off-by: sumukhswamy <[email protected]>
Signed-off-by: sumukhswamy <[email protected]>
...manage/accelerations/create_accelerations_flyout/selectors/selector_helpers/load_objects.tsx
Outdated
Show resolved
Hide resolved
...manage/accelerations/create_accelerations_flyout/selectors/selector_helpers/load_objects.tsx
Outdated
Show resolved
Hide resolved
public/components/datasources/components/manage/associated_objects/associated_objects_tab.tsx
Outdated
Show resolved
Hide resolved
public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx
Outdated
Show resolved
Hide resolved
const defaultCacheObject = { | ||
version: CATALOG_CACHE_VERSION, | ||
dataSources: [], | ||
dataSourceMDSId: '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to not change older tests to maintain BWC. Rather add new tests for new changes, the older ones should work as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, have updated the cache object now it only takes in the id if its present
return this.http | ||
.post('/api/observability/query/jobs', { | ||
body: JSON.stringify(params), | ||
query, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should merge the dataSourceMDSId
in post request body
, similar to
dashboards-observability/server/routes/custom_panels/panels_router.ts
Lines 338 to 344 in 3dbe5c8
body: schema.object({ | |
panelId: schema.string(), | |
query: schema.string(), | |
language: schema.string(), | |
to: schema.string(), | |
from: schema.string(), | |
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wanted the dataSourceMds id to be visible for the api call that is why it is outside
...nents/datasources/components/manage/associated_objects/associated_objects_details_flyout.tsx
Show resolved
Hide resolved
@@ -68,27 +74,34 @@ export class CatalogCacheManager { | |||
* Retrieves accelerations cache from local storage. | |||
* @returns {AccelerationsCacheData} The retrieved accelerations cache. | |||
*/ | |||
static getAccelerationsCache(): AccelerationsCacheData { | |||
static getAccelerationsCache(dataSourceMDSId?: string): AccelerationsCacheData { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we want to provide a default empty '' when there's no dataSourceMDSId passed. Then you don't have to check existance as well as using '|| '' ' in the following code.
this.saveAccelerationsCache(defaultCacheObject); | ||
return defaultCacheObject; | ||
const cachedAcclerationData = JSON.parse(accelerationCacheData); | ||
if (dataSourceMDSId && cachedAcclerationData.dataSourceMDSId === dataSourceMDSId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to trim 'dataSourceMDSId' ? what if value passed in is ' MDSId-123 ' and the actual id is 'MDSId-123'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think we are adding a space to the id anywhere, could you clarify from where the space is?
Signed-off-by: sumukhswamy <[email protected]>
f469fae
to
af04339
Compare
@@ -253,7 +255,7 @@ export const useLoadToCache = (loadCacheType: LoadCacheType) => { | |||
startPolling, | |||
stopPolling: stopLoading, | |||
} = usePolling<any, any>((params) => { | |||
return sqlService.fetchWithJobId(params); | |||
return sqlService.fetchWithJobId(params, dataSourceMDSClientId.current); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this still trigger request if dataSourceMDSId
is undefined and dataSourceMDSClientId.current
is empty string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to trigger it when it's undefined / empty string?
Signed-off-by: sumukhswamy <[email protected]>
30c533c
to
a241b90
Compare
Signed-off-by: sumukhswamy <[email protected]>
Signed-off-by: Sumukh Swamy <[email protected]>
databases: [], | ||
lastUpdated: currentTime, | ||
status: CachedDataSourceStatus.Failed, | ||
...(dataSourceMDSId && { dataSourceMDSId }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sumukhswamy Let's replace this with if logic at other places too.
Signed-off-by: Sumukh Swamy <[email protected]>
* cacahe updated to support MDS-client and added MDS support Signed-off-by: sumukhswamy <[email protected]> * addressed PR comments, added fix for jobs and cache Signed-off-by: sumukhswamy <[email protected]> * updated the tests, PR comments Signed-off-by: sumukhswamy <[email protected]> * addressed comments, fixed loading of flint datasources Signed-off-by: sumukhswamy <[email protected]> * added fix for cache and cahnged router Signed-off-by: sumukhswamy <[email protected]> * fixed linter Signed-off-by: sumukhswamy <[email protected]> --------- Signed-off-by: sumukhswamy <[email protected]> Signed-off-by: Sumukh Swamy <[email protected]> (cherry picked from commit 868ddcb) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* cacahe updated to support MDS-client and added MDS support Signed-off-by: sumukhswamy <[email protected]> * addressed PR comments, added fix for jobs and cache Signed-off-by: sumukhswamy <[email protected]> * updated the tests, PR comments Signed-off-by: sumukhswamy <[email protected]> * addressed comments, fixed loading of flint datasources Signed-off-by: sumukhswamy <[email protected]> * added fix for cache and cahnged router Signed-off-by: sumukhswamy <[email protected]> * fixed linter Signed-off-by: sumukhswamy <[email protected]> --------- Signed-off-by: sumukhswamy <[email protected]> Signed-off-by: Sumukh Swamy <[email protected]> (cherry picked from commit 868ddcb) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…) (#1784) * cacahe updated to support MDS-client and added MDS support * addressed PR comments, added fix for jobs and cache * updated the tests, PR comments * addressed comments, fixed loading of flint datasources * added fix for cache and cahnged router * fixed linter --------- (cherry picked from commit 868ddcb) Signed-off-by: sumukhswamy <[email protected]> Signed-off-by: Sumukh Swamy <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…) (#1783) * cacahe updated to support MDS-client and added MDS support * addressed PR comments, added fix for jobs and cache * updated the tests, PR comments * addressed comments, fixed loading of flint datasources * added fix for cache and cahnged router * fixed linter --------- (cherry picked from commit 868ddcb) Signed-off-by: sumukhswamy <[email protected]> Signed-off-by: Sumukh Swamy <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
added changes for cache loader, query workbench routes and mds support
Issues Resolved
link to previous PR
#1735
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.