-
Notifications
You must be signed in to change notification settings - Fork 415
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
[#6474] improvement(storage): batch listing securable objects in RoleMetaService #6601
Open
unknowntpo
wants to merge
15
commits into
apache:main
Choose a base branch
from
unknowntpo:refactor-batch-listSecurableObjects
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
15 commits
Select commit
Hold shift + click to select a range
29e28b9
feat: move getFilesetObjectFullNames from RoleMetaService to Metadata…
unknowntpo 3a77348
feat(RoleMetaService.listSecurableObjects): metalake batch retrival
unknowntpo 02c60af
feat: dynamically calling object fullname getter
unknowntpo 97685cb
feat(listSecurableObjects): implement batch retrieval for Catalog and…
unknowntpo b2a762a
feat(listSecurableObjects): implement batch retrieval for Model
unknowntpo d25b7c2
docs(SecurableObject.ofFileset): improve doc
unknowntpo 958074f
feat(listSecurableObjects): add support for TOPIC batch retrieval
unknowntpo 2e80957
refactor(listSecurableObjects): remove switch case
unknowntpo 117a993
fix(MetadataObjectService): fix wrong key in getCatalogObjectFullName…
unknowntpo 5614a57
feat(listSecurableObjects): add batch retrieval for SCHEMA
unknowntpo 1ba58b2
feat(listSecurableObjects): add support for listing column object ful…
unknowntpo 41ce958
docs: add javadoc
unknowntpo 28b252a
refactor: set getXXXIdAndNameMap to private
unknowntpo dd8d819
refactor: remove MetadataObject.Type.TABLE in listSecurableObjects
unknowntpo fb218a0
fix(TableColumnBaseSQLProvider): fix wrong sql in listColumnPOsByColu…
unknowntpo 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 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 |
---|---|---|
|
@@ -88,6 +88,22 @@ public static SecurableObject ofTable( | |
return of(MetadataObject.Type.TABLE, names, privileges); | ||
} | ||
|
||
/** | ||
* Create the column {@link SecurableObject} with the given securable schema object, column name | ||
* and privileges. | ||
* | ||
* @param table The table securable object | ||
* @param column The column name | ||
* @param privileges The privileges of the column | ||
* @return The created column {@link SecurableObject} | ||
*/ | ||
public static SecurableObject ofColumn( | ||
SecurableObject table, String column, List<Privilege> privileges) { | ||
List<String> names = Lists.newArrayList(DOT_SPLITTER.splitToList(table.fullName())); | ||
names.add(column); | ||
return of(MetadataObject.Type.TABLE, names, privileges); | ||
} | ||
|
||
/** | ||
* Create the topic {@link SecurableObject} with the given securable schema object ,topic name and | ||
* privileges. | ||
|
@@ -105,7 +121,7 @@ public static SecurableObject ofTopic( | |
} | ||
|
||
/** | ||
* Create the table {@link SecurableObject} with the given securable schema object, fileset name | ||
* Create the fileset {@link SecurableObject} with the given securable schema object, fileset name | ||
* and privileges. | ||
* | ||
* @param schema The schema securable object | ||
|
@@ -120,6 +136,22 @@ public static SecurableObject ofFileset( | |
return of(MetadataObject.Type.FILESET, names, privileges); | ||
} | ||
|
||
/** | ||
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. We don't support the privilege of the model now. You can remove this temporaly. |
||
* Create the table {@link SecurableObject} with the given securable schema object, fileset name | ||
* and privileges. | ||
* | ||
* @param schema The schema securable object | ||
* @param model The model name | ||
* @param privileges The privileges of the model | ||
* @return The created model {@link SecurableObject} | ||
*/ | ||
public static SecurableObject ofModel( | ||
SecurableObject schema, String model, List<Privilege> privileges) { | ||
List<String> names = Lists.newArrayList(DOT_SPLITTER.splitToList(schema.fullName())); | ||
names.add(model); | ||
return of(MetadataObject.Type.MODEL, names, privileges); | ||
} | ||
|
||
private static class SecurableObjectImpl extends MetadataObjectImpl implements SecurableObject { | ||
|
||
private List<Privilege> privileges; | ||
|
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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.
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.
Column isn't the securable object. So you should remove this.