You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Core persistence refactor phase 1 - extract BasePersistence and BaseMetaStoreManager to isolate all "transaction" behaviors (#1070)
* Restructure persistence class hierarchy and remove vestigial interfaces
Extract a basic abstract base class BaseMetaStoreManager which can
hold shared logic between implementations of PolarisMetaStoreManager
* Remove all "entitiesDropped" members; these were vestigial from trying to implement UNDROP
but for now are entirely unused. We can reintroduce it with a better design against multiple
backends when/if we want to implement UNDROP.
* Extract BasePersistence interface as parent interface of PolarisMetaStoreSession;
only leave the transaction-specific methods in PolarisMetaStoreSession
* Push all evidence of the two-phase lookupEntityByName into only the transactional-style
PolarisMetaStoreSession, so that BasePersistence properly exposes a lookupEntityByName
method where impls that use secondary indexes can easily just lookup an entity by name
instead of doing two lookups.
* Turn PolarisMetaStoreSession into an abstract class and make lookupEntityActive
protected-visibility; remove all callsites where PolarisMetaStoreManagerImpl
calls it. Technically, while in the same package this doesn't prevent
it from leaking, but we could reposition PolarisMetaStoreSession into
a separate transaction-specific package to help protect it from leaking
the lower-level abstractions.
* Pushdown all calls to writeToEntities into PolarisMetaStoreSession, and add
writeEntity method to BasePersistence, with a default impl in PolarisMetaStoreSession
containing what was previously in PolarisMetaStoreManagerImpl. This now protects
all writes in PolarisMetaStoreManagerImpl from dealing with the three-table
implementation detail. Technically slightly changes the ordering of updates
within a transaction for renameEntity, but is arguably a more correct ordering,
and the ordering doesn't interleave reads anyways.
* Add originalEntity to the writeEntity method to enable compare-and-swap behavior
from the underlying BasePersistence.
Pushdown all the deleteFromEntities* methods into PolarisMetaStoreSession and
add deleteEntity to BasePersistence which encapsulates handling the separate slices.
* Break out external-integration related methods from BasePersistence into a new
IntegrationPersistence interface; these methods encapsulate certain type-specific
behaviors that are indirectly tied to persistence entities, such as principal
secrets, storage integrations, etc.
* Improve javadoc comments, rename PolarisEntityActiveRecord to EntityNameLookupRecord,
remove unused method
* Rename PolarisMetaStoreSession to TransactionalPersistence and move into a new package "transactional".
* Also move the PolarisTreeMap* classes into the transactional package
* Move PolarisMetaStoreManagerImpl into the "transactional" package per PR suggestion
Copy file name to clipboardexpand all lines: extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/EclipseLinkPolarisMetaStoreManagerFactory.java
Copy file name to clipboardexpand all lines: extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java
Copy file name to clipboardexpand all lines: extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkStore.java
Copy file name to clipboardexpand all lines: extension/persistence/eclipselink/src/test/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreManagerTest.java
0 commit comments