-
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
Catalog cache and Session update for async queries #1500
Conversation
Signed-off-by: Shenoy Pratik <[email protected]>
Signed-off-by: Shenoy Pratik <[email protected]>
Signed-off-by: Shenoy Pratik <[email protected]>
Signed-off-by: Shenoy Pratik <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1500 +/- ##
==========================================
+ Coverage 54.26% 54.39% +0.13%
==========================================
Files 343 347 +4
Lines 12338 12563 +225
Branches 3173 3213 +40
==========================================
+ Hits 6695 6834 +139
- Misses 5587 5673 +86
Partials 56 56
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
||
const cachedDatabase = cachedDataSource.databases.find((db) => db.name === databaseName); | ||
if (!cachedDatabase) { | ||
throw new Error('Database not found exception: ' + databaseName); |
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.
From an API usability standpoint, I wonder if it's good design to throw an error on a cache miss. Since it's a pretty regular and probably expected occurrence, it might make more sense to return a CachedDatabase | null
(or reuse the ok: boolean
pattern from AsyncApiResponse
) so TypeScript can do more heavy lifting for soundness checking.
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 by design right now. We want the cache users to know where the get request is failing. I'll check with @RyanL1997 @sejli what do they expect thrown error or an error response
. I remember UI having special cases where they see something missing with toast errors or callouts.
Signed-off-by: Shenoy Pratik <[email protected]>
* init commit for cache Signed-off-by: Shenoy Pratik <[email protected]> * cache loader init Signed-off-by: Shenoy Pratik <[email protected]> * update cache with accelerations cache, add custom hooks Signed-off-by: Shenoy Pratik <[email protected]> * add session coupling and fix tests for cache Signed-off-by: Shenoy Pratik <[email protected]> * added polling result type, updated version constant Signed-off-by: Shenoy Pratik <[email protected]> --------- Signed-off-by: Shenoy Pratik <[email protected]> (cherry picked from commit 943126f) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* init commit for cache * cache loader init * update cache with accelerations cache, add custom hooks * add session coupling and fix tests for cache * added polling result type, updated version constant --------- (cherry picked from commit 943126f) 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>
…t#1500) (opensearch-project#1504) * init commit for cache * cache loader init * update cache with accelerations cache, add custom hooks * add session coupling and fix tests for cache * added polling result type, updated version constant --------- (cherry picked from commit 943126f) 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 b4c04d8)
Description
Catalog cache and Session update for async queries
Issues Resolved
#1484
#1251
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.