jerryshao commented on code in PR #5155:
URL: https://github.com/apache/gravitino/pull/5155#discussion_r1806214600
##########
core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java:
##########
@@ -104,14 +107,18 @@
public class CatalogManager implements CatalogDispatcher, Closeable {
private static final String CATALOG_DOES_NOT_EXIST_MSG = "Catalog %s does
not exist";
- private static final String METALAKE_DOES_NOT_EXIST_MSG = "Metalake %s does
not exist";
private static final Logger LOG =
LoggerFactory.getLogger(CatalogManager.class);
- public static boolean catalogInUse(EntityStore store, NameIdentifier ident)
- throws NoSuchMetalakeException, NoSuchCatalogException {
- // todo: check if the metalake is in use
- return getInUseValue(store, ident);
+ public static void checkCatalogInUse(EntityStore store, NameIdentifier ident)
+ throws NoSuchMetalakeException, NoSuchCatalogException,
CatalogNotInUseException,
+ MetalakeNotInUseException {
+ NameIdentifier metalakeIdent =
NameIdentifier.of(ident.namespace().levels());
+ checkMetalake(metalakeIdent, store);
+
+ if (!getInUseValue(store, ident)) {
Review Comment:
It is better rename to `getCatalogInUseValue` for clear understanding.
--
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]