Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#4408] Calls to code marked @VisibleForTesting in production code (#4426)

Naresh-kumar-Thodupunoorieacdeabae9e6
diff --git a/catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/authentication/kerberos/KerberosClient.java b/catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/authentication/kerberos/KerberosClient.java
index b8f31699d5..4ea2fbdd9d 100644
--- a/catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/authentication/kerberos/KerberosClient.java
+++ b/catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/authentication/kerberos/KerberosClient.java
@@ -65,9 +65,8 @@ public class KerberosClient implements Closeable {
// Login
UserGroupInformation.setConfiguration(hadoopConf);
- UserGroupInformation kerberosLoginUgi =
- UserGroupInformation.loginUserFromKeytabAndReturnUGI(catalogPrincipal, keytabFilePath);
- UserGroupInformation.setLoginUser(kerberosLoginUgi);
+ UserGroupInformation.loginUserFromKeytab(catalogPrincipal, keytabFilePath);
+ UserGroupInformation kerberosLoginUgi = UserGroupInformation.getLoginUser();
// Refresh the cache if it's out of date.
if (refreshCredentials) {
diff --git a/catalogs/catalog-lakehouse-paimon/src/main/java/org/apache/gravitino/catalog/lakehouse/paimon/utils/CatalogUtils.java b/catalogs/catalog-lakehouse-paimon/src/main/java/org/apache/gravitino/catalog/lakehouse/paimon/utils/CatalogUtils.java
index fcc4f3088a..848063904f 100644
--- a/catalogs/catalog-lakehouse-paimon/src/main/java/org/apache/gravitino/catalog/lakehouse/paimon/utils/CatalogUtils.java
+++ b/catalogs/catalog-lakehouse-paimon/src/main/java/org/apache/gravitino/catalog/lakehouse/paimon/utils/CatalogUtils.java
@@ -24,7 +24,6 @@ import static org.apache.gravitino.catalog.lakehouse.paimon.PaimonConfig.CATALOG
import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION;
import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION;
-import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import java.io.File;
import java.util.Map;
@@ -46,7 +45,6 @@ public class CatalogUtils {
private CatalogUtils() {}
- @VisibleForTesting
public static PaimonBackendCatalogWrapper loadCatalogBackend(PaimonConfig paimonConfig) {
Map<String, String> allConfig = paimonConfig.getAllConfig();
AuthenticationConfig authenticationConfig = new AuthenticationConfig(allConfig);