-
Notifications
You must be signed in to change notification settings - Fork 599
[#2697] improvement(core): Support different entity with the same name under a namespace #2700
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
I think the key thing here is to make this change backward compatible, otherwise there's no way for users to upgrade. |
Yeah, that is why I'm hesitant about it. |
@@ -199,72 +189,15 @@ public <E extends Entity & HasIdentifier> E update( | |||
|
|||
// Update the name mapping | |||
nameMappingService.updateName( | |||
generateKeyForMapping(ident), generateKeyForMapping(updatedE.nameIdentifier())); | |||
generateKeyForMapping(ident, entityType, nameMappingService), | |||
generateKeyForMapping(updatedE.nameIdentifier(), entityType, nameMappingService)); |
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.
Only changing here is enough, do you need to change put/get also?
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 have been changed through method concatIdAndName
and put/get/update
will use this method to generate key format.
I have updated the code and added support for backward compatibility. Please take a look if you have time. Thanks. |
prefixes.add(replacePrefixTypeInfo(encode, FILESET.getShortName())); | ||
break; | ||
case TABLE: | ||
case FILESET: |
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.
Should you also add USER and GROUP here?
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.
If we add USER and GROUP here, USER and GROUP will block the non-cascade deletion of metalake.
core/src/main/java/com/datastrato/gravitino/storage/kv/BinaryEntityEncoderUtil.java
Outdated
Show resolved
Hide resolved
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. Thanks for your work @yuqi1129
What changes were proposed in this pull request?
Support store entities with the same name under a namespace.
Why are the changes needed?
It's a necessary feature for Gravitino.
Fix: #2697
Does this PR introduce any user-facing change?
N/A.
How was this patch tested?
UTs