You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polaris.apache.org by yu...@apache.org on 2026/04/03 17:36:46 UTC
(polaris) branch main updated: Core: Rename ExternalCatalogFactory to FederatedCatalogFactory (#4116)
This is an automated email from the ASF dual-hosted git repository.
yufei pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push:
new c36851a231 Core: Rename ExternalCatalogFactory to FederatedCatalogFactory (#4116)
c36851a231 is described below
commit c36851a2313aa9b284e3214d724ffa09b0359cc5
Author: Yufei Gu <yu...@apache.org>
AuthorDate: Fri Apr 3 10:36:41 2026 -0700
Core: Rename ExternalCatalogFactory to FederatedCatalogFactory (#4116)
---
CHANGELOG.md | 2 +-
.../federation/hadoop/HadoopFederatedCatalogFactory.java | 4 ++--
.../federation/hive/HiveFederatedCatalogFactory.java | 4 ++--
...lCatalogFactory.java => FederatedCatalogFactory.java} | 4 ++--
.../apache/polaris/core/connection/ConnectionType.java | 2 +-
.../catalog/generic/GenericTableCatalogHandler.java | 14 +++++++-------
.../generic/GenericTableCatalogHandlerFactory.java | 6 +++---
.../service/catalog/iceberg/IcebergCatalogHandler.java | 16 ++++++++--------
.../catalog/iceberg/IcebergCatalogHandlerFactory.java | 6 +++---
...tory.java => IcebergRESTFederatedCatalogFactory.java} | 4 ++--
.../java/org/apache/polaris/service/TestServices.java | 10 +++++-----
11 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9a3457a8b8..cfdcba3b9d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -41,7 +41,7 @@ request adding CHANGELOG notes for breaking (!) changes and possibly other secti
- The (Before/After)CommitViewEvent has been removed.
- The (Before/After)CommitTableEvent has been removed.
- The `PolarisMetricsReporter.reportMetric()` method signature has been extended to include a `receivedTimestamp` parameter of type `java.time.Instant`.
-- The `ExternalCatalogFactory.createCatalog()` and `createGenericCatalog()` method signatures have been extended to include a `catalogProperties` parameter of type `Map<String, String>` for passing through proxy and timeout settings to federated catalog HTTP clients.
+- The ExternalCatalogFactory interface has been renamed to FederatedCatalogFactory. Its createCatalog() and createGenericCatalog() method signatures have been extended to include a `catalogProperties` parameter of type `Map<String, String>` for passing through proxy and timeout settings to federated catalog HTTP clients.
- Metrics reporting now requires the `TABLE_READ_DATA` privilege on the target table for read (scan) metrics and `TABLE_WRITE_DATA` for write (commit) metrics.
- The `REVOKE_CATALOG_ROLE_FROM_PRINCIPAL_ROLE` operation no longer requires the `PRINCIPAL_ROLE_MANAGE_GRANTS_FOR_GRANTEE` privilege. Only `CATALOG_ROLE_MANAGE_GRANTS_ON_SECURABLE` on the catalog role is now required, making revoke symmetric with assign. This allows catalog administrators to fully manage catalog role assignments without requiring elevated privileges on principal roles.
diff --git a/extensions/federation/hadoop/src/main/java/org/apache/polaris/extensions/federation/hadoop/HadoopFederatedCatalogFactory.java b/extensions/federation/hadoop/src/main/java/org/apache/polaris/extensions/federation/hadoop/HadoopFederatedCatalogFactory.java
index 3f44f76f3c..28aa7a09cc 100644
--- a/extensions/federation/hadoop/src/main/java/org/apache/polaris/extensions/federation/hadoop/HadoopFederatedCatalogFactory.java
+++ b/extensions/federation/hadoop/src/main/java/org/apache/polaris/extensions/federation/hadoop/HadoopFederatedCatalogFactory.java
@@ -25,7 +25,7 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.iceberg.catalog.Catalog;
import org.apache.iceberg.hadoop.HadoopCatalog;
import org.apache.iceberg.rest.RESTUtil;
-import org.apache.polaris.core.catalog.ExternalCatalogFactory;
+import org.apache.polaris.core.catalog.FederatedCatalogFactory;
import org.apache.polaris.core.catalog.GenericTableCatalog;
import org.apache.polaris.core.connection.AuthenticationParametersDpo;
import org.apache.polaris.core.connection.AuthenticationType;
@@ -37,7 +37,7 @@ import org.apache.polaris.core.credentials.PolarisCredentialManager;
/** Factory class for creating a Hadoop catalog handle based on connection configuration. */
@ApplicationScoped
@Identifier(ConnectionType.HADOOP_FACTORY_IDENTIFIER)
-public class HadoopFederatedCatalogFactory implements ExternalCatalogFactory {
+public class HadoopFederatedCatalogFactory implements FederatedCatalogFactory {
@Override
public Catalog createCatalog(
diff --git a/extensions/federation/hive/src/main/java/org/apache/polaris/extensions/federation/hive/HiveFederatedCatalogFactory.java b/extensions/federation/hive/src/main/java/org/apache/polaris/extensions/federation/hive/HiveFederatedCatalogFactory.java
index 7965402491..1ba785d334 100644
--- a/extensions/federation/hive/src/main/java/org/apache/polaris/extensions/federation/hive/HiveFederatedCatalogFactory.java
+++ b/extensions/federation/hive/src/main/java/org/apache/polaris/extensions/federation/hive/HiveFederatedCatalogFactory.java
@@ -24,7 +24,7 @@ import java.util.Map;
import org.apache.iceberg.catalog.Catalog;
import org.apache.iceberg.hive.HiveCatalog;
import org.apache.iceberg.rest.RESTUtil;
-import org.apache.polaris.core.catalog.ExternalCatalogFactory;
+import org.apache.polaris.core.catalog.FederatedCatalogFactory;
import org.apache.polaris.core.catalog.GenericTableCatalog;
import org.apache.polaris.core.connection.AuthenticationParametersDpo;
import org.apache.polaris.core.connection.AuthenticationType;
@@ -36,7 +36,7 @@ import org.apache.polaris.core.credentials.PolarisCredentialManager;
/** Factory class for creating a Hive catalog handle based on connection configuration. */
@ApplicationScoped
@Identifier(ConnectionType.HIVE_FACTORY_IDENTIFIER)
-public class HiveFederatedCatalogFactory implements ExternalCatalogFactory {
+public class HiveFederatedCatalogFactory implements FederatedCatalogFactory {
@Override
public Catalog createCatalog(
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/catalog/ExternalCatalogFactory.java b/polaris-core/src/main/java/org/apache/polaris/core/catalog/FederatedCatalogFactory.java
similarity index 95%
rename from polaris-core/src/main/java/org/apache/polaris/core/catalog/ExternalCatalogFactory.java
rename to polaris-core/src/main/java/org/apache/polaris/core/catalog/FederatedCatalogFactory.java
index 1614c61fcf..4456057bfd 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/catalog/ExternalCatalogFactory.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/catalog/FederatedCatalogFactory.java
@@ -24,12 +24,12 @@ import org.apache.polaris.core.connection.ConnectionConfigInfoDpo;
import org.apache.polaris.core.credentials.PolarisCredentialManager;
/**
- * Factory interface for creating external catalog handles based on connection configuration.
+ * Factory interface for creating federated catalog handles based on connection configuration.
*
* <p>Implementations should be annotated with CDI annotations and use the @Identifier annotation to
* specify which connection type they support.
*/
-public interface ExternalCatalogFactory {
+public interface FederatedCatalogFactory {
/**
* Creates a catalog handle for the given connection configuration.
diff --git a/polaris-core/src/main/java/org/apache/polaris/core/connection/ConnectionType.java b/polaris-core/src/main/java/org/apache/polaris/core/connection/ConnectionType.java
index 2df6b74282..2ba3c4173d 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/connection/ConnectionType.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/connection/ConnectionType.java
@@ -85,7 +85,7 @@ public enum ConnectionType {
/**
* Get the factory identifier string used for CDI injection of the appropriate
- * ExternalCatalogFactory.
+ * FederatedCatalogFactory.
*
* @return the factory identifier string
*/
diff --git a/runtime/service/src/main/java/org/apache/polaris/service/catalog/generic/GenericTableCatalogHandler.java b/runtime/service/src/main/java/org/apache/polaris/service/catalog/generic/GenericTableCatalogHandler.java
index 0acae1d310..874a2ef546 100644
--- a/runtime/service/src/main/java/org/apache/polaris/service/catalog/generic/GenericTableCatalogHandler.java
+++ b/runtime/service/src/main/java/org/apache/polaris/service/catalog/generic/GenericTableCatalogHandler.java
@@ -25,7 +25,7 @@ import java.util.Map;
import org.apache.iceberg.catalog.Namespace;
import org.apache.iceberg.catalog.TableIdentifier;
import org.apache.polaris.core.auth.PolarisAuthorizableOperation;
-import org.apache.polaris.core.catalog.ExternalCatalogFactory;
+import org.apache.polaris.core.catalog.FederatedCatalogFactory;
import org.apache.polaris.core.catalog.GenericTableCatalog;
import org.apache.polaris.core.config.FeatureConfiguration;
import org.apache.polaris.core.connection.ConnectionConfigInfoDpo;
@@ -49,7 +49,7 @@ public abstract class GenericTableCatalogHandler extends CatalogHandler {
protected abstract PolarisCredentialManager credentialManager();
- protected abstract Instance<ExternalCatalogFactory> externalCatalogFactories();
+ protected abstract Instance<FederatedCatalogFactory> federatedCatalogFactories();
private GenericTableCatalog genericTableCatalog;
@@ -70,15 +70,15 @@ public abstract class GenericTableCatalogHandler extends CatalogHandler {
ConnectionType connectionType =
ConnectionType.fromCode(connectionConfigInfoDpo.getConnectionTypeCode());
- // Use the unified factory pattern for all external catalog types
- Instance<ExternalCatalogFactory> externalCatalogFactory =
- externalCatalogFactories()
+ // Use the unified factory pattern for all federated catalog types
+ Instance<FederatedCatalogFactory> federatedCatalogFactory =
+ federatedCatalogFactories()
.select(Identifier.Literal.of(connectionType.getFactoryIdentifier()));
- if (externalCatalogFactory.isResolvable()) {
+ if (federatedCatalogFactory.isResolvable()) {
// Pass through catalog properties (e.g., rest.client.proxy.*, timeout settings)
Map<String, String> catalogProperties = resolvedCatalogEntity.getPropertiesAsMap();
federatedCatalog =
- externalCatalogFactory
+ federatedCatalogFactory
.get()
.createGenericCatalog(
connectionConfigInfoDpo, credentialManager(), catalogProperties);
diff --git a/runtime/service/src/main/java/org/apache/polaris/service/catalog/generic/GenericTableCatalogHandlerFactory.java b/runtime/service/src/main/java/org/apache/polaris/service/catalog/generic/GenericTableCatalogHandlerFactory.java
index d0f42ca552..f9d789a7cc 100644
--- a/runtime/service/src/main/java/org/apache/polaris/service/catalog/generic/GenericTableCatalogHandlerFactory.java
+++ b/runtime/service/src/main/java/org/apache/polaris/service/catalog/generic/GenericTableCatalogHandlerFactory.java
@@ -24,7 +24,7 @@ import jakarta.enterprise.inject.Instance;
import jakarta.inject.Inject;
import org.apache.polaris.core.auth.PolarisAuthorizer;
import org.apache.polaris.core.auth.PolarisPrincipal;
-import org.apache.polaris.core.catalog.ExternalCatalogFactory;
+import org.apache.polaris.core.catalog.FederatedCatalogFactory;
import org.apache.polaris.core.context.CallContext;
import org.apache.polaris.core.credentials.PolarisCredentialManager;
import org.apache.polaris.core.persistence.PolarisMetaStoreManager;
@@ -38,7 +38,7 @@ public class GenericTableCatalogHandlerFactory {
@Inject PolarisMetaStoreManager metaStoreManager;
@Inject PolarisAuthorizer authorizer;
@Inject PolarisCredentialManager credentialManager;
- @Inject @Any Instance<ExternalCatalogFactory> externalCatalogFactories;
+ @Inject @Any Instance<FederatedCatalogFactory> federatedCatalogFactories;
public GenericTableCatalogHandler createHandler(String catalogName, PolarisPrincipal principal) {
return ImmutableGenericTableCatalogHandler.builder()
@@ -49,7 +49,7 @@ public class GenericTableCatalogHandlerFactory {
.metaStoreManager(metaStoreManager)
.authorizer(authorizer)
.credentialManager(credentialManager)
- .externalCatalogFactories(externalCatalogFactories)
+ .federatedCatalogFactories(federatedCatalogFactories)
.build();
}
}
diff --git a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java
index 3b378c7d04..6a56116d9f 100644
--- a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java
+++ b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java
@@ -89,7 +89,7 @@ import org.apache.iceberg.rest.responses.LoadViewResponse;
import org.apache.iceberg.rest.responses.UpdateNamespacePropertiesResponse;
import org.apache.polaris.core.PolarisDiagnostics;
import org.apache.polaris.core.auth.PolarisAuthorizableOperation;
-import org.apache.polaris.core.catalog.ExternalCatalogFactory;
+import org.apache.polaris.core.catalog.FederatedCatalogFactory;
import org.apache.polaris.core.config.FeatureConfiguration;
import org.apache.polaris.core.connection.ConnectionConfigInfoDpo;
import org.apache.polaris.core.connection.ConnectionType;
@@ -187,7 +187,7 @@ public abstract class IcebergCatalogHandler extends CatalogHandler implements Au
protected abstract PolarisCredentialManager credentialManager();
- protected abstract Instance<ExternalCatalogFactory> externalCatalogFactories();
+ protected abstract Instance<FederatedCatalogFactory> federatedCatalogFactories();
protected abstract CatalogPrefixParser prefixParser();
@@ -265,16 +265,16 @@ public abstract class IcebergCatalogHandler extends CatalogHandler implements Au
ConnectionType connectionType =
ConnectionType.fromCode(connectionConfigInfoDpo.getConnectionTypeCode());
- // Use the unified factory pattern for all external catalog types
- Instance<ExternalCatalogFactory> externalCatalogFactory =
- externalCatalogFactories()
+ // Use the unified factory pattern for all federated catalog types
+ Instance<FederatedCatalogFactory> federatedCatalogFactory =
+ federatedCatalogFactories()
.select(Identifier.Literal.of(connectionType.getFactoryIdentifier()));
- if (externalCatalogFactory.isResolvable()) {
+ if (federatedCatalogFactory.isResolvable()) {
// Pass through catalog properties (e.g., rest.client.proxy.*, timeout settings)
- // to the external catalog factory for configuration of the underlying HTTP client
+ // to the federated catalog factory for configuration of the underlying HTTP client
Map<String, String> catalogProperties = resolvedCatalogEntity.getPropertiesAsMap();
federatedCatalog =
- externalCatalogFactory
+ federatedCatalogFactory
.get()
.createCatalog(connectionConfigInfoDpo, credentialManager(), catalogProperties);
} else {
diff --git a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandlerFactory.java b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandlerFactory.java
index 08feb48976..3bd6554f83 100644
--- a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandlerFactory.java
+++ b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandlerFactory.java
@@ -26,7 +26,7 @@ import java.time.Clock;
import org.apache.polaris.core.PolarisDiagnostics;
import org.apache.polaris.core.auth.PolarisAuthorizer;
import org.apache.polaris.core.auth.PolarisPrincipal;
-import org.apache.polaris.core.catalog.ExternalCatalogFactory;
+import org.apache.polaris.core.catalog.FederatedCatalogFactory;
import org.apache.polaris.core.context.CallContext;
import org.apache.polaris.core.credentials.PolarisCredentialManager;
import org.apache.polaris.core.persistence.PolarisMetaStoreManager;
@@ -53,7 +53,7 @@ public class IcebergCatalogHandlerFactory {
@Inject PolarisAuthorizer authorizer;
@Inject ReservedProperties reservedProperties;
@Inject CatalogHandlerUtils catalogHandlerUtils;
- @Inject @Any Instance<ExternalCatalogFactory> externalCatalogFactories;
+ @Inject @Any Instance<FederatedCatalogFactory> federatedCatalogFactories;
@Inject StorageAccessConfigProvider storageAccessConfigProvider;
@Inject EventAttributeMap eventAttributeMap;
@Inject PolarisMetricsReporter metricsReporter;
@@ -74,7 +74,7 @@ public class IcebergCatalogHandlerFactory {
.authorizer(authorizer)
.reservedProperties(reservedProperties)
.catalogHandlerUtils(catalogHandlerUtils)
- .externalCatalogFactories(externalCatalogFactories)
+ .federatedCatalogFactories(federatedCatalogFactories)
.storageAccessConfigProvider(storageAccessConfigProvider)
.eventAttributeMap(eventAttributeMap)
.metricsReporter(metricsReporter)
diff --git a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRESTExternalCatalogFactory.java b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRESTFederatedCatalogFactory.java
similarity index 95%
rename from runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRESTExternalCatalogFactory.java
rename to runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRESTFederatedCatalogFactory.java
index d44dee8f85..8ec55913f8 100644
--- a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRESTExternalCatalogFactory.java
+++ b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRESTFederatedCatalogFactory.java
@@ -26,7 +26,7 @@ import org.apache.iceberg.catalog.SessionCatalog;
import org.apache.iceberg.rest.HTTPClient;
import org.apache.iceberg.rest.RESTCatalog;
import org.apache.iceberg.rest.RESTUtil;
-import org.apache.polaris.core.catalog.ExternalCatalogFactory;
+import org.apache.polaris.core.catalog.FederatedCatalogFactory;
import org.apache.polaris.core.catalog.GenericTableCatalog;
import org.apache.polaris.core.connection.ConnectionConfigInfoDpo;
import org.apache.polaris.core.connection.ConnectionType;
@@ -36,7 +36,7 @@ import org.apache.polaris.core.credentials.PolarisCredentialManager;
/** Factory class for creating an Iceberg REST catalog handle based on connection configuration. */
@ApplicationScoped
@Identifier(ConnectionType.ICEBERG_REST_FACTORY_IDENTIFIER)
-public class IcebergRESTExternalCatalogFactory implements ExternalCatalogFactory {
+public class IcebergRESTFederatedCatalogFactory implements FederatedCatalogFactory {
@Override
public Catalog createCatalog(
diff --git a/runtime/service/src/testFixtures/java/org/apache/polaris/service/TestServices.java b/runtime/service/src/testFixtures/java/org/apache/polaris/service/TestServices.java
index de597b8685..6ca6d82059 100644
--- a/runtime/service/src/testFixtures/java/org/apache/polaris/service/TestServices.java
+++ b/runtime/service/src/testFixtures/java/org/apache/polaris/service/TestServices.java
@@ -38,7 +38,7 @@ import org.apache.polaris.core.PolarisDefaultDiagServiceImpl;
import org.apache.polaris.core.PolarisDiagnostics;
import org.apache.polaris.core.auth.PolarisAuthorizer;
import org.apache.polaris.core.auth.PolarisPrincipal;
-import org.apache.polaris.core.catalog.ExternalCatalogFactory;
+import org.apache.polaris.core.catalog.FederatedCatalogFactory;
import org.apache.polaris.core.config.RealmConfig;
import org.apache.polaris.core.config.RealmConfigurationSource;
import org.apache.polaris.core.context.CallContext;
@@ -317,9 +317,9 @@ public record TestServices(
CatalogHandlerUtils catalogHandlerUtils = new CatalogHandlerUtils(realmConfig);
@SuppressWarnings("unchecked")
- Instance<ExternalCatalogFactory> externalCatalogFactory = Mockito.mock(Instance.class);
- Mockito.when(externalCatalogFactory.select(any())).thenReturn(externalCatalogFactory);
- Mockito.when(externalCatalogFactory.isUnsatisfied()).thenReturn(true);
+ Instance<FederatedCatalogFactory> federatedCatalogFactory = Mockito.mock(Instance.class);
+ Mockito.when(federatedCatalogFactory.select(any())).thenReturn(federatedCatalogFactory);
+ Mockito.when(federatedCatalogFactory.isUnsatisfied()).thenReturn(true);
EventAttributeMap eventAttributeMap = new EventAttributeMap();
@@ -342,7 +342,7 @@ public record TestServices(
.authorizer(authorizer)
.reservedProperties(reservedProperties)
.catalogHandlerUtils(catalogHandlerUtils)
- .externalCatalogFactories(externalCatalogFactory)
+ .federatedCatalogFactories(federatedCatalogFactory)
.storageAccessConfigProvider(storageAccessConfigProvider)
.eventAttributeMap(eventAttributeMap)
.metricsReporter(new DefaultMetricsReporter())