lasdf1234 commented on code in PR #11848:
URL: https://github.com/apache/gravitino/pull/11848#discussion_r3527452674
##########
core/src/main/java/org/apache/gravitino/storage/relational/RelationalEntityStore.java:
##########
@@ -181,6 +185,44 @@ public <E extends Entity & HasIdentifier> E get(
});
}
+ @Override
+ public SupportsExternalIdOperations externalIdOperations() {
+ return this;
+ }
+
+ @Override
+ public <E extends Entity & HasIdentifier> E getByExternalId(
+ NameIdentifier ident, Entity.EntityType entityType, Class<E> type)
+ throws NoSuchEntityException, IOException {
+ return backend.getByExternalId(ident, entityType);
+ }
+
+ @Override
+ public <E extends Entity & HasIdentifier> E updateByExternalId(
+ NameIdentifier ident, Entity.EntityType entityType, Class<E> type,
Function<E, E> updater)
+ throws NoSuchEntityException, IOException {
+ E updatedEntity = backend.updateByExternalId(ident, entityType, updater);
+ cache.invalidate(updatedEntity.nameIdentifier(), entityType);
+ return updatedEntity;
+ }
+
+ @Override
+ public boolean deleteByExternalId(NameIdentifier ident, Entity.EntityType
entityType)
+ throws NoSuchEntityException, IOException {
+ NameIdentifier nameIdent = null;
+ try {
+ HasIdentifier entity = backend.getByExternalId(ident, entityType);
+ nameIdent = entity.nameIdentifier();
+ return backend.delete(nameIdent, entityType, false);
+ } catch (NoSuchEntityException e) {
+ return false;
Review Comment:
Thank you for your suggestion. The log has been updated.
##########
core/src/main/java/org/apache/gravitino/Entity.java:
##########
@@ -41,6 +41,9 @@ public interface Entity extends Serializable {
/** The user schema name in the system catalog. */
String USER_SCHEMA_NAME = "user";
+ /** The lock-only schema name for user operations keyed by external id. */
Review Comment:
In order to prevent conflicts where the externalId of the upstream IDP
coincides with the existing username of the user, a virtual schema name is
required to ensure this. The Java documentation has been updated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]