Skip to content
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

Allow MetaStore manager to declare whether bulk reload is necessary #1132

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -376,4 +376,14 @@ ResolvedEntityResult refreshResolvedEntity(
@Nonnull PolarisEntityType entityType,
long entityCatalogId,
long entityId);

/**
* Indicates whether this metastore manager implementation requires entities to be reloaded via
* {@link #loadEntitiesChangeTracking} in order to ensure the most recent versions are obtained.
*
* <p>Generally this flag is {@code true} when entity caching is used.
*/
default boolean requiresEntityReload() {
return true;
}
Comment on lines +386 to +388
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the comment, I wonder if we could just use cache == null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what it looks like to me too, but I'd like to allow implementations to make this decision separately. We can revisit and remove this method when a NoSQL impl. is make available for review (if it happens to be redundat)... but so far it seems useful for our WIP code.

}
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,10 @@ private ResolvedPolarisEntity getFreshlyResolved(ResolvedPolarisEntity originalE
* @return true if none of the entities has changed
*/
private boolean bulkValidate(List<ResolvedPolarisEntity> toValidate) {
if (!polarisMetaStoreManager.requiresEntityReload()) {
return true;
}

// assume everything is good
boolean validationStatus = true;

Expand Down