yuqi1129 commented on code in PR #9574:
URL: https://github.com/apache/gravitino/pull/9574#discussion_r2663331867
##########
core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java:
##########
@@ -555,23 +552,22 @@ public void testConnection(
public void enableCatalog(NameIdentifier ident)
throws NoSuchCatalogException, CatalogNotInUseException {
NameIdentifier metalakeIdent =
NameIdentifier.of(ident.namespace().levels());
-
TreeLockUtils.doWithTreeLock(
metalakeIdent,
LockType.WRITE,
() -> {
- checkMetalake(metalakeIdent, store);
-
try {
- if (catalogInUse(store, ident)) {
- return null;
- }
-
store.update(
ident,
CatalogEntity.class,
EntityType.CATALOG,
catalog -> {
+ boolean metalakeInuse =
metalakeInUseByCatalogProperty(catalog.getProperties());
Review Comment:
It may be, and the cache will improve the performance. It's not the scope
of this PR, and we can use another PR to solve similar problems overall.
By the way, why don't we use the cache to fetch catalog status before?
--
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]