diff --git a/api/src/main/java/org/apache/gravitino/SupportsCatalogs.java b/api/src/main/java/org/apache/gravitino/SupportsCatalogs.java
index 143e72ad789..989de9164c9 100644
--- a/api/src/main/java/org/apache/gravitino/SupportsCatalogs.java
+++ b/api/src/main/java/org/apache/gravitino/SupportsCatalogs.java
@@ -116,8 +116,8 @@ Catalog alterCatalog(String catalogName, CatalogChange... changes)
*
* - There is no schema in the catalog. Otherwise, a {@link NonEmptyEntityException} will be
* thrown.
- *
- The method {@link #deactivateCatalog(String)} has been called before dropping the
- * catalog. Otherwise, a {@link CatalogInUseException} will be thrown.
+ *
- The method {@link #disableCatalog(String)} has been called before dropping the catalog.
+ * Otherwise, a {@link CatalogInUseException} will be thrown.
*
*
* It is equivalent to calling {@code dropCatalog(ident, false)}.
@@ -154,19 +154,19 @@ boolean dropCatalog(String catalogName, boolean force)
throws NonEmptyEntityException, CatalogInUseException;
/**
- * Activate a catalog. If the catalog is already activated, this method does nothing.
+ * Enable a catalog. If the catalog is already enable, this method does nothing.
*
* @param catalogName The identifier of the catalog.
* @throws NoSuchCatalogException If the catalog does not exist.
*/
- void activateCatalog(String catalogName) throws NoSuchCatalogException;
+ void enableCatalog(String catalogName) throws NoSuchCatalogException;
/**
- * Deactivate a catalog. If the catalog is already deactivated, this method does nothing. Once a
- * catalog is deactivated:
+ * Disable a catalog. If the catalog is already disabled, this method does nothing. Once a catalog
+ * is disabled:
*
*
- * - It can only be listed, loaded, dropped, or activated.
+ *
- It can only be listed, loaded, dropped, or disable.
*
- Any other operations on the catalog will throw an {@link CatalogNotInUseException}.
*
- Any operation on the sub-entities (schemas, tables, etc.) will throw an {@link
* CatalogNotInUseException}.
@@ -175,7 +175,7 @@ boolean dropCatalog(String catalogName, boolean force)
* @param catalogName The identifier of the catalog.
* @throws NoSuchCatalogException If the catalog does not exist.
*/
- void deactivateCatalog(String catalogName) throws NoSuchCatalogException;
+ void disableCatalog(String catalogName) throws NoSuchCatalogException;
/**
* Test whether the catalog with specified parameters can be connected to before creating it.
diff --git a/catalogs/catalog-jdbc-mysql/src/test/java/org/apache/gravitino/catalog/mysql/integration/test/CatalogMysqlIT.java b/catalogs/catalog-jdbc-mysql/src/test/java/org/apache/gravitino/catalog/mysql/integration/test/CatalogMysqlIT.java
index 33408e28bfd..60af07011e8 100644
--- a/catalogs/catalog-jdbc-mysql/src/test/java/org/apache/gravitino/catalog/mysql/integration/test/CatalogMysqlIT.java
+++ b/catalogs/catalog-jdbc-mysql/src/test/java/org/apache/gravitino/catalog/mysql/integration/test/CatalogMysqlIT.java
@@ -142,7 +142,7 @@ public void startup() throws IOException, SQLException {
@AfterAll
public void stop() {
clearTableAndSchema();
- metalake.deactivateCatalog(catalogName);
+ metalake.disableCatalog(catalogName);
metalake.dropCatalog(catalogName);
client.dropMetalake(metalakeName);
mysqlService.close();
diff --git a/catalogs/catalog-jdbc-postgresql/src/test/java/org/apache/gravitino/catalog/postgresql/integration/test/CatalogPostgreSqlIT.java b/catalogs/catalog-jdbc-postgresql/src/test/java/org/apache/gravitino/catalog/postgresql/integration/test/CatalogPostgreSqlIT.java
index d9b30fb5112..0d1292c67a2 100644
--- a/catalogs/catalog-jdbc-postgresql/src/test/java/org/apache/gravitino/catalog/postgresql/integration/test/CatalogPostgreSqlIT.java
+++ b/catalogs/catalog-jdbc-postgresql/src/test/java/org/apache/gravitino/catalog/postgresql/integration/test/CatalogPostgreSqlIT.java
@@ -128,7 +128,7 @@ public void stop() {
for (String schemaName : schemaNames) {
catalog.asSchemas().dropSchema(schemaName, true);
}
- metalake.deactivateCatalog(catalogName);
+ metalake.disableCatalog(catalogName);
metalake.dropCatalog(catalogName);
client.dropMetalake(metalakeName);
postgreSqlService.close();
diff --git a/catalogs/catalog-kafka/src/test/java/org/apache/gravitino/catalog/kafka/integration/test/CatalogKafkaIT.java b/catalogs/catalog-kafka/src/test/java/org/apache/gravitino/catalog/kafka/integration/test/CatalogKafkaIT.java
index e6e388f21a3..907b00733bc 100644
--- a/catalogs/catalog-kafka/src/test/java/org/apache/gravitino/catalog/kafka/integration/test/CatalogKafkaIT.java
+++ b/catalogs/catalog-kafka/src/test/java/org/apache/gravitino/catalog/kafka/integration/test/CatalogKafkaIT.java
@@ -123,7 +123,7 @@ public void shutdown() {
Arrays.stream(metalake.listCatalogs())
.forEach(
(catalogName -> {
- metalake.deactivateCatalog(catalogName);
+ metalake.disableCatalog(catalogName);
metalake.dropCatalog(catalogName);
}));
client.dropMetalake(METALAKE_NAME);
diff --git a/catalogs/catalog-lakehouse-iceberg/src/test/java/org/apache/gravitino/catalog/lakehouse/iceberg/integration/test/CatalogIcebergBaseIT.java b/catalogs/catalog-lakehouse-iceberg/src/test/java/org/apache/gravitino/catalog/lakehouse/iceberg/integration/test/CatalogIcebergBaseIT.java
index 35755b70758..9fcc93451ca 100644
--- a/catalogs/catalog-lakehouse-iceberg/src/test/java/org/apache/gravitino/catalog/lakehouse/iceberg/integration/test/CatalogIcebergBaseIT.java
+++ b/catalogs/catalog-lakehouse-iceberg/src/test/java/org/apache/gravitino/catalog/lakehouse/iceberg/integration/test/CatalogIcebergBaseIT.java
@@ -138,7 +138,7 @@ public void startup() throws Exception {
public void stop() throws Exception {
try {
clearTableAndSchema();
- metalake.deactivateCatalog(catalogName);
+ metalake.disableCatalog(catalogName);
metalake.dropCatalog(catalogName);
client.dropMetalake(metalakeName);
} finally {
diff --git a/catalogs/catalog-lakehouse-iceberg/src/test/java/org/apache/gravitino/catalog/lakehouse/iceberg/integration/test/CatalogIcebergKerberosHiveIT.java b/catalogs/catalog-lakehouse-iceberg/src/test/java/org/apache/gravitino/catalog/lakehouse/iceberg/integration/test/CatalogIcebergKerberosHiveIT.java
index 0bfc54957b7..1017ccb4e10 100644
--- a/catalogs/catalog-lakehouse-iceberg/src/test/java/org/apache/gravitino/catalog/lakehouse/iceberg/integration/test/CatalogIcebergKerberosHiveIT.java
+++ b/catalogs/catalog-lakehouse-iceberg/src/test/java/org/apache/gravitino/catalog/lakehouse/iceberg/integration/test/CatalogIcebergKerberosHiveIT.java
@@ -292,7 +292,7 @@ void testIcebergWithKerberosAndUserImpersonation() throws IOException {
Assertions.assertFalse(catalog.asSchemas().schemaExists(SCHEMA_NAME));
// Drop catalog
- Assertions.assertDoesNotThrow(() -> gravitinoMetalake.deactivateCatalog(CATALOG_NAME));
+ Assertions.assertDoesNotThrow(() -> gravitinoMetalake.disableCatalog(CATALOG_NAME));
Assertions.assertTrue(gravitinoMetalake.dropCatalog(CATALOG_NAME));
}
diff --git a/catalogs/catalog-lakehouse-paimon/src/test/java/org/apache/gravitino/catalog/lakehouse/paimon/integration/test/CatalogPaimonBaseIT.java b/catalogs/catalog-lakehouse-paimon/src/test/java/org/apache/gravitino/catalog/lakehouse/paimon/integration/test/CatalogPaimonBaseIT.java
index 61778da91e7..ed90745a785 100644
--- a/catalogs/catalog-lakehouse-paimon/src/test/java/org/apache/gravitino/catalog/lakehouse/paimon/integration/test/CatalogPaimonBaseIT.java
+++ b/catalogs/catalog-lakehouse-paimon/src/test/java/org/apache/gravitino/catalog/lakehouse/paimon/integration/test/CatalogPaimonBaseIT.java
@@ -136,7 +136,7 @@ protected void startNecessaryContainers() {
@AfterAll
public void stop() {
clearTableAndSchema();
- metalake.deactivateCatalog(catalogName);
+ metalake.disableCatalog(catalogName);
metalake.dropCatalog(catalogName);
client.dropMetalake(metalakeName);
if (spark != null) {
diff --git a/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java b/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java
index 4c07e524034..0f3b88133d2 100644
--- a/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java
+++ b/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoClient.java
@@ -135,13 +135,13 @@ public boolean dropCatalog(String catalogName, boolean force)
}
@Override
- public void activateCatalog(String catalogName) throws NoSuchCatalogException {
- getMetalake().activateCatalog(catalogName);
+ public void enableCatalog(String catalogName) throws NoSuchCatalogException {
+ getMetalake().enableCatalog(catalogName);
}
@Override
- public void deactivateCatalog(String catalogName) throws NoSuchCatalogException {
- getMetalake().deactivateCatalog(catalogName);
+ public void disableCatalog(String catalogName) throws NoSuchCatalogException {
+ getMetalake().disableCatalog(catalogName);
}
/**
diff --git a/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java b/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java
index 9ab1a66c774..e52fd87560d 100644
--- a/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java
+++ b/clients/client-java/src/main/java/org/apache/gravitino/client/GravitinoMetalake.java
@@ -296,7 +296,7 @@ public boolean dropCatalog(String catalogName, boolean force)
}
@Override
- public void activateCatalog(String catalogName) throws NoSuchCatalogException {
+ public void enableCatalog(String catalogName) throws NoSuchCatalogException {
ErrorResponse resp =
restClient.get(
String.format(API_METALAKES_CATALOGS_PATH, this.name(), catalogName) + "/activate",
@@ -312,10 +312,10 @@ public void activateCatalog(String catalogName) throws NoSuchCatalogException {
}
@Override
- public void deactivateCatalog(String catalogName) throws NoSuchCatalogException {
+ public void disableCatalog(String catalogName) throws NoSuchCatalogException {
ErrorResponse resp =
restClient.get(
- String.format(API_METALAKES_CATALOGS_PATH, this.name(), catalogName) + "/deactivate",
+ String.format(API_METALAKES_CATALOGS_PATH, this.name(), catalogName) + "/disable",
ErrorResponse.class,
Collections.emptyMap(),
ErrorHandlers.catalogErrorHandler());
diff --git a/clients/client-java/src/test/java/org/apache/gravitino/client/integration/test/CatalogIT.java b/clients/client-java/src/test/java/org/apache/gravitino/client/integration/test/CatalogIT.java
index d18de730b2a..44977cdcb16 100644
--- a/clients/client-java/src/test/java/org/apache/gravitino/client/integration/test/CatalogIT.java
+++ b/clients/client-java/src/test/java/org/apache/gravitino/client/integration/test/CatalogIT.java
@@ -147,10 +147,10 @@ public void testDropCatalog() {
Assertions.assertThrows(
CatalogInUseException.class, () -> metalake.dropCatalog(catalogName));
Assertions.assertTrue(
- exception.getMessage().contains("please deactivate it first or use force option"),
+ exception.getMessage().contains("please disable it first or use force option"),
exception.getMessage());
- Assertions.assertDoesNotThrow(() -> metalake.deactivateCatalog(catalogName));
+ Assertions.assertDoesNotThrow(() -> metalake.disableCatalog(catalogName));
Assertions.assertTrue(metalake.dropCatalog(catalogName), "catalog should be dropped");
Assertions.assertFalse(metalake.dropCatalog(catalogName), "catalog should be non-existent");
}
@@ -167,10 +167,10 @@ public void testCatalogAvailable() {
Assertions.assertThrows(
CatalogInUseException.class, () -> metalake.dropCatalog(catalogName));
Assertions.assertTrue(
- exception.getMessage().contains("please deactivate it first or use force option"),
+ exception.getMessage().contains("please disable it first or use force option"),
exception.getMessage());
- Assertions.assertDoesNotThrow(() -> metalake.deactivateCatalog(catalogName));
+ Assertions.assertDoesNotThrow(() -> metalake.disableCatalog(catalogName));
Catalog loadedCatalog = metalake.loadCatalog(catalogName);
Assertions.assertEquals("false", loadedCatalog.properties().get(PROPERTY_IN_USE));
@@ -235,7 +235,7 @@ public void testCreateCatalogWithoutProperties() {
Assertions.assertEquals("hadoop", catalog.provider());
Assertions.assertEquals("catalog comment", catalog.comment());
Assertions.assertEquals("true", catalog.properties().get(PROPERTY_IN_USE));
- metalake.deactivateCatalog(catalogName);
+ metalake.disableCatalog(catalogName);
metalake.dropCatalog(catalogName);
// test cloud related properties
@@ -266,7 +266,7 @@ public void testCreateCatalogWithoutProperties() {
Assertions.assertFalse(catalog.properties().isEmpty());
Assertions.assertEquals("aws", catalog.properties().get("cloud.name"));
Assertions.assertEquals("us-west-2", catalog.properties().get("cloud.region-code"));
- metalake.deactivateCatalog(catalogName);
+ metalake.disableCatalog(catalogName);
metalake.dropCatalog(catalogName);
}
@@ -286,7 +286,7 @@ public void testCreateCatalogWithChinese() {
Assertions.assertEquals("这是中文comment", catalog.comment());
Assertions.assertTrue(catalog.properties().containsKey("metastore.uris"));
- metalake.deactivateCatalog(catalogName);
+ metalake.disableCatalog(catalogName);
metalake.dropCatalog(catalogName);
}
@@ -319,10 +319,10 @@ public void testListCatalogsInfo() {
Assertions.assertTrue(ArrayUtils.contains(catalogs, relCatalog));
Assertions.assertTrue(ArrayUtils.contains(catalogs, fileCatalog));
- metalake.deactivateCatalog(relCatalogName);
+ metalake.disableCatalog(relCatalogName);
metalake.dropCatalog(relCatalogName);
- metalake.deactivateCatalog(fileCatalogName);
+ metalake.disableCatalog(fileCatalogName);
metalake.dropCatalog(fileCatalogName);
}
@@ -358,7 +358,7 @@ public void testCreateCatalogWithPackage() {
Assertions.assertEquals("catalog comment", catalog.comment());
Assertions.assertTrue(catalog.properties().containsKey("package"));
- metalake.deactivateCatalog(catalogName);
+ metalake.disableCatalog(catalogName);
metalake.dropCatalog(catalogName);
// Test using invalid package path
@@ -392,7 +392,7 @@ void testUpdateCatalogWithNullableComment() {
metalake.alterCatalog(catalogName, CatalogChange.updateComment("new catalog comment"));
Assertions.assertEquals("new catalog comment", updatedCatalog.comment());
- metalake.deactivateCatalog(catalogName);
+ metalake.disableCatalog(catalogName);
metalake.dropCatalog(catalogName);
}
@@ -423,7 +423,7 @@ public void testAlterCatalogProperties() {
Assertions.assertEquals(alterCloudName, alteredCatalog.properties().get(Catalog.CLOUD_NAME));
Assertions.assertEquals(
alterRegionCode, alteredCatalog.properties().get(Catalog.CLOUD_REGION_CODE));
- metalake.deactivateCatalog(catalogName);
+ metalake.disableCatalog(catalogName);
metalake.dropCatalog(catalogName);
}
}
diff --git a/clients/client-python/gravitino/client/gravitino_client.py b/clients/client-python/gravitino/client/gravitino_client.py
index e3d5e4eab8e..e182f5a200e 100644
--- a/clients/client-python/gravitino/client/gravitino_client.py
+++ b/clients/client-python/gravitino/client/gravitino_client.py
@@ -92,8 +92,8 @@ def alter_catalog(self, name: str, *changes: CatalogChange):
def drop_catalog(self, name: str, force: bool = False) -> bool:
return self.get_metalake().drop_catalog(name, force)
- def activate_catalog(self, name: str):
- return self.get_metalake().activate_catalog(name)
+ def enable_catalog(self, name: str):
+ return self.get_metalake().enable_catalog(name)
- def deactivate_catalog(self, name: str):
- return self.get_metalake().deactivate_catalog(name)
+ def disable_catalog(self, name: str):
+ return self.get_metalake().disable_catalog(name)
diff --git a/clients/client-python/gravitino/client/gravitino_metalake.py b/clients/client-python/gravitino/client/gravitino_metalake.py
index 0c2abec4cd4..83005ebd905 100644
--- a/clients/client-python/gravitino/client/gravitino_metalake.py
+++ b/clients/client-python/gravitino/client/gravitino_metalake.py
@@ -206,8 +206,8 @@ def drop_catalog(self, name: str, force: bool = False) -> bool:
return drop_response.dropped()
- def activate_catalog(self, name: str):
- """Activate the catalog with specified name. If the catalog is already activated, this method does nothing.
+ def enable_catalog(self, name: str):
+ """Enable the catalog with specified name. If the catalog is already in use, this method does nothing.
Args:
name: the name of the catalog.
@@ -215,11 +215,11 @@ def activate_catalog(self, name: str):
Raises:
NoSuchCatalogException if the catalog with specified name does not exist.
"""
- url = self.API_METALAKES_CATALOGS_PATH.format(self.name(), name) + "/activate"
+ url = self.API_METALAKES_CATALOGS_PATH.format(self.name(), name) + "/enable"
self.rest_client.get(url, error_handler=CATALOG_ERROR_HANDLER)
- def deactivate_catalog(self, name: str):
- """Deactivate the catalog with specified name. If the catalog is already deactivated, this method does nothing.
+ def disable_catalog(self, name: str):
+ """Disable the catalog with specified name. If the catalog is already disabled, this method does nothing.
Args:
name: the name of the catalog.
@@ -227,5 +227,5 @@ def deactivate_catalog(self, name: str):
Raises:
NoSuchCatalogException if the catalog with specified name does not exist.
"""
- url = self.API_METALAKES_CATALOGS_PATH.format(self.name(), name) + "/deactivate"
+ url = self.API_METALAKES_CATALOGS_PATH.format(self.name(), name) + "/disable"
self.rest_client.get(url, error_handler=CATALOG_ERROR_HANDLER)
diff --git a/core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java b/core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java
index dece9e912d8..fd50a643c14 100644
--- a/core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java
+++ b/core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java
@@ -489,7 +489,7 @@ public void testConnection(
}
@Override
- public void activateCatalog(NameIdentifier ident)
+ public void enableCatalog(NameIdentifier ident)
throws NoSuchCatalogException, CatalogNotInUseException {
try {
if (catalogInUse(store, ident)) {
@@ -518,7 +518,7 @@ public void activateCatalog(NameIdentifier ident)
}
@Override
- public void deactivateCatalog(NameIdentifier ident) throws NoSuchCatalogException {
+ public void disableCatalog(NameIdentifier ident) throws NoSuchCatalogException {
try {
if (!catalogInUse(store, ident)) {
return;
@@ -559,8 +559,7 @@ public void deactivateCatalog(NameIdentifier ident) throws NoSuchCatalogExceptio
public Catalog alterCatalog(NameIdentifier ident, CatalogChange... changes)
throws NoSuchCatalogException, IllegalArgumentException {
if (!catalogInUse(store, ident)) {
- throw new CatalogNotInUseException(
- "Catalog %s is not in use, please activate it first", ident);
+ throw new CatalogNotInUseException("Catalog %s is not in use, please enable it first", ident);
}
// There could be a race issue that someone is using the catalog from cache while we are
@@ -633,7 +632,7 @@ public boolean dropCatalog(NameIdentifier ident, boolean force)
boolean catalogInUse = catalogInUse(store, ident);
if (catalogInUse && !force) {
throw new CatalogInUseException(
- "Catalog %s is in use, please deactivate it first or use force option", ident);
+ "Catalog %s is in use, please disable it first or use force option", ident);
}
List schemas =
@@ -652,8 +651,8 @@ public boolean dropCatalog(NameIdentifier ident, boolean force)
// If reached here, it implies that the catalog is not in use or force is true.
if (catalogInUse) {
- // force is true, deactivate the catalog first
- deactivateCatalog(ident);
+ // force is true, disable the catalog first
+ disableCatalog(ident);
}
catalogCache.invalidate(ident);
diff --git a/core/src/main/java/org/apache/gravitino/catalog/CatalogNormalizeDispatcher.java b/core/src/main/java/org/apache/gravitino/catalog/CatalogNormalizeDispatcher.java
index b65d5f03fac..01bfc8f9e23 100644
--- a/core/src/main/java/org/apache/gravitino/catalog/CatalogNormalizeDispatcher.java
+++ b/core/src/main/java/org/apache/gravitino/catalog/CatalogNormalizeDispatcher.java
@@ -125,13 +125,13 @@ public void testConnection(
}
@Override
- public void activateCatalog(NameIdentifier ident) throws NoSuchCatalogException {
- dispatcher.activateCatalog(ident);
+ public void enableCatalog(NameIdentifier ident) throws NoSuchCatalogException {
+ dispatcher.enableCatalog(ident);
}
@Override
- public void deactivateCatalog(NameIdentifier ident) throws NoSuchCatalogException {
- dispatcher.deactivateCatalog(ident);
+ public void disableCatalog(NameIdentifier ident) throws NoSuchCatalogException {
+ dispatcher.disableCatalog(ident);
}
private void validateCatalogName(String name) throws IllegalArgumentException {
diff --git a/core/src/main/java/org/apache/gravitino/catalog/SupportsCatalogs.java b/core/src/main/java/org/apache/gravitino/catalog/SupportsCatalogs.java
index 51ec27e332b..b1c84fb3b0a 100644
--- a/core/src/main/java/org/apache/gravitino/catalog/SupportsCatalogs.java
+++ b/core/src/main/java/org/apache/gravitino/catalog/SupportsCatalogs.java
@@ -123,7 +123,7 @@ Catalog alterCatalog(NameIdentifier ident, CatalogChange... changes)
*
* - There is no schema in the catalog. Otherwise, a {@link NonEmptyEntityException} will be
* thrown.
- *
- The method {@link #deactivateCatalog(NameIdentifier)} has been called before dropping the
+ *
- The method {@link #disableCatalog(NameIdentifier)} has been called before dropping the
* catalog.
*
*
@@ -177,21 +177,20 @@ void testConnection(
throws Exception;
/**
- * Activate a catalog. If the catalog is already active, this method does nothing.
+ * Enable a catalog. If the catalog is already enable, this method does nothing.
*
* @param ident The identifier of the catalog.
* @throws NoSuchCatalogException If the catalog does not exist.
- * @throws CatalogNotInUseException If its parent metalake is not active.
+ * @throws CatalogNotInUseException If its parent metalake is not in use.
*/
- void activateCatalog(NameIdentifier ident)
- throws NoSuchCatalogException, CatalogNotInUseException;
+ void enableCatalog(NameIdentifier ident) throws NoSuchCatalogException, CatalogNotInUseException;
/**
- * Deactivate a catalog. If the catalog is already deactivated, this method does nothing. Once a
- * catalog is deactivated:
+ * Disable a catalog. If the catalog is already disabled, this method does nothing. Once a catalog
+ * is disabled:
*
*
- * - It can only be listed, loaded, dropped, or activated.
+ *
- It can only be listed, loaded, dropped, or disable.
*
- Any other operations on the catalog will throw an {@link CatalogNotInUseException}.
*
- Any operation on the sub-entities (schemas, tables, etc.) will throw an {@link
* CatalogNotInUseException}.
@@ -200,5 +199,5 @@ void activateCatalog(NameIdentifier ident)
* @param ident The identifier of the catalog.
* @throws NoSuchCatalogException If the catalog does not exist.
*/
- void deactivateCatalog(NameIdentifier ident) throws NoSuchCatalogException;
+ void disableCatalog(NameIdentifier ident) throws NoSuchCatalogException;
}
diff --git a/core/src/main/java/org/apache/gravitino/hook/CatalogHookDispatcher.java b/core/src/main/java/org/apache/gravitino/hook/CatalogHookDispatcher.java
index 808459099e1..3dc2bc2bdab 100644
--- a/core/src/main/java/org/apache/gravitino/hook/CatalogHookDispatcher.java
+++ b/core/src/main/java/org/apache/gravitino/hook/CatalogHookDispatcher.java
@@ -130,14 +130,14 @@ public void testConnection(
}
@Override
- public void activateCatalog(NameIdentifier ident)
+ public void enableCatalog(NameIdentifier ident)
throws NoSuchCatalogException, CatalogNotInUseException {
- dispatcher.activateCatalog(ident);
+ dispatcher.enableCatalog(ident);
}
@Override
- public void deactivateCatalog(NameIdentifier ident) throws NoSuchCatalogException {
- dispatcher.deactivateCatalog(ident);
+ public void disableCatalog(NameIdentifier ident) throws NoSuchCatalogException {
+ dispatcher.disableCatalog(ident);
}
@Override
diff --git a/core/src/main/java/org/apache/gravitino/listener/CatalogEventDispatcher.java b/core/src/main/java/org/apache/gravitino/listener/CatalogEventDispatcher.java
index 6c2457338c8..04a2600d8ec 100644
--- a/core/src/main/java/org/apache/gravitino/listener/CatalogEventDispatcher.java
+++ b/core/src/main/java/org/apache/gravitino/listener/CatalogEventDispatcher.java
@@ -175,15 +175,15 @@ public void testConnection(
}
@Override
- public void activateCatalog(NameIdentifier ident)
+ public void enableCatalog(NameIdentifier ident)
throws NoSuchCatalogException, CatalogNotInUseException {
// todo: support activate catalog event
- dispatcher.activateCatalog(ident);
+ dispatcher.enableCatalog(ident);
}
@Override
- public void deactivateCatalog(NameIdentifier ident) throws NoSuchCatalogException {
- // todo: support deactivate catalog event
- dispatcher.deactivateCatalog(ident);
+ public void disableCatalog(NameIdentifier ident) throws NoSuchCatalogException {
+ // todo: support disable catalog event
+ dispatcher.disableCatalog(ident);
}
}
diff --git a/core/src/test/java/org/apache/gravitino/catalog/TestCatalogManager.java b/core/src/test/java/org/apache/gravitino/catalog/TestCatalogManager.java
index 2baf61dbb25..007ed7e84c9 100644
--- a/core/src/test/java/org/apache/gravitino/catalog/TestCatalogManager.java
+++ b/core/src/test/java/org/apache/gravitino/catalog/TestCatalogManager.java
@@ -460,7 +460,7 @@ public void testDropCatalog() {
CatalogInUseException.class, () -> catalogManager.dropCatalog(ident));
Assertions.assertTrue(exception.getMessage().contains("Catalog metalake.test41 is in use"));
- Assertions.assertDoesNotThrow(() -> catalogManager.deactivateCatalog(ident));
+ Assertions.assertDoesNotThrow(() -> catalogManager.disableCatalog(ident));
boolean dropped = catalogManager.dropCatalog(ident);
Assertions.assertTrue(dropped);
diff --git a/server/src/main/java/org/apache/gravitino/server/web/rest/CatalogOperations.java b/server/src/main/java/org/apache/gravitino/server/web/rest/CatalogOperations.java
index 758b27e5115..11544ba9383 100644
--- a/server/src/main/java/org/apache/gravitino/server/web/rest/CatalogOperations.java
+++ b/server/src/main/java/org/apache/gravitino/server/web/rest/CatalogOperations.java
@@ -188,13 +188,13 @@ public Response testConnection(
}
@GET
- @Path("{catalog}/activate")
+ @Path("{catalog}/enable")
@Produces("application/vnd.gravitino.v1+json")
- @Timed(name = "activate-catalog." + MetricNames.HTTP_PROCESS_DURATION, absolute = true)
- @ResponseMetered(name = "activate-catalog", absolute = true)
- public Response activateCatalog(
+ @Timed(name = "enable-catalog." + MetricNames.HTTP_PROCESS_DURATION, absolute = true)
+ @ResponseMetered(name = "enable-catalog", absolute = true)
+ public Response enableCatalog(
@PathParam("metalake") String metalake, @PathParam("catalog") String catalogName) {
- LOG.info("Received activate request for catalog: {}.{}", metalake, catalogName);
+ LOG.info("Received enable request for catalog: {}.{}", metalake, catalogName);
try {
return Utils.doAs(
httpRequest,
@@ -204,29 +204,29 @@ public Response activateCatalog(
NameIdentifierUtil.ofMetalake(metalake),
LockType.WRITE,
() -> {
- catalogDispatcher.activateCatalog(ident);
+ catalogDispatcher.enableCatalog(ident);
return null;
});
Response response = Utils.ok(new BaseResponse());
- LOG.info("Successfully activate catalog: {}.{}", metalake, catalogName);
+ LOG.info("Successfully enable catalog: {}.{}", metalake, catalogName);
return response;
});
} catch (Exception e) {
- LOG.info("Failed to activate catalog: {}.{}", metalake, catalogName);
+ LOG.info("Failed to enable catalog: {}.{}", metalake, catalogName);
return ExceptionHandlers.handleCatalogException(
- OperationType.ACTIVATE, catalogName, metalake, e);
+ OperationType.ENABLE, catalogName, metalake, e);
}
}
@GET
- @Path("{catalog}/deactivate")
- @Produces("application/vnd.gravitino.v1+json")
- @Timed(name = "deactivate-catalog." + MetricNames.HTTP_PROCESS_DURATION, absolute = true)
- @ResponseMetered(name = "deactivate-catalog", absolute = true)
- public Response deactivateCatalog(
+ @Path("{catalog}/disable")
+ @Produces("disable/vnd.gravitino.v1+json")
+ @Timed(name = "disable-catalog." + MetricNames.HTTP_PROCESS_DURATION, absolute = true)
+ @ResponseMetered(name = "disable-catalog", absolute = true)
+ public Response disableCatalog(
@PathParam("metalake") String metalake, @PathParam("catalog") String catalogName) {
- LOG.info("Received deactivate request for catalog: {}.{}", metalake, catalogName);
+ LOG.info("Received disable request for catalog: {}.{}", metalake, catalogName);
try {
return Utils.doAs(
httpRequest,
@@ -236,18 +236,18 @@ public Response deactivateCatalog(
NameIdentifierUtil.ofMetalake(metalake),
LockType.WRITE,
() -> {
- catalogDispatcher.deactivateCatalog(ident);
+ catalogDispatcher.disableCatalog(ident);
return null;
});
Response response = Utils.ok(new BaseResponse());
- LOG.info("Successfully deactivate catalog: {}.{}", metalake, catalogName);
+ LOG.info("Successfully disable catalog: {}.{}", metalake, catalogName);
return response;
});
} catch (Exception e) {
- LOG.info("Failed to deactivate catalog: {}.{}", metalake, catalogName);
+ LOG.info("Failed to disable catalog: {}.{}", metalake, catalogName);
return ExceptionHandlers.handleCatalogException(
- OperationType.DEACTIVATE, catalogName, metalake, e);
+ OperationType.DISABLE, catalogName, metalake, e);
}
}
diff --git a/server/src/main/java/org/apache/gravitino/server/web/rest/OperationType.java b/server/src/main/java/org/apache/gravitino/server/web/rest/OperationType.java
index 61387208978..8d4bc322ae7 100644
--- a/server/src/main/java/org/apache/gravitino/server/web/rest/OperationType.java
+++ b/server/src/main/java/org/apache/gravitino/server/web/rest/OperationType.java
@@ -24,8 +24,8 @@ public enum OperationType {
LOAD,
ALTER,
DROP,
- ACTIVATE,
- DEACTIVATE,
+ ENABLE,
+ DISABLE,
/** This is a special operation type that is used to get a partition from a table. */
GET,
ADD,
diff --git a/trino-connector/integration-test/src/test/java/org/apache/gravitino/trino/connector/integration/test/TrinoConnectorIT.java b/trino-connector/integration-test/src/test/java/org/apache/gravitino/trino/connector/integration/test/TrinoConnectorIT.java
index 238d27e4535..466932b0608 100644
--- a/trino-connector/integration-test/src/test/java/org/apache/gravitino/trino/connector/integration/test/TrinoConnectorIT.java
+++ b/trino-connector/integration-test/src/test/java/org/apache/gravitino/trino/connector/integration/test/TrinoConnectorIT.java
@@ -1372,7 +1372,7 @@ void testDropCatalogAndCreateAgain() {
boolean success = checkTrinoHasLoaded(sql, 30);
Assertions.assertTrue(success, "Trino should load the catalog: " + sql);
- createdMetalake.deactivateCatalog(catalogName);
+ createdMetalake.disableCatalog(catalogName);
createdMetalake.dropCatalog(catalogName);
// We need to test we can't load this catalog any more by Trino.
success = checkTrinoHasRemoved(sql, 30);
diff --git a/trino-connector/integration-test/src/test/java/org/apache/gravitino/trino/connector/integration/test/TrinoQueryITBase.java b/trino-connector/integration-test/src/test/java/org/apache/gravitino/trino/connector/integration/test/TrinoQueryITBase.java
index 0c374e21ef1..eabd7732194 100644
--- a/trino-connector/integration-test/src/test/java/org/apache/gravitino/trino/connector/integration/test/TrinoQueryITBase.java
+++ b/trino-connector/integration-test/src/test/java/org/apache/gravitino/trino/connector/integration/test/TrinoQueryITBase.java
@@ -232,7 +232,7 @@ protected static void dropCatalog(String catalogName) {
LOG.info("Drop schema \"{}.{}\".{}", metalakeName, catalogName, schema);
});
- metalake.deactivateCatalog(catalogName);
+ metalake.disableCatalog(catalogName);
metalake.dropCatalog(catalogName);
LOG.info("Drop catalog \"{}.{}\"", metalakeName, catalogName);
}