hqbhoho commented on code in PR #9119:
URL: https://github.com/apache/gravitino/pull/9119#discussion_r2548954519
##########
catalogs/catalog-jdbc-common/src/main/java/org/apache/gravitino/catalog/jdbc/JdbcCatalogOperations.java:
##########
@@ -174,11 +179,25 @@ public void initialize(
if (tableOperation instanceof RequireDatabaseOperation) {
((RequireDatabaseOperation)
tableOperation).setDatabaseOperation(databaseOperation);
}
+
+ MetricsSystem metricsSystem = GravitinoEnv.getInstance().metricsSystem();
+ // Metrics System could be null in UT.
+ if (metricsSystem != null) {
+ this.catalogMetricsSource =
Review Comment:
Code review reveals that renaming a catalog or metalake triggers the
creation of a new `JdbcCatalogOptions` instance. When `BaseCatalog#ops()` is
subsequently called, it invokes `JdbcCatalogOptions#initialize`. Consequently,
metrics are recorded after metadata operation performed on the renamed catalog
or metalake.
<img width="1182" height="97" alt="image"
src="https://github.com/user-attachments/assets/3b012a8e-fb0a-4991-8d22-b3c362e43b34"
/>
So there is no issue with renaming the catalog and metalake.
cc @jerqi @mchades @FANNG1 @yuqi1129
--
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]