tengqm commented on code in PR #5761:
URL: https://github.com/apache/gravitino/pull/5761#discussion_r1872401267
##########
core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java:
##########
@@ -677,11 +678,42 @@ public boolean dropCatalog(NameIdentifier ident, boolean
force)
} catch (NoSuchMetalakeException | NoSuchCatalogException ignored) {
return false;
- } catch (IOException e) {
+ } catch (GravitinoRuntimeException e) {
+ throw e;
+
+ } catch (Exception e) {
throw new RuntimeException(e);
}
}
+ private boolean haveAvailableSchemas(
+ List<SchemaEntity> schemaEntities, CatalogEntity catalogEntity,
CatalogWrapper catalogWrapper)
+ throws Exception {
+ if (schemaEntities.isEmpty()) {
+ return false;
+ }
+
+ if (schemaEntities.size() == 1 &&
catalogEntity.getProvider().equals("kafka")) {
Review Comment:
This can be optimized, IMHO.
If kafka is special for a reason, e.g. kafka is evil, you may want to add a
function
to the class `isProviderEvil()`. I mean, you may want to consolidate this
kind of tests
based on the business logic and maintain that logic, rather than treating
kafka as
a special animal.
##########
core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java:
##########
@@ -677,11 +678,42 @@ public boolean dropCatalog(NameIdentifier ident, boolean
force)
} catch (NoSuchMetalakeException | NoSuchCatalogException ignored) {
return false;
- } catch (IOException e) {
+ } catch (GravitinoRuntimeException e) {
+ throw e;
+
+ } catch (Exception e) {
throw new RuntimeException(e);
}
}
+ private boolean haveAvailableSchemas(
Review Comment:
```suggestion
private boolean hasSchemas(
```
--
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]