diff --git a/LICENSE b/LICENSE index d1093d5c1d3..fa2c89bfe68 100644 --- a/LICENSE +++ b/LICENSE @@ -218,7 +218,7 @@ This product includes code from Apache Iceberg. * spec/iceberg-rest-catalog-open-api.yaml * spec/polaris-catalog-apis/oauth-tokens-api.yaml * integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogIntegrationBase.java -* runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java +* runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergCatalog.java * runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/CatalogHandlerUtils.java * plugins/spark/common/src/main/java/org/apache/polaris/spark/PolarisRESTCatalog.java * plugins/spark/v3.5/spark/src/main/java/org/apache/polaris/spark/SparkCatalog.java 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 7e778c08fdc..46d33faa930 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 @@ -309,7 +309,7 @@ public ListNamespacesResponse listNamespaces( return catalogHandlerUtils().listNamespaces(namespaceCatalog, parent, pageToken, pageSize); } else { PageToken pageRequest = PageToken.build(pageToken, pageSize, this::shouldDecodeToken); - var results = ((IcebergCatalog) baseCatalog).listNamespaces(parent, pageRequest); + var results = ((LocalIcebergCatalog) baseCatalog).listNamespaces(parent, pageRequest); return ListNamespacesResponse.builder() .addAll(results.items()) .nextPageToken(results.encodedResponseToken()) @@ -400,7 +400,7 @@ public ListTablesResponse listTables(Namespace namespace, String pageToken, Inte return catalogHandlerUtils().listTables(baseCatalog, namespace, pageToken, pageSize); } else { PageToken pageRequest = PageToken.build(pageToken, pageSize, this::shouldDecodeToken); - var results = ((IcebergCatalog) baseCatalog).listTables(namespace, pageRequest); + var results = ((LocalIcebergCatalog) baseCatalog).listTables(namespace, pageRequest); return ListTablesResponse.builder() .addAll(results.items()) .nextPageToken(results.encodedResponseToken()) @@ -527,7 +527,8 @@ private TableMetadata stageTableCreateHelper(Namespace namespace, CreateTableReq location = request.location(); } else { location = - ((IcebergCatalog) baseCatalog).transformTableLikeLocation(ident, request.location()); + ((LocalIcebergCatalog) baseCatalog) + .transformTableLikeLocation(ident, request.location()); } } else { location = @@ -593,7 +594,7 @@ public LoadTableResponse createTableStaged( TableIdentifier ident = TableIdentifier.of(namespace, request.name()); TableMetadata metadata = stageTableCreateHelper(namespace, request); - if (baseCatalog instanceof IcebergCatalog polarisCatalog) { + if (baseCatalog instanceof LocalIcebergCatalog polarisCatalog) { polarisCatalog.validateStagedTableCreate(ident, metadata); } @@ -803,7 +804,7 @@ public ImmutableLoadCredentialsResponse loadCredentials( // the remote catalog's actual table metadata. // Note: this check must come after authorizeLoadTable because baseCatalog is // initialized lazily during authorization. - if (!(baseCatalog instanceof IcebergCatalog)) { + if (!(baseCatalog instanceof LocalIcebergCatalog)) { return fallbackToFullLoadTable(tableIdentifier, refreshCredentialsEndpoint); } @@ -1096,7 +1097,7 @@ private UpdateTableRequest applyUpdateFilters(UpdateTableRequest request) { if (!isFederated && update instanceof MetadataUpdate.SetLocation setLocation) { String requestedLocation = setLocation.location(); String filteredLocation = - ((IcebergCatalog) baseCatalog) + ((LocalIcebergCatalog) baseCatalog) .transformTableLikeLocation(identifier, requestedLocation); return new MetadataUpdate.SetLocation(filteredLocation); } else { @@ -1210,7 +1211,7 @@ public void commitTransaction(CommitTransactionRequest commitTransactionRequest) // validations. TransactionWorkspaceMetaStoreManager transactionMetaStoreManager = new TransactionWorkspaceMetaStoreManager(diagnostics(), metaStoreManager()); - ((IcebergCatalog) baseCatalog).setMetaStoreManager(transactionMetaStoreManager); + ((LocalIcebergCatalog) baseCatalog).setMetaStoreManager(transactionMetaStoreManager); // Group all changes by table identifier to handle them atomically. // This prevents conflicts when multiple changes target the same table entity. @@ -1318,7 +1319,7 @@ public ListTablesResponse listViews(Namespace namespace, String pageToken, Integ baseCatalog.getClass().getName()); } else { PageToken pageRequest = PageToken.build(pageToken, pageSize, this::shouldDecodeToken); - var results = ((IcebergCatalog) baseCatalog).listViews(namespace, pageRequest); + var results = ((LocalIcebergCatalog) baseCatalog).listViews(namespace, pageRequest); return ListTablesResponse.builder() .addAll(results.items()) .nextPageToken(results.encodedResponseToken()) diff --git a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergCatalog.java similarity index 99% rename from runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java rename to runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergCatalog.java index 239096cf4f1..446ce2e553a 100644 --- a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java +++ b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergCatalog.java @@ -151,9 +151,9 @@ import org.slf4j.LoggerFactory; /** Defines the relationship between PolarisEntities and Iceberg's business logic. */ -public class IcebergCatalog extends BaseMetastoreViewCatalog +public class LocalIcebergCatalog extends BaseMetastoreViewCatalog implements SupportsNamespaces, SupportsNotifications, Closeable { - private static final Logger LOGGER = LoggerFactory.getLogger(IcebergCatalog.class); + private static final Logger LOGGER = LoggerFactory.getLogger(LocalIcebergCatalog.class); private static final Joiner SLASH = Joiner.on("/"); @@ -202,7 +202,7 @@ public class IcebergCatalog extends BaseMetastoreViewCatalog * this catalog instance only interacts with authorized resolved paths. * @param taskExecutor Executor we use to register cleanup task handlers */ - public IcebergCatalog( + public LocalIcebergCatalog( PolarisDiagnostics diagnostics, ResolverFactory resolverFactory, PolarisMetaStoreManager metaStoreManager, @@ -688,7 +688,7 @@ private String resolveNamespaceLocation(Namespace namespace, Map .reversed() .stream() .map(entity -> baseLocation(diagnostics, entity)) - .map(IcebergCatalog::stripLeadingTrailingSlash) + .map(LocalIcebergCatalog::stripLeadingTrailingSlash) .collect(Collectors.joining("/")); } @@ -1509,7 +1509,8 @@ private class PolarisIcebergCatalogViewBuilder extends BaseMetastoreViewCatalog. public PolarisIcebergCatalogViewBuilder(TableIdentifier identifier) { super(identifier); withProperties( - PropertyUtil.propertiesWithPrefix(IcebergCatalog.this.properties(), "table-default.")); + PropertyUtil.propertiesWithPrefix( + LocalIcebergCatalog.this.properties(), "table-default.")); this.identifier = identifier; } @@ -1520,8 +1521,8 @@ public ViewBuilder withLocation(String newLocation) { } /** - * An implementation of {@link TableOperations} that integrates with {@link IcebergCatalog}. Much - * of this code was originally copied from {@link + * An implementation of {@link TableOperations} that integrates with {@link LocalIcebergCatalog}. + * Much of this code was originally copied from {@link * org.apache.iceberg.BaseMetastoreTableOperations}. CODE_COPIED_TO_POLARIS From Apache Iceberg * Version: 1.8 */ @@ -1984,9 +1985,10 @@ private static Map buildTableMetadataPropertiesMap(TableMetadata } /** - * An implementation of {@link ViewOperations} that integrates with {@link IcebergCatalog}. Much - * of this code was originally copied from {@link org.apache.iceberg.view.BaseViewOperations}. - * CODE_COPIED_TO_POLARIS From Apache Iceberg Version: 1.8 + * An implementation of {@link ViewOperations} that integrates with {@link LocalIcebergCatalog}. + * Much of this code was originally copied from {@link + * org.apache.iceberg.view.BaseViewOperations}. CODE_COPIED_TO_POLARIS From Apache Iceberg + * Version: 1.8 */ private class BasePolarisViewOperations extends PolarisOperationsBase implements ViewOperations { diff --git a/runtime/service/src/main/java/org/apache/polaris/service/context/catalog/PolarisLocalCatalogFactory.java b/runtime/service/src/main/java/org/apache/polaris/service/context/catalog/PolarisLocalCatalogFactory.java index 8f1343c9bf7..a170b6e5400 100644 --- a/runtime/service/src/main/java/org/apache/polaris/service/context/catalog/PolarisLocalCatalogFactory.java +++ b/runtime/service/src/main/java/org/apache/polaris/service/context/catalog/PolarisLocalCatalogFactory.java @@ -32,7 +32,7 @@ import org.apache.polaris.core.persistence.PolarisMetaStoreManager; import org.apache.polaris.core.persistence.resolver.PolarisResolutionManifest; import org.apache.polaris.core.persistence.resolver.ResolverFactory; -import org.apache.polaris.service.catalog.iceberg.IcebergCatalog; +import org.apache.polaris.service.catalog.iceberg.LocalIcebergCatalog; import org.apache.polaris.service.catalog.io.FileIOFactory; import org.apache.polaris.service.catalog.io.StorageAccessConfigProvider; import org.apache.polaris.service.events.PolarisEventDispatcher; @@ -89,8 +89,8 @@ public Catalog createCatalog(final PolarisResolutionManifest resolvedManifest) { String catalogKey = realm + "/" + catalogName; LOGGER.debug("Initializing new BasePolarisCatalog for key: {}", catalogKey); - IcebergCatalog catalogInstance = - new IcebergCatalog( + LocalIcebergCatalog catalogInstance = + new LocalIcebergCatalog( diagnostics, resolverFactory, metaStoreManager, diff --git a/runtime/service/src/test/java/org/apache/polaris/service/admin/PolarisAuthzTestBase.java b/runtime/service/src/test/java/org/apache/polaris/service/admin/PolarisAuthzTestBase.java index b5cc15d65e9..23dd67f428e 100644 --- a/runtime/service/src/test/java/org/apache/polaris/service/admin/PolarisAuthzTestBase.java +++ b/runtime/service/src/test/java/org/apache/polaris/service/admin/PolarisAuthzTestBase.java @@ -76,7 +76,7 @@ import org.apache.polaris.service.catalog.PolarisPassthroughResolutionView; import org.apache.polaris.service.catalog.Profiles; import org.apache.polaris.service.catalog.generic.PolarisGenericTableCatalog; -import org.apache.polaris.service.catalog.iceberg.IcebergCatalog; +import org.apache.polaris.service.catalog.iceberg.LocalIcebergCatalog; import org.apache.polaris.service.catalog.io.FileIOFactory; import org.apache.polaris.service.catalog.io.StorageAccessConfigProvider; import org.apache.polaris.service.catalog.policy.PolicyCatalog; @@ -197,7 +197,7 @@ public Map getConfigOverrides() { @Inject protected RealmContextHolder realmContextHolder; @Inject protected PolarisEventDispatcher polarisEventDispatcher; - protected IcebergCatalog baseCatalog; + protected LocalIcebergCatalog baseCatalog; protected PolarisGenericTableCatalog genericTableCatalog; protected PolicyCatalog policyCatalog; protected PolarisAdminService adminService; @@ -479,7 +479,7 @@ private void initBaseCatalog() { new PolarisPassthroughResolutionView( resolutionManifestFactory, authenticatedRoot, CATALOG_NAME); this.baseCatalog = - new IcebergCatalog( + new LocalIcebergCatalog( diagServices, resolverFactory, metaStoreManager, diff --git a/runtime/service/src/test/java/org/apache/polaris/service/catalog/generic/AbstractPolarisGenericTableCatalogTest.java b/runtime/service/src/test/java/org/apache/polaris/service/catalog/generic/AbstractPolarisGenericTableCatalogTest.java index 3618e01347c..dc657387bf4 100644 --- a/runtime/service/src/test/java/org/apache/polaris/service/catalog/generic/AbstractPolarisGenericTableCatalogTest.java +++ b/runtime/service/src/test/java/org/apache/polaris/service/catalog/generic/AbstractPolarisGenericTableCatalogTest.java @@ -62,7 +62,7 @@ import org.apache.polaris.core.storage.cache.StorageCredentialCache; import org.apache.polaris.service.admin.PolarisAdminService; import org.apache.polaris.service.catalog.PolarisPassthroughResolutionView; -import org.apache.polaris.service.catalog.iceberg.IcebergCatalog; +import org.apache.polaris.service.catalog.iceberg.LocalIcebergCatalog; import org.apache.polaris.service.catalog.io.FileIOFactory; import org.apache.polaris.service.catalog.io.StorageAccessConfigProvider; import org.apache.polaris.service.config.ReservedProperties; @@ -111,7 +111,7 @@ public abstract class AbstractPolarisGenericTableCatalogTest { @Inject PolarisPrincipalHolder polarisPrincipalHolder; private PolarisGenericTableCatalog genericTableCatalog; - private IcebergCatalog icebergCatalog; + private LocalIcebergCatalog icebergCatalog; private AwsStorageConfigInfo storageConfigModel; private String realmName; private PolarisCallContext polarisContext; @@ -227,7 +227,7 @@ public void before(TestInfo testInfo) { new PolarisGenericTableCatalog(metaStoreManager, polarisContext, passthroughView); this.genericTableCatalog.initialize(CATALOG_NAME, Map.of()); this.icebergCatalog = - new IcebergCatalog( + new LocalIcebergCatalog( diagServices, resolverFactory, metaStoreManager, diff --git a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractIcebergCatalogTest.java b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractLocalIcebergCatalogTest.java similarity index 97% rename from runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractIcebergCatalogTest.java rename to runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractLocalIcebergCatalogTest.java index 3701206dd70..70f59eec0ce 100644 --- a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractIcebergCatalogTest.java +++ b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractLocalIcebergCatalogTest.java @@ -186,7 +186,7 @@ import software.amazon.awssdk.services.sts.model.AssumeRoleResponse; import software.amazon.awssdk.services.sts.model.Credentials; -public abstract class AbstractIcebergCatalogTest extends CatalogTests { +public abstract class AbstractLocalIcebergCatalogTest extends CatalogTests { static { org.assertj.core.api.Assumptions.setPreferredAssumptionException( PreferredAssumptionException.JUNIT5); @@ -261,7 +261,7 @@ public Map getConfigOverrides() { @Inject ResolverFactory resolverFactory; @Inject PolarisEventDispatcher polarisEventDispatcher; - private IcebergCatalog catalog; + private LocalIcebergCatalog catalog; private String realmName; private PolarisCallContext polarisContext; private InMemoryFileIO fileIO; @@ -354,7 +354,7 @@ public void after() throws IOException { } @Override - protected IcebergCatalog catalog() { + protected LocalIcebergCatalog catalog() { return catalog; } @@ -366,9 +366,9 @@ protected IcebergCatalog catalog() { * @return a configured instance of IcebergCatalog */ @Override - protected IcebergCatalog initCatalog( + protected LocalIcebergCatalog initCatalog( String catalogName, Map additionalProperties) { - IcebergCatalog icebergCatalog = newIcebergCatalog(CATALOG_NAME); + LocalIcebergCatalog icebergCatalog = newIcebergCatalog(CATALOG_NAME); fileIO = new InMemoryFileIO(); icebergCatalog.setCatalogFileIo(fileIO); ImmutableMap.Builder propertiesBuilder = @@ -415,22 +415,22 @@ protected boolean supportsNotifications() { return true; } - protected IcebergCatalog newIcebergCatalog(String catalogName) { + protected LocalIcebergCatalog newIcebergCatalog(String catalogName) { return newIcebergCatalog(catalogName, metaStoreManager); } - protected IcebergCatalog newIcebergCatalog( + protected LocalIcebergCatalog newIcebergCatalog( String catalogName, PolarisMetaStoreManager metaStoreManager) { return newIcebergCatalog(catalogName, metaStoreManager, fileIOFactory); } - protected IcebergCatalog newIcebergCatalog( + protected LocalIcebergCatalog newIcebergCatalog( String catalogName, PolarisMetaStoreManager metaStoreManager, FileIOFactory fileIOFactory) { PolarisPassthroughResolutionView passthroughView = new PolarisPassthroughResolutionView( resolutionManifestFactory, authenticatedRoot, catalogName); TaskExecutor taskExecutor = Mockito.mock(TaskExecutor.class); - return new IcebergCatalog( + return new LocalIcebergCatalog( diagServices, resolverFactory, metaStoreManager, @@ -446,7 +446,7 @@ protected IcebergCatalog newIcebergCatalog( @Test public void testEmptyNamespace() { - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); TableIdentifier tableInRootNs = TableIdentifier.of("table"); String expectedMessage = "Namespace does not exist: ''"; @@ -494,7 +494,7 @@ public void testRenameTableMissingDestinationNamespace() { requiresNamespaceCreate(), "Only applicable if namespaces must be created before adding children"); - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); catalog.createNamespace(NS); Assertions.assertThat(catalog.tableExists(TABLE)) @@ -538,7 +538,7 @@ public void testCreateNestedNamespaceUnderMissingParent() { Assumptions.assumeTrue( supportsNestedNamespaces(), "Only applicable if nested namespaces are supoprted"); - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace child1 = Namespace.of("parent", "child1"); @@ -549,7 +549,7 @@ public void testCreateNestedNamespaceUnderMissingParent() { @Test public void testConcurrentWritesWithRollbackNonEmptyTable() { - IcebergCatalog catalog = this.catalog(); + LocalIcebergCatalog catalog = this.catalog(); if (this.requiresNamespaceCreate()) { catalog.createNamespace(NS); } @@ -655,7 +655,7 @@ public void testConcurrentWritesWithRollbackNonEmptyTable() { @Test public void testConcurrentWritesWithRollbackWithNonReplaceSnapshotInBetween() { - IcebergCatalog catalog = this.catalog(); + LocalIcebergCatalog catalog = this.catalog(); if (this.requiresNamespaceCreate()) { catalog.createNamespace(NS); } @@ -725,7 +725,7 @@ public void testConcurrentWritesWithRollbackWithNonReplaceSnapshotInBetween() { @Test public void testConcurrentWritesWithRollbackEnableWithToRollbackSnapshotReferencedByOtherBranch() { - IcebergCatalog catalog = this.catalog(); + LocalIcebergCatalog catalog = this.catalog(); if (this.requiresNamespaceCreate()) { catalog.createNamespace(NS); } @@ -799,7 +799,7 @@ public void testConcurrentWritesWithRollbackWithNonReplaceSnapshotInBetween() { @Test public void testConcurrentWritesWithRollbackWithConcurrentWritesToDifferentBranches() { - IcebergCatalog catalog = this.catalog(); + LocalIcebergCatalog catalog = this.catalog(); if (this.requiresNamespaceCreate()) { catalog.createNamespace(NS); } @@ -885,7 +885,7 @@ public void testValidateNotificationWhenTableAndNamespacesDontExist() { final String tableLocation = "s3://externally-owned-bucket/validate_table/"; final String tableMetadataLocation = tableLocation + "metadata/v1.metadata.json"; - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("parent", "child1"); TableIdentifier table = TableIdentifier.of(namespace, "table"); @@ -947,7 +947,7 @@ public void testValidateNotificationInDisallowedLocation() { // filename. final String tableLocation = "s3://forbidden-table-location/table/"; final String tableMetadataLocation = tableLocation + "metadata/"; - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("parent", "child1"); TableIdentifier table = TableIdentifier.of(namespace, "table"); @@ -983,7 +983,8 @@ public void testValidateNotificationFailToCreateFileIO() { final String tableLocation = "s3://externally-owned-bucket/validate_table/"; final String tableMetadataLocation = tableLocation + "metadata/"; FileIOFactory fileIOFactory = spy(this.fileIOFactory); - IcebergCatalog catalog = newIcebergCatalog(catalog().name(), metaStoreManager, fileIOFactory); + LocalIcebergCatalog catalog = + newIcebergCatalog(catalog().name(), metaStoreManager, fileIOFactory); catalog.initialize( CATALOG_NAME, ImmutableMap.of( @@ -1021,7 +1022,7 @@ public void testUpdateNotificationWhenTableAndNamespacesDontExist() { final String tableLocation = "s3://externally-owned-bucket/table/"; final String tableMetadataLocation = tableLocation + "metadata/v1.metadata.json"; - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("parent", "child1"); TableIdentifier table = TableIdentifier.of(namespace, "table"); @@ -1065,7 +1066,7 @@ public void testUpdateNotificationWhenTableAndNamespacesDontExistNamespaceRaceCo // Use a spy so we can inject a concurrency error PolarisMetaStoreManager spyMetaStore = spy(metaStoreManager); - IcebergCatalog catalog = newIcebergCatalog(CATALOG_NAME, spyMetaStore); + LocalIcebergCatalog catalog = newIcebergCatalog(CATALOG_NAME, spyMetaStore); catalog.initialize( CATALOG_NAME, ImmutableMap.of( @@ -1129,7 +1130,7 @@ public void testUpdateNotificationCreateTableInDisallowedLocation() { // The location of the metadata JSON file specified in the create will be forbidden. final String tableLocation = "s3://forbidden-table-location/table/"; final String tableMetadataLocation = tableLocation + "metadata/v1.metadata.json"; - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("parent", "child1"); TableIdentifier table = TableIdentifier.of(namespace, "table"); @@ -1181,7 +1182,7 @@ public void testCreateNotificationCreateTableInExternalLocation() { .addProperty( FeatureConfiguration.ALLOW_UNSTRUCTURED_TABLE_LOCATION.catalogConfig(), "true") .build()); - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); TableMetadata tableMetadata = TableMetadata.buildFromEmpty() .assignUUID() @@ -1241,7 +1242,7 @@ public void testCreateNotificationCreateTableOutsideOfMetadataLocation() { .addProperty( FeatureConfiguration.ALLOW_UNSTRUCTURED_TABLE_LOCATION.catalogConfig(), "true") .build()); - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); TableMetadata tableMetadata = TableMetadata.buildFromEmpty() .assignUUID() @@ -1298,7 +1299,7 @@ public void testUpdateNotificationCreateTableInExternalLocation() { .addProperty( FeatureConfiguration.ALLOW_UNSTRUCTURED_TABLE_LOCATION.catalogConfig(), "true") .build()); - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); fileIO.addFile( tableMetadataLocation, @@ -1367,7 +1368,7 @@ public void testUpdateNotificationCreateTableWithLocalFilePrefix() { .build() .asCatalog(serviceIdentityProvider))); - IcebergCatalog catalog = newIcebergCatalog(catalogWithoutStorage); + LocalIcebergCatalog catalog = newIcebergCatalog(catalogWithoutStorage); catalog.initialize( catalogWithoutStorage, ImmutableMap.of( @@ -1417,7 +1418,7 @@ public void testUpdateNotificationCreateTableWithHttpPrefix() { .build() .asCatalog(serviceIdentityProvider))); - IcebergCatalog catalog = newIcebergCatalog(catalogName); + LocalIcebergCatalog catalog = newIcebergCatalog(catalogName); catalog.initialize( catalogName, ImmutableMap.of( @@ -1482,7 +1483,7 @@ public void testUpdateNotificationWhenNamespacesExist() { final String tableLocation = "s3://externally-owned-bucket/table/"; final String tableMetadataLocation = tableLocation + "metadata/v1.metadata.json"; - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("parent", "child1"); @@ -1526,7 +1527,7 @@ public void testUpdateNotificationWhenTableExists() { final String tableLocation = "s3://externally-owned-bucket/table/"; final String tableMetadataLocation = tableLocation + "metadata/v1.metadata.json"; - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("parent", "child1"); @@ -1577,7 +1578,7 @@ public void testUpdateNotificationWhenTableExistsInDisallowedLocation() { // The location of the metadata JSON file specified in the update will be forbidden. final String tableLocation = "s3://forbidden-table-location/table/"; final String tableMetadataLocation = tableLocation + "metadata/v1.metadata.json"; - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("parent", "child1"); @@ -1621,7 +1622,7 @@ public void testUpdateNotificationRejectOutOfOrderTimestamp() { final String tableLocation = "s3://externally-owned-bucket/table/"; final String tableMetadataLocation = tableLocation + "metadata/v1.metadata.json"; - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("parent", "child1"); TableIdentifier table = TableIdentifier.of(namespace, "table"); @@ -1684,7 +1685,7 @@ public void testUpdateNotificationWhenTableExistsFileSpecifiesDisallowedLocation final String tableLocation = "s3://externally-owned-bucket/table/"; final String tableMetadataLocation = tableLocation + "metadata/v1.metadata.json"; - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("parent", "child1"); @@ -1731,7 +1732,7 @@ public void testDropNotificationWhenTableAndNamespacesDontExist() { final String tableLocation = "s3://externally-owned-bucket/table/"; final String tableMetadataLocation = tableLocation + "metadata/v1.metadata.json"; - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("parent", "child1"); TableIdentifier table = TableIdentifier.of(namespace, "table"); @@ -1766,7 +1767,7 @@ public void testDropNotificationWhenNamespacesExist() { final String tableLocation = "s3://externally-owned-bucket/table/"; final String tableMetadataLocation = tableLocation + "metadata/v1.metadata.json"; - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("parent", "child1"); @@ -1810,7 +1811,7 @@ public void testDropNotificationWhenTableExists() { final String tableLocation = "s3://externally-owned-bucket/table/"; final String tableMetadataLocation = tableLocation + "metadata/v1.metadata.json"; - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("parent", "child1"); @@ -1927,7 +1928,7 @@ public void testDropTableWithPurgeDisabled() { realmConfig, noPurgeStorageConfigModel, storageLocation) .build() .asCatalog(serviceIdentityProvider))); - IcebergCatalog noPurgeCatalog = + LocalIcebergCatalog noPurgeCatalog = newIcebergCatalog(noPurgeCatalogName, metaStoreManager, fileIOFactory); noPurgeCatalog.initialize( noPurgeCatalogName, @@ -1966,7 +1967,7 @@ public void testDropNamespaceWithUnexpectedError() { .when(spiedManager) .dropEntityIfExists(any(), anyList(), any(), anyMap(), anyBoolean()); - IcebergCatalog spiedCatalog = newIcebergCatalog(CATALOG_NAME, spiedManager, fileIOFactory); + LocalIcebergCatalog spiedCatalog = newIcebergCatalog(CATALOG_NAME, spiedManager, fileIOFactory); spiedCatalog.initialize( CATALOG_NAME, ImmutableMap.of( @@ -1991,7 +1992,7 @@ public void testDropTableWithUnexpectedError() { .when(spiedManager) .dropEntityIfExists(any(), anyList(), any(), anyMap(), anyBoolean()); - IcebergCatalog spiedCatalog = newIcebergCatalog(CATALOG_NAME, spiedManager, fileIOFactory); + LocalIcebergCatalog spiedCatalog = newIcebergCatalog(CATALOG_NAME, spiedManager, fileIOFactory); spiedCatalog.initialize( CATALOG_NAME, ImmutableMap.of( @@ -2015,7 +2016,7 @@ public void testDropTableWithUndroppableEntity() { .when(spiedManager) .dropEntityIfExists(any(), anyList(), any(), anyMap(), anyBoolean()); - IcebergCatalog spiedCatalog = newIcebergCatalog(CATALOG_NAME, spiedManager, fileIOFactory); + LocalIcebergCatalog spiedCatalog = newIcebergCatalog(CATALOG_NAME, spiedManager, fileIOFactory); spiedCatalog.initialize( CATALOG_NAME, ImmutableMap.of( @@ -2044,7 +2045,7 @@ public void testDropViewWithUnexpectedError() { .when(spiedManager) .dropEntityIfExists(any(), anyList(), any(), anyMap(), anyBoolean()); - IcebergCatalog spiedCatalog = newIcebergCatalog(CATALOG_NAME, spiedManager, fileIOFactory); + LocalIcebergCatalog spiedCatalog = newIcebergCatalog(CATALOG_NAME, spiedManager, fileIOFactory); spiedCatalog.initialize( CATALOG_NAME, ImmutableMap.of( @@ -2073,7 +2074,7 @@ public void testDropViewWithUndroppableEntity() { .when(spiedManager) .dropEntityIfExists(any(), anyList(), any(), anyMap(), anyBoolean()); - IcebergCatalog spiedCatalog = newIcebergCatalog(CATALOG_NAME, spiedManager, fileIOFactory); + LocalIcebergCatalog spiedCatalog = newIcebergCatalog(CATALOG_NAME, spiedManager, fileIOFactory); spiedCatalog.initialize( CATALOG_NAME, ImmutableMap.of( @@ -2094,7 +2095,7 @@ public void testDropTableWithCatalogPathCannotBeResolved() { .when(spiedManager) .dropEntityIfExists(any(), anyList(), any(), anyMap(), anyBoolean()); - IcebergCatalog spiedCatalog = newIcebergCatalog(CATALOG_NAME, spiedManager, fileIOFactory); + LocalIcebergCatalog spiedCatalog = newIcebergCatalog(CATALOG_NAME, spiedManager, fileIOFactory); spiedCatalog.initialize( CATALOG_NAME, ImmutableMap.of( @@ -2119,7 +2120,7 @@ public void testDropViewWithCatalogPathCannotBeResolved() { .when(spiedManager) .dropEntityIfExists(any(), anyList(), any(), anyMap(), anyBoolean()); - IcebergCatalog spiedCatalog = newIcebergCatalog(CATALOG_NAME, spiedManager, fileIOFactory); + LocalIcebergCatalog spiedCatalog = newIcebergCatalog(CATALOG_NAME, spiedManager, fileIOFactory); spiedCatalog.initialize( CATALOG_NAME, ImmutableMap.of( @@ -2138,7 +2139,7 @@ public void testDropNamespaceWithCatalogPathCannotBeResolved() { .when(spiedManager) .dropEntityIfExists(any(), anyList(), any(), anyMap(), anyBoolean()); - IcebergCatalog spiedCatalog = newIcebergCatalog(CATALOG_NAME, spiedManager, fileIOFactory); + LocalIcebergCatalog spiedCatalog = newIcebergCatalog(CATALOG_NAME, spiedManager, fileIOFactory); spiedCatalog.initialize( CATALOG_NAME, ImmutableMap.of( @@ -2172,7 +2173,7 @@ private void createNonExistingNamespaces(Namespace namespace) { @ParameterizedTest @MethodSource public void testRetriableException(Exception exception, boolean shouldRetry) { - Assertions.assertThat(IcebergCatalog.SHOULD_RETRY_REFRESH_PREDICATE.test(exception)) + Assertions.assertThat(LocalIcebergCatalog.SHOULD_RETRY_REFRESH_PREDICATE.test(exception)) .isEqualTo(shouldRetry); } @@ -2214,7 +2215,7 @@ static Stream testRetriableException() { @Test public void testFileIOWrapper() { MeasuredFileIOFactory measured = new MeasuredFileIOFactory(); - IcebergCatalog catalog = newIcebergCatalog(CATALOG_NAME, metaStoreManager, measured); + LocalIcebergCatalog catalog = newIcebergCatalog(CATALOG_NAME, metaStoreManager, measured); catalog.initialize( CATALOG_NAME, ImmutableMap.of( @@ -2274,7 +2275,7 @@ public FileIO loadFileIO( @Test public void testRegisterTableWithSlashlessMetadataLocation() { - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Assertions.assertThatThrownBy( () -> catalog.registerTable(TABLE, "metadata_location_without_slashes")) .isInstanceOf(IllegalArgumentException.class) @@ -2283,7 +2284,7 @@ public void testRegisterTableWithSlashlessMetadataLocation() { @Test public void testRegisterTableOverwriteUpdatesMetadataLocation() { - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("register_overwrite_update"); TableIdentifier table = TableIdentifier.of(namespace, "table"); if (requiresNamespaceCreate()) { @@ -2338,7 +2339,7 @@ public void testRegisterTableOverwriteUpdatesMetadataLocation() { @Test public void testRegisterTableOverwriteUpdatesBaseLocation() { - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("register_overwrite_base_location"); TableIdentifier table = TableIdentifier.of(namespace, "table"); if (requiresNamespaceCreate()) { @@ -2385,7 +2386,7 @@ public void testRegisterTableOverwriteUpdatesBaseLocation() { @Test public void testRegisterTableOverwriteCreatesWhenMissing() { - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("register_overwrite_create"); TableIdentifier sourceTable = TableIdentifier.of(namespace, "source_table"); TableIdentifier targetTable = TableIdentifier.of(namespace, "target_table"); @@ -2411,7 +2412,7 @@ public void testRegisterTableOverwriteCreatesWhenMissing() { @Test public void testRegisterTableOverwriteFalseRejectsExistingTable() { - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("register_overwrite_conflict"); TableIdentifier table = TableIdentifier.of(namespace, "table"); if (requiresNamespaceCreate()) { @@ -2430,7 +2431,7 @@ public void testRegisterTableOverwriteFalseRejectsExistingTable() { public void testRegisterTableRejectsExistingView() { // Note: there exists a similar test in ViewCatalogTests.registerTableThatAlreadyExistsAsView, // but it doesn't cover register with overwrite - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); Namespace namespace = Namespace.of("register_view_conflict"); TableIdentifier identifier = TableIdentifier.of(namespace, "entity"); if (requiresNamespaceCreate()) { @@ -2467,7 +2468,7 @@ public void testConcurrencyConflictCreateTableUpdatedDuringFinalTransaction() { // Use a spy so that non-transactional pre-requisites succeed normally, but we inject // a concurrency failure at final commit. PolarisMetaStoreManager spyMetaStore = spy(metaStoreManager); - final IcebergCatalog catalog = newIcebergCatalog(CATALOG_NAME, spyMetaStore); + final LocalIcebergCatalog catalog = newIcebergCatalog(CATALOG_NAME, spyMetaStore); catalog.initialize( CATALOG_NAME, ImmutableMap.of( @@ -2504,7 +2505,7 @@ public void testConcurrencyConflictUpdateTableDuringFinalTransaction() { // Use a spy so that non-transactional pre-requisites succeed normally, but we inject // a concurrency failure at final commit. PolarisMetaStoreManager spyMetaStore = spy(metaStoreManager); - final IcebergCatalog catalog = newIcebergCatalog(CATALOG_NAME, spyMetaStore); + final LocalIcebergCatalog catalog = newIcebergCatalog(CATALOG_NAME, spyMetaStore); catalog.initialize( CATALOG_NAME, ImmutableMap.of( @@ -2580,10 +2581,10 @@ public void testTableOperationsDoesNotRefreshAfterCommit(boolean updateMetadataO catalog.createNamespace(NS); catalog.buildTable(TABLE, SCHEMA).create(); - IcebergCatalog.BasePolarisTableOperations realOps = - (IcebergCatalog.BasePolarisTableOperations) + LocalIcebergCatalog.BasePolarisTableOperations realOps = + (LocalIcebergCatalog.BasePolarisTableOperations) catalog.newTableOps(TABLE, updateMetadataOnCommit); - IcebergCatalog.BasePolarisTableOperations ops = Mockito.spy(realOps); + LocalIcebergCatalog.BasePolarisTableOperations ops = Mockito.spy(realOps); try (MockedStatic mocked = Mockito.mockStatic(TableMetadataParser.class, Mockito.CALLS_REAL_METHODS)) { @@ -2821,7 +2822,7 @@ private Set inMemoryFilesUnderPrefix(String prefix) { @Test public void testEventsAreEmitted() { - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); catalog.createNamespace(TestData.NAMESPACE); Table table = catalog.buildTable(TestData.TABLE, TestData.SCHEMA).create(); diff --git a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractIcebergCatalogViewTest.java b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractLocalIcebergCatalogViewTest.java similarity index 97% rename from runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractIcebergCatalogViewTest.java rename to runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractLocalIcebergCatalogViewTest.java index 1d6299dc461..aef84fc8f95 100644 --- a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractIcebergCatalogViewTest.java +++ b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractLocalIcebergCatalogViewTest.java @@ -79,7 +79,8 @@ import org.junit.jupiter.api.io.TempDir; import org.mockito.Mockito; -public abstract class AbstractIcebergCatalogViewTest extends ViewCatalogTests { +public abstract class AbstractLocalIcebergCatalogViewTest + extends ViewCatalogTests { static { Assumptions.setPreferredAssumptionException(PreferredAssumptionException.JUNIT5); } @@ -126,7 +127,7 @@ public Map getConfigOverrides() { @Inject StorageAccessConfigProvider storageAccessConfigProvider; @Inject FileIOFactory fileIOFactory; - private IcebergCatalog catalog; + private LocalIcebergCatalog catalog; private String realmName; private PolarisCallContext polarisContext; @@ -205,7 +206,7 @@ public void before(TestInfo testInfo) { testPolarisEventListener = (TestPolarisEventListener) polarisEventListener; testPolarisEventListener.clear(); this.catalog = - new IcebergCatalog( + new LocalIcebergCatalog( diagServices, resolverFactory, metaStoreManager, @@ -232,7 +233,7 @@ public void after() throws IOException { } @Override - protected IcebergCatalog catalog() { + protected LocalIcebergCatalog catalog() { return catalog; } @@ -248,7 +249,7 @@ protected boolean requiresNamespaceCreate() { @Test public void testEventsAreEmitted() { - IcebergCatalog catalog = catalog(); + LocalIcebergCatalog catalog = catalog(); catalog.createNamespace(TestData.NAMESPACE); View view = catalog diff --git a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandlerTest.java b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandlerTest.java index 14c1d3d4b95..ebf1feac31b 100644 --- a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandlerTest.java +++ b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandlerTest.java @@ -205,7 +205,7 @@ void loadCredentialsUsesOptimizedPathForIcebergCatalog() { .build()); when(resolvedPath.getRawLeafEntity()).thenReturn(leafEntity); - IcebergCatalog icebergCatalog = mock(IcebergCatalog.class); + LocalIcebergCatalog icebergCatalog = mock(LocalIcebergCatalog.class); when(localCatalogFactory.createCatalog(any())).thenReturn(icebergCatalog); StorageAccessConfig storageAccessConfig = @@ -266,7 +266,7 @@ void loadCredentialsFallsBackWhenEntityLocationMissing() { BaseTable table = mock(BaseTable.class); when(table.operations()).thenReturn(ops); - IcebergCatalog icebergCatalog = mock(IcebergCatalog.class); + LocalIcebergCatalog icebergCatalog = mock(LocalIcebergCatalog.class); when(icebergCatalog.loadTable(TABLE2)).thenReturn(table); when(localCatalogFactory.createCatalog(any())).thenReturn(icebergCatalog); diff --git a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogNoSqlInMemTest.java b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergCatalogNoSqlInMemTest.java similarity index 87% rename from runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogNoSqlInMemTest.java rename to runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergCatalogNoSqlInMemTest.java index 7ea2a3c33d2..1c0c0278bb1 100644 --- a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogNoSqlInMemTest.java +++ b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergCatalogNoSqlInMemTest.java @@ -28,10 +28,10 @@ import org.apache.polaris.core.persistence.bootstrap.RootCredentialsSet; @QuarkusTest -@TestProfile(IcebergCatalogNoSqlInMemTest.Profile.class) -public class IcebergCatalogNoSqlInMemTest extends AbstractIcebergCatalogTest { +@TestProfile(LocalIcebergCatalogNoSqlInMemTest.Profile.class) +public class LocalIcebergCatalogNoSqlInMemTest extends AbstractLocalIcebergCatalogTest { - public static class Profile extends AbstractIcebergCatalogTest.Profile { + public static class Profile extends AbstractLocalIcebergCatalogTest.Profile { @Override public Map getConfigOverrides() { return ImmutableMap.builder() diff --git a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogRelationalTest.java b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergCatalogRelationalTest.java similarity index 86% rename from runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogRelationalTest.java rename to runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergCatalogRelationalTest.java index 049e240f081..26c2d86ce77 100644 --- a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogRelationalTest.java +++ b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergCatalogRelationalTest.java @@ -22,5 +22,5 @@ import io.quarkus.test.junit.TestProfile; @QuarkusTest -@TestProfile(AbstractIcebergCatalogTest.Profile.class) -public class IcebergCatalogRelationalTest extends AbstractIcebergCatalogTest {} +@TestProfile(AbstractLocalIcebergCatalogTest.Profile.class) +public class LocalIcebergCatalogRelationalTest extends AbstractLocalIcebergCatalogTest {} diff --git a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogTest.java b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergCatalogTest.java similarity index 98% rename from runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogTest.java rename to runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergCatalogTest.java index b57bc2b9e24..a1890e14d1e 100644 --- a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogTest.java +++ b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergCatalogTest.java @@ -51,7 +51,7 @@ import org.mockito.junit.jupiter.MockitoExtension; @ExtendWith(MockitoExtension.class) -class IcebergCatalogTest { +class LocalIcebergCatalogTest { @Mock ResolverFactory resolverFactory; @Mock CallContext callContext; @@ -66,7 +66,7 @@ class IcebergCatalogTest { private final PolarisPrincipal principal = PolarisPrincipal.of("test", Map.of(), Set.of()); - private IcebergCatalog catalog; + private LocalIcebergCatalog catalog; private ResolvedPolarisEntity rns1 = new ResolvedPolarisEntity(ns1, List.of(), List.of()); private ResolvedPolarisEntity rns2 = new ResolvedPolarisEntity(ns2, List.of(), List.of()); private ResolvedPolarisEntity rt3 = new ResolvedPolarisEntity(table3, List.of(), List.of()); @@ -82,7 +82,7 @@ void initMocks() { rt3 = new ResolvedPolarisEntity(table3, List.of(), List.of()); catalog = - new IcebergCatalog( + new LocalIcebergCatalog( diagnostics, resolverFactory, null, diff --git a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergViewCatalogNoSqlInMemTest.java b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergViewCatalogNoSqlInMemTest.java similarity index 88% rename from runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergViewCatalogNoSqlInMemTest.java rename to runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergViewCatalogNoSqlInMemTest.java index 4089c173f75..623f68db1d5 100644 --- a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergViewCatalogNoSqlInMemTest.java +++ b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergViewCatalogNoSqlInMemTest.java @@ -30,12 +30,12 @@ import org.apache.polaris.core.persistence.bootstrap.RootCredentialsSet; @QuarkusTest -@TestProfile(IcebergViewCatalogNoSqlInMemTest.Profile.class) -public class IcebergViewCatalogNoSqlInMemTest extends AbstractIcebergCatalogViewTest { +@TestProfile(LocalIcebergViewCatalogNoSqlInMemTest.Profile.class) +public class LocalIcebergViewCatalogNoSqlInMemTest extends AbstractLocalIcebergCatalogViewTest { @Inject MetaStoreManagerFactory metaStoreManagerFactory; - public static class Profile extends AbstractIcebergCatalogViewTest.Profile { + public static class Profile extends AbstractLocalIcebergCatalogViewTest.Profile { @Override public Map getConfigOverrides() { return ImmutableMap.builder() diff --git a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergViewCatalogRelationalTest.java b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergViewCatalogRelationalTest.java similarity index 85% rename from runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergViewCatalogRelationalTest.java rename to runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergViewCatalogRelationalTest.java index 3bbbf5f8a36..f8c34b103f1 100644 --- a/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/IcebergViewCatalogRelationalTest.java +++ b/runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/LocalIcebergViewCatalogRelationalTest.java @@ -22,5 +22,5 @@ import io.quarkus.test.junit.TestProfile; @QuarkusTest -@TestProfile(AbstractIcebergCatalogViewTest.Profile.class) -public class IcebergViewCatalogRelationalTest extends AbstractIcebergCatalogViewTest {} +@TestProfile(AbstractLocalIcebergCatalogViewTest.Profile.class) +public class LocalIcebergViewCatalogRelationalTest extends AbstractLocalIcebergCatalogViewTest {} diff --git a/runtime/service/src/test/java/org/apache/polaris/service/catalog/io/FileIOFactoryTest.java b/runtime/service/src/test/java/org/apache/polaris/service/catalog/io/FileIOFactoryTest.java index 8b7cbce947c..a1f122774cf 100644 --- a/runtime/service/src/test/java/org/apache/polaris/service/catalog/io/FileIOFactoryTest.java +++ b/runtime/service/src/test/java/org/apache/polaris/service/catalog/io/FileIOFactoryTest.java @@ -47,7 +47,7 @@ import org.apache.polaris.core.persistence.pagination.PageToken; import org.apache.polaris.service.TestServices; import org.apache.polaris.service.catalog.PolarisPassthroughResolutionView; -import org.apache.polaris.service.catalog.iceberg.IcebergCatalog; +import org.apache.polaris.service.catalog.iceberg.LocalIcebergCatalog; import org.apache.polaris.service.task.TaskFileIOSupplier; import org.assertj.core.api.Assertions; import org.jspecify.annotations.NonNull; @@ -144,7 +144,7 @@ public void after() {} @ParameterizedTest @ValueSource(strings = {"s3a", "s3"}) public void testLoadFileIOForTableLike(String scheme) { - IcebergCatalog catalog = createCatalog(testServices, scheme); + LocalIcebergCatalog catalog = createCatalog(testServices, scheme); catalog.createNamespace(NS); catalog.createTable(TABLE, SCHEMA); @@ -156,7 +156,7 @@ public void testLoadFileIOForTableLike(String scheme) { @ParameterizedTest @ValueSource(strings = {"s3a", "s3"}) public void testLoadFileIOForCleanupTask(String scheme) { - IcebergCatalog catalog = createCatalog(testServices, scheme); + LocalIcebergCatalog catalog = createCatalog(testServices, scheme); catalog.createNamespace(NS); catalog.createTable(TABLE, SCHEMA); catalog.dropTable(TABLE, true); @@ -183,7 +183,7 @@ public void testLoadFileIOForCleanupTask(String scheme) { .loadFileIO(Mockito.any(), Mockito.any(), Mockito.any()); } - IcebergCatalog createCatalog(TestServices services, String scheme) { + LocalIcebergCatalog createCatalog(TestServices services, String scheme) { String storageLocation = scheme + "://my-bucket/path/to/data"; AwsStorageConfigInfo awsStorageConfigInfo = AwsStorageConfigInfo.builder() @@ -208,8 +208,8 @@ IcebergCatalog createCatalog(TestServices services, String scheme) { PolarisPassthroughResolutionView passthroughView = new PolarisPassthroughResolutionView( services.resolutionManifestFactory(), services.principal(), CATALOG_NAME); - IcebergCatalog polarisCatalog = - new IcebergCatalog( + LocalIcebergCatalog polarisCatalog = + new LocalIcebergCatalog( services.polarisDiagnostics(), services.resolverFactory(), services.metaStoreManager(), diff --git a/runtime/service/src/test/java/org/apache/polaris/service/catalog/policy/AbstractPolicyCatalogTest.java b/runtime/service/src/test/java/org/apache/polaris/service/catalog/policy/AbstractPolicyCatalogTest.java index 973172ccaab..cb302eb9c80 100644 --- a/runtime/service/src/test/java/org/apache/polaris/service/catalog/policy/AbstractPolicyCatalogTest.java +++ b/runtime/service/src/test/java/org/apache/polaris/service/catalog/policy/AbstractPolicyCatalogTest.java @@ -74,7 +74,7 @@ import org.apache.polaris.core.storage.cache.StorageCredentialCache; import org.apache.polaris.service.admin.PolarisAdminService; import org.apache.polaris.service.catalog.PolarisPassthroughResolutionView; -import org.apache.polaris.service.catalog.iceberg.IcebergCatalog; +import org.apache.polaris.service.catalog.iceberg.LocalIcebergCatalog; import org.apache.polaris.service.catalog.io.FileIOFactory; import org.apache.polaris.service.catalog.io.StorageAccessConfigProvider; import org.apache.polaris.service.config.ReservedProperties; @@ -137,7 +137,7 @@ public abstract class AbstractPolicyCatalogTest { @Inject PolarisPrincipalHolder polarisPrincipalHolder; private PolicyCatalog policyCatalog; - private IcebergCatalog icebergCatalog; + private LocalIcebergCatalog icebergCatalog; private AwsStorageConfigInfo storageConfigModel; private String realmName; private PolarisCallContext polarisContext; @@ -244,7 +244,7 @@ public void before(TestInfo testInfo) { this.policyCatalog = new PolicyCatalog(metaStoreManager, polarisContext, passthroughView); this.icebergCatalog = - new IcebergCatalog( + new LocalIcebergCatalog( diagServices, resolverFactory, metaStoreManager, diff --git a/runtime/service/src/test/java/org/apache/polaris/service/distcache/TestPersistenceDistCacheInvalidationsIntegration.java b/runtime/service/src/test/java/org/apache/polaris/service/distcache/TestPersistenceDistCacheInvalidationsIntegration.java index 41f9628578d..4ba068027e8 100644 --- a/runtime/service/src/test/java/org/apache/polaris/service/distcache/TestPersistenceDistCacheInvalidationsIntegration.java +++ b/runtime/service/src/test/java/org/apache/polaris/service/distcache/TestPersistenceDistCacheInvalidationsIntegration.java @@ -49,7 +49,7 @@ import org.apache.polaris.persistence.nosql.api.cache.CacheInvalidations; import org.apache.polaris.persistence.nosql.api.cache.CacheInvalidations.CacheInvalidation; import org.apache.polaris.persistence.nosql.api.obj.SimpleTestObj; -import org.apache.polaris.service.catalog.iceberg.AbstractIcebergCatalogTest; +import org.apache.polaris.service.catalog.iceberg.AbstractLocalIcebergCatalogTest; import org.assertj.core.api.SoftAssertions; import org.eclipse.microprofile.config.ConfigProvider; import org.junit.jupiter.api.AfterEach; @@ -69,7 +69,7 @@ @SuppressWarnings("CdiInjectionPointsInspection") public class TestPersistenceDistCacheInvalidationsIntegration { - public static class Profile extends AbstractIcebergCatalogTest.Profile { + public static class Profile extends AbstractLocalIcebergCatalogTest.Profile { @Override public Map getConfigOverrides() { return ImmutableMap.builder()