roryqi commented on code in PR #11848:
URL: https://github.com/apache/gravitino/pull/11848#discussion_r3526337677
##########
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);
Review Comment:
Will u invalidate the entity here?
--
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]