-
Notifications
You must be signed in to change notification settings - Fork 359
Refactor PolarisMetaStoreManager interface into multiple interfaces #417
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
Refactor PolarisMetaStoreManager interface into multiple interfaces #417
Conversation
dimas-b
left a comment
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 overall 👍
dennishuo
left a comment
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, +1 to splitting. If the secrets manager will be specific to handling first-party auth, consider renaming it to PolarisPrincipalSecretsManager for clarity, or if it'll likely have some kinds of generic secret-management stuff for things like creating wrapped keys, encrypting/decrypting on the backend impl, then maybe better to leave it as you have it.
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.
Once we have other types of stored secrets for outbound integrations/connections, we might have a different interface like "PolarisIntegrationSecretsManager" -- are you envisioning combining all different types of secrets into this interface, or would we split first-party principal auth-related management here (e.g. we might call this one PolarisPrincipalSecretsManager and keep it under this auth directory) from outbound integration secret management, possibly keeping PolarisIntegrationSecretsManager under the persistence directory?
|
If it's generally a good idea, do you mind to hold this for a few days ? The reason that it would break the current Quarkus branch. I'm proposing:
|
Hey @jbonofre - I have a branch at https://github.com/jbonofre/polaris/compare/QUARKUS...collado-mike:polaris:patch-1?expand=1 that has this change merged into your Quarkus branch. The code compiles, though when I run the tests locally, it fails due to missing Can we merge that change into your branch and move forward with this refactoring in main? |
468f7a1 to
852f2e0
Compare
polaris-core/src/main/java/org/apache/polaris/core/persistence/cache/PolarisRemoteCache.java
Show resolved
Hide resolved
| public BaseResult() { | ||
| this.returnStatusCode = ReturnStatus.SUCCESS.getCode(); | ||
| this.extraInformation = null; | ||
| } | ||
|
|
||
| public BaseResult(@NotNull BaseResult.ReturnStatus returnStatus) { | ||
| this.returnStatusCode = returnStatus.getCode(); | ||
| this.extraInformation = null; | ||
| } | ||
|
|
||
| @JsonCreator | ||
| public BaseResult( |
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.
Do we intend for these to be used? If not, can BaseResult be abstract?
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 think there's already somewhere that does return a BaseResult. Otherwise it would have already been abstract
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.
You can return an abstract class, wdym?
@jbonofre can we move forward with this PR? |
| * </pre> | ||
| */ | ||
| @NotNull | ||
| ValidateAccessResult validateAccessToLocations( |
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.
@collado-mike I noticed that this method is not used anywhere. Moreover, this interface looks similar to PolarisStorageIntegration. Is that something we need to fix?
Description
PolarisMetaStoreManageris a monolithic interface that captures persistence, storage credential vending, remote cache, and grant management. This makes it easy to tie together many things that shouldn't be tied together - for example, the authorizer has dependencies on the cache types, so that it's impossible to make authorization pluggable using different grant rules.This change strictly splits up the interface into multiple interfaces, but the single
PolarisMetaStoreManageris still an extension of the others. Where it is possible to refer to specific interfaces, (e.g., the Resolver and the EntityCache), the references are changed, but we don't have factory types to generate realm-specific implementations of all interfaces and the PR was growing far too large when I started on that path.Future PRs would update components to refer to specific interfaces and to break the tie between the PolarisMetaStoreManager interface and the others. The PolarisMetaStoreManagerImpl may continue to implement all interfaces.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Interface only change - all existing tests continue to pass.
Test Configuration:
Checklist:
Please delete options that are not relevant.