-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Procedure to invalidate directory list cache #19821
Procedure to invalidate directory list cache #19821
Conversation
@agrawalreetika Instead of single directory, we may want to clear the whole cache too. May be make the directoryPath optional, and if its not provided, then clear all cache. Also, please change the procedure name to something more intuitive. If there are multiple hive catalogs, how can we invalidate the cache from one particular catalog?
|
f95b59e
to
cec513e
Compare
Hi @nmahadevuni, Thanks for your comment. |
cec513e
to
06fb04f
Compare
@tdcmeehan Could you please help me review this? |
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.
@agrawalreetika thanks for the PR, overall LGTM. A few minor nits.
presto-hive/src/main/java/com/facebook/presto/hive/CacheInvalidationProcedure.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/com/facebook/presto/hive/CacheInvalidationProcedure.java
Outdated
Show resolved
Hide resolved
06fb04f
to
05cafc7
Compare
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 👍🏼
presto-hive/src/main/java/com/facebook/presto/hive/HiveClientModule.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
private void doInvalidateDirectoryListCache(ConnectorSession session, Optional<String> directoryPath) |
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.
Can we improve the enapsulation of CachingDirectoryLister
by moving this method to be inside of it? We could also write a simple unit test.
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.
@tdcmeehan Since we are going to use this for the Directory list invalidation procedure, which is why I thought of keeping it here. Do you think we should move this to CachingDirectoryLister?
I have added tests.
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 am in favor of keeping this inside of CachingDirectoryLister
for improved encapsulation.
05cafc7
to
9433002
Compare
presto-hive/src/main/java/com/facebook/presto/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
9433002
to
2bf4b22
Compare
assertEquals(missCount, 1); | ||
|
||
// Invalidate directory list cache | ||
assertQuerySucceeds("CALL hive.system.invalidate_directory_list_cache()"); |
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.
would be nice to also test parametrized version.
2bf4b22
to
0627839
Compare
0627839
to
a45324d
Compare
Codenotify: Notifying subscribers in CODENOTIFY files for diff 908327e...004ba4b.
|
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! (docs)
Local build of docs, new additions look good.
Failing on one test (test / test (:presto-hive) (pull_request), and no option to re-run failed tests. |
180a458
to
e361fad
Compare
1200de1
to
21bc4e2
Compare
21bc4e2
21bc4e2
to
0d6069a
Compare
89afaf4
to
dac10e2
Compare
6d5a116
to
2ea3862
Compare
import static com.google.common.base.Preconditions.checkArgument; | ||
import static com.google.common.collect.ImmutableSet.toImmutableSet; | ||
import static java.util.Objects.requireNonNull; | ||
|
||
public class CachingDirectoryLister | ||
implements DirectoryLister | ||
{ | ||
protected final DirectoryLister delegate; |
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 looks like this is still protected
a6b4e7b
to
d2f938c
Compare
@tdcmeehan I have been facing this issue in |
@agrawalreetika why do we need new product tests for this feature? Can't it run in an existing suite? |
9c55082
to
3097b5e
Compare
@tdcmeehan I added tests to the existing suite, but looks like |
31d3e88
to
7afa178
Compare
7afa178
to
004ba4b
Compare
@tdcmeehan & @steveburnett all the tests are green, this is ready for final review. |
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! (docs)
Pulled updated branch, new local build, docs looks good. Thanks!
Test plan - (Please fill in how you tested your changes)
Please make sure your submission complies with our Development, Formatting, and Commit Message guidelines. Don't forget to follow our attribution guidelines for any code copied from other projects.
Fill in the release notes towards the bottom of the PR description.
See Release Notes Guidelines for details.