-
Notifications
You must be signed in to change notification settings - Fork 314
Add loadEntities batch call and rename listFullEntities #2508
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
Open
collado-mike
wants to merge
9
commits into
apache:main
Choose a base branch
from
collado-mike:mcollado-loadentities-batch
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e8fee9b
Add loadEntities batch call and rename listFullEntities
collado-mike 072bac8
Changed batch call to implement loadResolvedEntities instead
collado-mike d693e4e
Add loadResolvedEntities by id and entity cache support
collado-mike 18fd74e
Add additional test for loadResolvedEntities by id
collado-mike a5e779d
Added additional test and updated comments in EntityCache interface
collado-mike b0a6c38
Add additional constructor to ResolvedEntitiesResult
collado-mike 4fe92d3
Fixed unused method reference
collado-mike 827ec33
Removed loadResolvedEntities method with lookup record param
collado-mike 2289355
Pulled out toResolvedPolarisEntity method per PR comment
collado-mike File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ | |
import org.apache.polaris.core.persistence.dao.entity.EntityWithPath; | ||
import org.apache.polaris.core.persistence.dao.entity.GenerateEntityIdResult; | ||
import org.apache.polaris.core.persistence.dao.entity.ListEntitiesResult; | ||
import org.apache.polaris.core.persistence.dao.entity.ResolvedEntitiesResult; | ||
import org.apache.polaris.core.persistence.dao.entity.ResolvedEntityResult; | ||
import org.apache.polaris.core.persistence.pagination.Page; | ||
import org.apache.polaris.core.persistence.pagination.PageToken; | ||
|
@@ -114,7 +115,7 @@ EntityResult readEntityByName( | |
|
||
/** | ||
* List lightweight information about entities matching the given criteria. If all properties of | ||
* the entity are required,use {@link #loadEntities} instead. | ||
* the entity are required,use {@link #listFullEntities} instead. | ||
* | ||
* @param callCtx call context | ||
* @param catalogPath path inside a catalog. If null or empty, the entities to list are top-level, | ||
|
@@ -135,7 +136,7 @@ ListEntitiesResult listEntities( | |
/** | ||
* Load full entities matching the given criteria with pagination. If only the entity name/id/type | ||
* is required, use {@link #listEntities} instead. If no pagination is required, use {@link | ||
* #loadEntitiesAll} instead. | ||
* #listFullEntitiesAll} instead. | ||
* | ||
* @param callCtx call context | ||
* @param catalogPath path inside a catalog. If null or empty, the entities to list are top-level, | ||
|
@@ -145,7 +146,7 @@ ListEntitiesResult listEntities( | |
* @return paged list of matching entities | ||
*/ | ||
@Nonnull | ||
Page<PolarisBaseEntity> loadEntities( | ||
Page<PolarisBaseEntity> listFullEntities( | ||
@Nonnull PolarisCallContext callCtx, | ||
@Nullable List<PolarisEntityCore> catalogPath, | ||
@Nonnull PolarisEntityType entityType, | ||
|
@@ -154,7 +155,7 @@ Page<PolarisBaseEntity> loadEntities( | |
|
||
/** | ||
* Load full entities matching the given criteria into an unpaged list. If pagination is required | ||
* use {@link #loadEntities} instead. If only the entity name/id/type is required, use {@link | ||
* use {@link #listFullEntities} instead. If only the entity name/id/type is required, use {@link | ||
* #listEntities} instead. | ||
* | ||
* @param callCtx call context | ||
|
@@ -164,12 +165,13 @@ Page<PolarisBaseEntity> loadEntities( | |
* @param entitySubType subType of entities to list (or ANY_SUBTYPE) | ||
* @return list of all matching entities | ||
*/ | ||
default @Nonnull List<PolarisBaseEntity> loadEntitiesAll( | ||
default @Nonnull List<PolarisBaseEntity> listFullEntitiesAll( | ||
@Nonnull PolarisCallContext callCtx, | ||
@Nullable List<PolarisEntityCore> catalogPath, | ||
@Nonnull PolarisEntityType entityType, | ||
@Nonnull PolarisEntitySubType entitySubType) { | ||
return loadEntities(callCtx, catalogPath, entityType, entitySubType, PageToken.readEverything()) | ||
return listFullEntities( | ||
callCtx, catalogPath, entityType, entitySubType, PageToken.readEverything()) | ||
.items(); | ||
} | ||
|
||
|
@@ -416,6 +418,23 @@ ResolvedEntityResult loadResolvedEntityByName( | |
@Nonnull PolarisEntityType entityType, | ||
@Nonnull String entityName); | ||
|
||
/** | ||
* Load a batch of resolved entities of a specified entity type given their {@link | ||
* PolarisEntityId}. Will return an empty list if the input list is empty. Order in that returned | ||
* list is the same as the input list. Some elements might be NULL if the entity has been dropped. | ||
* | ||
* @param callCtx call context | ||
* @param entityType the type of entities to load | ||
* @param entityIds the list of entity ids to load | ||
* @return a non-null list of entities corresponding to the lookup keys. Some elements might be | ||
* NULL if the entity has been dropped. | ||
*/ | ||
@Nonnull | ||
ResolvedEntitiesResult loadResolvedEntities( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The name LGTM, but I guess it does not match the PR description anymore 🤔 |
||
@Nonnull PolarisCallContext callCtx, | ||
@Nonnull PolarisEntityType entityType, | ||
@Nonnull List<PolarisEntityId> entityIds); | ||
|
||
/** | ||
* Refresh a resolved entity from the backend store. Will return NULL if the entity does not | ||
* exist, i.e. has been purged or dropped. Else, will determine what has changed based on the | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.