-
Notifications
You must be signed in to change notification settings - Fork 329
Separate Polaris Entities #1128
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
Conversation
abdc52b to
1db510d
Compare
| import org.apache.polaris.core.persistence.dao.entity.ListEntitiesResult; | ||
| import org.apache.polaris.core.persistence.dao.entity.ResolvedEntityResult; | ||
|
|
||
| public class PostgresCatalogDaoImpl implements CatalogDao { |
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.
All classes under this package are placeholders for jdbc impl.
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.
imho, then this should be outside the eclipselink package ?
extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/jdbc/PostgresCatalogDaoImpl.java
may be extension/persistence ?
- extension
- persistence
- relational
- jdbc
- eclipselink
- relational
- persistence
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.
yes, we should put them in a different module ideally. I put them here mainly for demo purpose. Let me remove it in the next commit.
|
|
||
| // TODO this should return a type-specific entity result, e.g., CatalogEntityResult | ||
| @Nonnull | ||
| EntityResult readEntityByName(@Nonnull PolarisCallContext callCtx, @Nonnull String name); |
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.
As I put in the comment and dev mail list, the type-specific return entity refactor will come later.
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.
Instead of Fdb, I think we need multiple impls:
- jdbc
- eclipse-link
- treemap
- "delegating" to the metastoremanager, which is needed temporarily for backwards compatibility
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.
Renamed the current DAO implementations to DelegatingXXXDaoImpl for backward compatibility. We can add JDBC implementation in a followup PR.
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.
Nice, it looks good now. One other note is that the package name transactional is a little confusing but that can wait until later refactors.
| private final AuthenticatedPolarisPrincipal authenticatedPrincipal; | ||
| private final PolarisAuthorizer authorizer; | ||
| private final PolarisMetaStoreManager metaStoreManager; | ||
| private final PolarisDaoManager daoManager; |
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.
Using this class to show case how business logic invokes type-specific DAO objects. We can easily extend it to other classes like BasePolarisCatalog, PolarisEntityManager and Resolver
eric-maynard
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 now as a first step; we'll see the benefits of having the DAOs once we are able to provide metastore-specific DAO implementations and replace direct usage of PolarisMetastoreManager with the DAOs.
snazy
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.
I have strong concerns with the state of this PR.
Generally, I'm strongly +1 on having concern-oriented APIs and concrete implementation of those - for example an API for catalog management, for catalog content, etc. However, IMHO that should really be persistence implementation independent.
While this PR goes into the direction of concern-based APIs, it still exposes persistence internals and pushes those things up to the call sites, which should not be the case.
Another topic is the tight coupling of object-storage specific concerns with Polaris's backend database. That should really be decoupled, because credential vending has nothing to do with Polaris's backend database.
Can you point out in the code where "exposes persistence internals and pushes those things up to the call sites"? I'm also open for suggestion how we can separate concern better. |
Sure, as mentioned elsewhere, there should eventually be distinct APIs for each concern. Those APIs do not have to and therefore must not deal for example with persistence-internal IDs or dictate how objects are stored but provide the "concern specific" operations. As that's a more general approach, I really prefer to move this one into draft state and discuss the approach on the dev-ML. |
|
Isn’t there a thread from 3/6 already?
…On Mon, Mar 17, 2025 at 7:52 AM Robert Stupp ***@***.***> wrote:
Can you point out in the code where "exposes persistence internals and
pushes those things up to the call sites"? I'm also open for suggestion how
we can separate concern better.
Sure, as mentioned elsewhere, there should eventually be distinct APIs for
each concern. Those APIs do not have to and therefore must not deal for
example with persistence-internal IDs or dictate how objects are stored but
provide the "concern specific" operations.
As that's a more general approach, I really prefer to move this one into
draft state and discuss the approach on the dev-ML.
—
Reply to this email directly, view it on GitHub
<#1128 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFRE3SA3HOD77KDTYF7RGHL2U3OUTAVCNFSM6AAAAABYOAQGR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRZHAYTOOBVGY>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
[image: snazy]*snazy* left a comment (apache/polaris#1128)
<#1128 (comment)>
Can you point out in the code where "exposes persistence internals and
pushes those things up to the call sites"? I'm also open for suggestion how
we can separate concern better.
Sure, as mentioned elsewhere, there should eventually be distinct APIs for
each concern. Those APIs do not have to and therefore must not deal for
example with persistence-internal IDs or dictate how objects are stored but
provide the "concern specific" operations.
As that's a more general approach, I really prefer to move this one into
draft state and discuss the approach on the dev-ML.
—
Reply to this email directly, view it on GitHub
<#1128 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFRE3SA3HOD77KDTYF7RGHL2U3OUTAVCNFSM6AAAAABYOAQGR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRZHAYTOOBVGY>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
@snazy, here is the dev mail list: https://lists.apache.org/thread/ghtoydoyqfpd3m5qhscqpbgzqm92cyd9. As @eric-maynard mentioned, it was here for a while. |
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
No description provided.