-
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
Add datasource field in accelerations cache #1525
Conversation
Signed-off-by: Shenoy Pratik <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1525 +/- ##
==========================================
+ Coverage 56.62% 56.94% +0.31%
==========================================
Files 348 348
Lines 12656 12675 +19
Branches 3202 3206 +4
==========================================
+ Hits 7167 7218 +51
+ Misses 5436 5404 -32
Partials 53 53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
LGTM. Lets merge this, so that I can use the changes in #1521.
accelerations: [], | ||
lastUpdated: '', | ||
status: CachedDataSourceStatus.Empty, | ||
dataSources: [], |
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.
This is because the dataSources: []
contains the above?
accelerations: [],
lastUpdated: '',
status: CachedDataSourceStatus.Empty,
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!
@@ -83,19 +83,19 @@ export interface CachedColumn { | |||
|
|||
export interface CachedTable { | |||
name: string; | |||
columns: CachedColumn[]; | |||
columns?: CachedColumn[]; |
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.
Why optional here?
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.
Cause columns are lazy loaded for tables. These will be loaded in cache when users open table flyout
or use a table in create acceleration flyout
.
@@ -189,6 +188,7 @@ export const useLoadToCache = (loadCacheType: LoadCacheType) => { | |||
}, ASYNC_POLLING_INTERVAL); | |||
|
|||
const startLoading = (dataSourceName: string, databaseName?: string) => { | |||
setLoadStatus(DirectQueryLoadingStatus.SCHEDULED); |
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.
is this meaning that, SCHEDULED
means loading? For example, instead of checking if it is SUCCESS
, FAILED
, or CANCELLED
, I can use this as an indicator to see if it is at a loading/refreshing stage?
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.
this is added as we want to start with status as scheduled whenever the startpolling
is called. Otherwise, it keep the old calls status.
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.
SCHEDULED
is the initial state, it may not necessarily be loading.
const { loadStatus, startLoading, stopLoading } = useLoadAccelerationsToCache();
If startLoading
isn't called, then loadStatus
will remain as SCHEDULED
.
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.
LGTM.
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.
LGTM
Signed-off-by: Shenoy Pratik <[email protected]>
* add datasource in accelerations cache Signed-off-by: Shenoy Pratik <[email protected]> * fixed nits Signed-off-by: Shenoy Pratik <[email protected]> --------- Signed-off-by: Shenoy Pratik <[email protected]> (cherry picked from commit b0f0d9b) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* add datasource in accelerations cache * fixed nits --------- (cherry picked from commit b0f0d9b) Signed-off-by: Shenoy Pratik <[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>
…opensearch-project#1526) * add datasource in accelerations cache * fixed nits --------- (cherry picked from commit b0f0d9b) Signed-off-by: Shenoy Pratik <[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> (cherry picked from commit 2d18a4f)
Description
Updating the accelerations cache structure from:
To:
Issues Resolved
#1484
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.