jerqi commented on code in PR #5075:
URL: https://github.com/apache/gravitino/pull/5075#discussion_r1794852231
##########
core/src/main/java/org/apache/gravitino/tag/TagManager.java:
##########
@@ -431,27 +424,7 @@ private TagEntity updateTagEntity(TagEntity tagEntity,
TagChange... changes) {
// for this entity, with this uid tags can be associated with this entity.
// This method should be called out of the tree lock, otherwise it will
cause deadlock.
@VisibleForTesting
- boolean checkAndImportEntity(String metalake, MetadataObject metadataObject,
GravitinoEnv env) {
- NameIdentifier entityIdent = MetadataObjectUtil.toEntityIdent(metalake,
metadataObject);
- Entity.EntityType entityType =
MetadataObjectUtil.toEntityType(metadataObject);
-
- switch (entityType) {
- case METALAKE:
- return env.metalakeDispatcher().metalakeExists(entityIdent);
- case CATALOG:
- return env.catalogDispatcher().catalogExists(entityIdent);
- case SCHEMA:
- return env.schemaDispatcher().schemaExists(entityIdent);
- case TABLE:
- return env.tableDispatcher().tableExists(entityIdent);
- case TOPIC:
- return env.topicDispatcher().topicExists(entityIdent);
- case FILESET:
- return env.filesetDispatcher().filesetExists(entityIdent);
- case COLUMN:
- default:
- throw new IllegalArgumentException(
- "Unsupported metadata object type: " + metadataObject.type());
- }
+ void checkAndImportEntity(String metalake, MetadataObject metadataObject,
GravitinoEnv env) {
+ MetadataObjectUtil.checkMetadataObject(metalake, metadataObject, env);
}
Review Comment:
Fixed.
--
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]