-
Notifications
You must be signed in to change notification settings - Fork 166
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
Extend FileIOFactory to Improve Customization #724
base: main
Are you sure you want to change the base?
Conversation
057bd17
to
836d3f1
Compare
836d3f1
to
0a10632
Compare
Thanks for your contribution @XJDKC! |
service/common/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java
Outdated
Show resolved
Hide resolved
88bc1af
to
6ff8f2b
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.
Thanks for the update @XJDKC ! Overall, the new code looks good to me :) A few minor comments below.
service/common/src/main/java/org/apache/polaris/service/catalog/io/FileIOFactory.java
Outdated
Show resolved
Hide resolved
service/common/src/main/java/org/apache/polaris/service/catalog/io/DefaultFileIOFactory.java
Outdated
Show resolved
Hide resolved
service/common/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java
Outdated
Show resolved
Hide resolved
service/common/src/main/java/org/apache/polaris/service/catalog/io/FileIOFactory.java
Outdated
Show resolved
Hide resolved
service/common/src/main/java/org/apache/polaris/service/catalog/io/DefaultFileIOFactory.java
Outdated
Show resolved
Hide resolved
service/common/src/main/java/org/apache/polaris/service/catalog/io/DefaultFileIOFactory.java
Outdated
Show resolved
Hide resolved
service/common/src/main/java/org/apache/polaris/service/catalog/io/DefaultFileIOFactory.java
Outdated
Show resolved
Hide resolved
service/common/src/main/java/org/apache/polaris/service/catalog/io/DefaultFileIOFactory.java
Show resolved
Hide resolved
service/common/src/main/java/org/apache/polaris/service/catalog/io/DefaultFileIOFactory.java
Outdated
Show resolved
Hide resolved
service/common/src/main/java/org/apache/polaris/service/catalog/io/DefaultFileIOFactory.java
Outdated
Show resolved
Hide resolved
|| storageActions.contains(PolarisStorageActions.ALL) | ||
? tableLocations | ||
: Set.of(); | ||
Map<String, String> credentialsMap = |
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.
absolute nitpick and totally my own personal preference: using Java's (new-ish) var
keyword actually increases readability, assuming that the variable name is expressive.
service/common/src/main/java/org/apache/polaris/service/catalog/io/DefaultFileIOFactory.java
Outdated
Show resolved
Hide resolved
@@ -1459,6 +1462,46 @@ public void testDropTableWithPurgeDisabled() { | |||
.hasMessageContaining(PolarisConfiguration.DROP_WITH_PURGE_ENABLED.key); | |||
} | |||
|
|||
@Test | |||
public void testRefreshIOWithCredentialsAndInternalProperties() { |
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.
Not sure how this actually refreshes credentials.
Anyway, having this test is good. However, I'd prefer to also have a dedicated test class for DefaultFileIOFactory
and do extensive testing there, also with multiple realms?
service/common/src/main/java/org/apache/polaris/service/catalog/io/FileIOFactory.java
Outdated
Show resolved
Hide resolved
00a9ae4
to
decc5b8
Compare
...service/src/test/java/org/apache/polaris/service/quarkus/catalog/BasePolarisCatalogTest.java
Outdated
Show resolved
Hide resolved
service/common/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java
Outdated
Show resolved
Hide resolved
service/common/src/main/java/org/apache/polaris/service/catalog/io/FileIOFactory.java
Outdated
Show resolved
Hide resolved
service/common/src/main/java/org/apache/polaris/service/task/TaskFileIOSupplier.java
Outdated
Show resolved
Hide resolved
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
Context
PolarisEntity
has aninternalProperties
map.Some
PolarisEntity
have StorageConfig, these storage configs are stored asinternalProperties
in the Entity object. Also theinternalProperties
may contain additional storage config injected by customizedPolarisMetaStoreManager
.It's very useful to pass these properties to FileIO so that the FileIO can implement some custom logic based on it.
This PR updates the
BasePolarisCatalog::refreshIOWithCredentials
method to pass the internal properties of the storageInfoEntity to FileIO object.Some code pointers: