-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Invalidate CachingDirectoryLister when writing through Trino #10915
Invalidate CachingDirectoryLister when writing through Trino #10915
Conversation
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
647688c
to
973a952
Compare
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
42c8263
to
8e5c6a0
Compare
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/SchemaTableListener.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/SchemaTableListener.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
8e5c6a0
to
e144cf4
Compare
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
0d560c0
to
96fddfd
Compare
Rebasing on |
bcca8eb
to
f20dd3d
Compare
120171e
to
7c47b88
Compare
7c47b88
to
ed4dc20
Compare
plugin/trino-hive/src/main/java/io/trino/plugin/hive/DirectoryCallback.java
Outdated
Show resolved
Hide resolved
d5fb37e
to
41f2272
Compare
plugin/trino-hive/src/main/java/io/trino/plugin/hive/DirectoryCallback.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/DirectoryCallback.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/InternalHiveConnectorFactory.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestCachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestCachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestCachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
5be4f4d
to
8a0d93d
Compare
94ced51
to
bc53cc2
Compare
( currently, depends on #11047 ) |
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
a1c823b
to
539bd8a
Compare
Rebased on upstream/master to make use of the EvictableCache improvements #11047 |
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryListerModule.java
Outdated
Show resolved
Hide resolved
.../trino-hive/src/main/java/io/trino/plugin/hive/metastore/SemiTransactionalHiveMetastore.java
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/TableChangeCallback.java
Outdated
Show resolved
Hide resolved
539bd8a
to
17178c2
Compare
{ | ||
if (isCacheEnabledFor(table.getSchemaTableName()) && isLocationPresent(table.getStorage())) { | ||
if (table.getPartitionColumns().isEmpty()) { | ||
cache.invalidate(new Path(table.getStorage().getLocation())); |
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 the usage of the constructor with an unexpected path cause us problems?
I could use String instead of Path for the cache keys to be on the safe side.
plugin/trino-hive/src/main/java/io/trino/plugin/hive/CachingDirectoryLister.java
Outdated
Show resolved
Hide resolved
.../trino-hive/src/main/java/io/trino/plugin/hive/metastore/SemiTransactionalHiveMetastore.java
Show resolved
Hide resolved
.../trino-hive/src/main/java/io/trino/plugin/hive/metastore/SemiTransactionalHiveMetastore.java
Show resolved
Hide resolved
17178c2
to
0428a10
Compare
Notify the CachingDirectoryLister about changes that happen on the table in order to be able to invalidate the cached directory listings for Hive tables or partitions of the Hive tables. When the content of a table/partition changes, all the cached paths for under the corresponding table/partition directory will be invalidated from the cache. Co-authored-by: Piotr Findeisen <[email protected]>
0428a10
to
ba52cee
Compare
Description
Notify the CachingDirectoryLister about changes that happen
on the table / partition(s) in order to be able to invalidate
the cached directory listings for Hive tables or
partitions of the Hive table.
General information
Is this change a fix, improvement, new feature, refactoring, or other?
This is a cache invalidation fix.
Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)
This change affects the Hive connector.
How would you describe this change to a non-technical end user or system administrator?
When the content of a table changes,
all the cached paths for under belonging to the table will be
invalidated from the cache.
Please do note that the current implementation does not
make the CachingDirectoryLister aware of changes
performed on the table content by external processes
(e.g. : Hive, Spark).
Related issues, pull requests, and links
Documentation
( x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
( ) No release notes entries required.
( x) Release notes entries required with the following suggested text:
Fixes #10621