This is an automated email from the ASF dual-hosted git repository.

honahx 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 5132312db Remove deprecated constructor for PolarisCallContext (#1813)
5132312db is described below

commit 5132312dbe80c43c44b6ac27008ed62460721e24
Author: gh-yzou <167037035+gh-y...@users.noreply.github.com>
AuthorDate: Wed Jun 4 17:08:18 2025 -0700

    Remove deprecated constructor for PolarisCallContext (#1813)
    
    After pr #1806, the original constructor is marked as deprecated and is not 
suppose to be used anymore.
    This PR removes the usage of the old constructors.
---
 .../PolarisEclipseLinkMetaStoreManagerTest.java     |  5 ++++-
 .../jdbc/JdbcMetaStoreManagerFactory.java           |  7 ++++---
 ...storeManagerWithJdbcBasePersistenceImplTest.java |  9 ++++++++-
 .../org/apache/polaris/core/PolarisCallContext.java | 21 ---------------------
 .../LocalPolarisMetaStoreManagerFactory.java        |  7 ++++---
 ...sTreeMapAtomicOperationMetaStoreManagerTest.java |  1 +
 .../PolarisTreeMapMetaStoreManagerTest.java         |  1 +
 .../polaris/core/persistence/ResolverTest.java      |  2 +-
 .../persistence/cache/InMemoryEntityCacheTest.java  |  2 +-
 .../storage/InMemoryStorageIntegrationTest.java     |  1 +
 .../storage/cache/StorageCredentialCacheTest.java   |  2 +-
 .../quarkus/admin/ManagementServiceTest.java        |  2 ++
 .../service/quarkus/admin/PolarisAuthzTestBase.java |  1 +
 .../service/quarkus/auth/JWTRSAKeyPairTest.java     |  2 +-
 .../quarkus/auth/JWTSymmetricKeyGeneratorTest.java  |  2 +-
 .../service/quarkus/catalog/IcebergCatalogTest.java |  1 +
 .../quarkus/catalog/IcebergCatalogViewTest.java     |  1 +
 .../catalog/PolarisGenericTableCatalogTest.java     |  1 +
 .../service/quarkus/catalog/PolicyCatalogTest.java  |  1 +
 .../config/DefaultConfigurationStoreTest.java       |  1 +
 .../service/quarkus/entity/CatalogEntityTest.java   |  3 +++
 .../task/BatchFileCleanupTaskHandlerTest.java       |  3 +++
 .../task/ManifestFileCleanupTaskHandlerTest.java    |  4 ++++
 .../quarkus/task/TableCleanupTaskHandlerTest.java   |  1 +
 .../quarkus/test/PolarisIntegrationTestFixture.java |  6 +++++-
 .../service/catalog/io/FileIOFactoryTest.java       |  1 +
 .../polaris/service/task/TaskExecutorImplTest.java  |  2 +-
 .../org/apache/polaris/service/TestServices.java    |  1 +
 28 files changed, 55 insertions(+), 36 deletions(-)

diff --git 
a/persistence/eclipselink/src/test/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreManagerTest.java
 
b/persistence/eclipselink/src/test/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreManagerTest.java
index 03fe51e8b..55607981e 100644
--- 
a/persistence/eclipselink/src/test/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreManagerTest.java
+++ 
b/persistence/eclipselink/src/test/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreManagerTest.java
@@ -37,6 +37,7 @@ import org.apache.polaris.core.PolarisCallContext;
 import org.apache.polaris.core.PolarisDefaultDiagServiceImpl;
 import org.apache.polaris.core.PolarisDiagnostics;
 import org.apache.polaris.core.config.PolarisConfigurationStore;
+import org.apache.polaris.core.context.RealmContext;
 import org.apache.polaris.core.entity.PolarisPrincipalSecrets;
 import org.apache.polaris.core.persistence.BasePolarisMetaStoreManagerTest;
 import org.apache.polaris.core.persistence.PolarisTestMetaStoreManager;
@@ -84,12 +85,14 @@ public class PolarisEclipseLinkMetaStoreManagerTest extends 
BasePolarisMetaStore
   protected PolarisTestMetaStoreManager createPolarisTestMetaStoreManager() {
     PolarisDiagnostics diagServices = new PolarisDefaultDiagServiceImpl();
     PolarisEclipseLinkStore store = new PolarisEclipseLinkStore(diagServices);
+    RealmContext realmContext = () -> "realm";
     PolarisEclipseLinkMetaStoreSessionImpl session =
         new PolarisEclipseLinkMetaStoreSessionImpl(
-            store, Mockito.mock(), () -> "realm", null, "polaris", 
RANDOM_SECRETS);
+            store, Mockito.mock(), realmContext, null, "polaris", 
RANDOM_SECRETS);
     return new PolarisTestMetaStoreManager(
         new TransactionalMetaStoreManagerImpl(),
         new PolarisCallContext(
+            realmContext,
             session,
             diagServices,
             new PolarisConfigurationStore() {},
diff --git 
a/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java
 
b/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java
index 7ad83fe8a..aa7eff785 100644
--- 
a/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java
+++ 
b/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java
@@ -154,10 +154,11 @@ public class JdbcMetaStoreManagerFactory implements 
MetaStoreManagerFactory {
     Map<String, BaseResult> results = new HashMap<>();
 
     for (String realm : realms) {
-      PolarisMetaStoreManager metaStoreManager = 
getOrCreateMetaStoreManager(() -> realm);
-      BasePersistence session = getOrCreateSessionSupplier(() -> realm).get();
+      RealmContext realmContext = () -> realm;
+      PolarisMetaStoreManager metaStoreManager = 
getOrCreateMetaStoreManager(realmContext);
+      BasePersistence session = getOrCreateSessionSupplier(realmContext).get();
 
-      PolarisCallContext callContext = new PolarisCallContext(session, 
diagServices);
+      PolarisCallContext callContext = new PolarisCallContext(realmContext, 
session, diagServices);
       BaseResult result = metaStoreManager.purge(callContext);
       results.put(realm, result);
 
diff --git 
a/persistence/relational-jdbc/src/test/java/org/apache/polaris/persistence/relational/jdbc/AtomicMetastoreManagerWithJdbcBasePersistenceImplTest.java
 
b/persistence/relational-jdbc/src/test/java/org/apache/polaris/persistence/relational/jdbc/AtomicMetastoreManagerWithJdbcBasePersistenceImplTest.java
index 2789b0f31..1df5d6d5f 100644
--- 
a/persistence/relational-jdbc/src/test/java/org/apache/polaris/persistence/relational/jdbc/AtomicMetastoreManagerWithJdbcBasePersistenceImplTest.java
+++ 
b/persistence/relational-jdbc/src/test/java/org/apache/polaris/persistence/relational/jdbc/AtomicMetastoreManagerWithJdbcBasePersistenceImplTest.java
@@ -28,6 +28,7 @@ import org.apache.polaris.core.PolarisCallContext;
 import org.apache.polaris.core.PolarisDefaultDiagServiceImpl;
 import org.apache.polaris.core.PolarisDiagnostics;
 import org.apache.polaris.core.config.PolarisConfigurationStore;
+import org.apache.polaris.core.context.RealmContext;
 import org.apache.polaris.core.persistence.AtomicOperationMetaStoreManager;
 import org.apache.polaris.core.persistence.BasePolarisMetaStoreManagerTest;
 import org.apache.polaris.core.persistence.PolarisTestMetaStoreManager;
@@ -56,11 +57,17 @@ public class 
AtomicMetastoreManagerWithJdbcBasePersistenceImplTest
           e);
     }
 
+    RealmContext realmContext = () -> "REALM";
     JdbcBasePersistenceImpl basePersistence =
-        new JdbcBasePersistenceImpl(datasourceOperations, RANDOM_SECRETS, 
Mockito.mock(), "REALM");
+        new JdbcBasePersistenceImpl(
+            datasourceOperations,
+            RANDOM_SECRETS,
+            Mockito.mock(),
+            realmContext.getRealmIdentifier());
     return new PolarisTestMetaStoreManager(
         new AtomicOperationMetaStoreManager(),
         new PolarisCallContext(
+            realmContext,
             basePersistence,
             diagServices,
             new PolarisConfigurationStore() {},
diff --git 
a/polaris-core/src/main/java/org/apache/polaris/core/PolarisCallContext.java 
b/polaris-core/src/main/java/org/apache/polaris/core/PolarisCallContext.java
index 4d5dfe984..e0f1f7d57 100644
--- a/polaris-core/src/main/java/org/apache/polaris/core/PolarisCallContext.java
+++ b/polaris-core/src/main/java/org/apache/polaris/core/PolarisCallContext.java
@@ -58,18 +58,6 @@ public class PolarisCallContext implements CallContext {
     this.clock = clock;
   }
 
-  @Deprecated
-  public PolarisCallContext(
-      @Nonnull BasePersistence metaStore,
-      @Nonnull PolarisDiagnostics diagServices,
-      @Nonnull PolarisConfigurationStore configurationStore,
-      @Nonnull Clock clock) {
-    this.metaStore = metaStore;
-    this.diagServices = diagServices;
-    this.configurationStore = configurationStore;
-    this.clock = clock;
-  }
-
   public PolarisCallContext(
       @Nonnull RealmContext realmContext,
       @Nonnull BasePersistence metaStore,
@@ -81,15 +69,6 @@ public class PolarisCallContext implements CallContext {
     this.clock = Clock.system(ZoneId.systemDefault());
   }
 
-  @Deprecated
-  public PolarisCallContext(
-      @Nonnull BasePersistence metaStore, @Nonnull PolarisDiagnostics 
diagServices) {
-    this.metaStore = metaStore;
-    this.diagServices = diagServices;
-    this.configurationStore = new PolarisConfigurationStore() {};
-    this.clock = Clock.system(ZoneId.systemDefault());
-  }
-
   public BasePersistence getMetaStore() {
     return metaStore;
   }
diff --git 
a/polaris-core/src/main/java/org/apache/polaris/core/persistence/LocalPolarisMetaStoreManagerFactory.java
 
b/polaris-core/src/main/java/org/apache/polaris/core/persistence/LocalPolarisMetaStoreManagerFactory.java
index 8d385bd0c..1cfa89d0f 100644
--- 
a/polaris-core/src/main/java/org/apache/polaris/core/persistence/LocalPolarisMetaStoreManagerFactory.java
+++ 
b/polaris-core/src/main/java/org/apache/polaris/core/persistence/LocalPolarisMetaStoreManagerFactory.java
@@ -130,10 +130,11 @@ public abstract class 
LocalPolarisMetaStoreManagerFactory<StoreType>
     Map<String, BaseResult> results = new HashMap<>();
 
     for (String realm : realms) {
-      PolarisMetaStoreManager metaStoreManager = 
getOrCreateMetaStoreManager(() -> realm);
-      TransactionalPersistence session = getOrCreateSessionSupplier(() -> 
realm).get();
+      RealmContext realmContext = () -> realm;
+      PolarisMetaStoreManager metaStoreManager = 
getOrCreateMetaStoreManager(realmContext);
+      TransactionalPersistence session = 
getOrCreateSessionSupplier(realmContext).get();
 
-      PolarisCallContext callContext = new PolarisCallContext(session, 
diagServices);
+      PolarisCallContext callContext = new PolarisCallContext(realmContext, 
session, diagServices);
       BaseResult result = metaStoreManager.purge(callContext);
       results.put(realm, result);
 
diff --git 
a/polaris-core/src/test/java/org/apache/polaris/core/persistence/PolarisTreeMapAtomicOperationMetaStoreManagerTest.java
 
b/polaris-core/src/test/java/org/apache/polaris/core/persistence/PolarisTreeMapAtomicOperationMetaStoreManagerTest.java
index d3fd3e284..f89615cf1 100644
--- 
a/polaris-core/src/test/java/org/apache/polaris/core/persistence/PolarisTreeMapAtomicOperationMetaStoreManagerTest.java
+++ 
b/polaris-core/src/test/java/org/apache/polaris/core/persistence/PolarisTreeMapAtomicOperationMetaStoreManagerTest.java
@@ -37,6 +37,7 @@ public class PolarisTreeMapAtomicOperationMetaStoreManagerTest
     TreeMapMetaStore store = new TreeMapMetaStore(diagServices);
     PolarisCallContext callCtx =
         new PolarisCallContext(
+            () -> "testRealm",
             new TreeMapTransactionalPersistenceImpl(store, Mockito.mock(), 
RANDOM_SECRETS),
             diagServices,
             new PolarisConfigurationStore() {},
diff --git 
a/polaris-core/src/test/java/org/apache/polaris/core/persistence/PolarisTreeMapMetaStoreManagerTest.java
 
b/polaris-core/src/test/java/org/apache/polaris/core/persistence/PolarisTreeMapMetaStoreManagerTest.java
index baca459f0..49a2bfcc0 100644
--- 
a/polaris-core/src/test/java/org/apache/polaris/core/persistence/PolarisTreeMapMetaStoreManagerTest.java
+++ 
b/polaris-core/src/test/java/org/apache/polaris/core/persistence/PolarisTreeMapMetaStoreManagerTest.java
@@ -37,6 +37,7 @@ public class PolarisTreeMapMetaStoreManagerTest extends 
BasePolarisMetaStoreMana
     TreeMapMetaStore store = new TreeMapMetaStore(diagServices);
     PolarisCallContext callCtx =
         new PolarisCallContext(
+            () -> "testRealm",
             new TreeMapTransactionalPersistenceImpl(store, Mockito.mock(), 
RANDOM_SECRETS),
             diagServices,
             new PolarisConfigurationStore() {},
diff --git 
a/polaris-core/src/test/java/org/apache/polaris/core/persistence/ResolverTest.java
 
b/polaris-core/src/test/java/org/apache/polaris/core/persistence/ResolverTest.java
index d4c75240d..d72a199ae 100644
--- 
a/polaris-core/src/test/java/org/apache/polaris/core/persistence/ResolverTest.java
+++ 
b/polaris-core/src/test/java/org/apache/polaris/core/persistence/ResolverTest.java
@@ -40,7 +40,7 @@ public class ResolverTest extends BaseResolverTest {
       TreeMapMetaStore store = new TreeMapMetaStore(diagServices);
       TreeMapTransactionalPersistenceImpl metaStore =
           new TreeMapTransactionalPersistenceImpl(store, Mockito.mock(), 
RANDOM_SECRETS);
-      callCtx = new PolarisCallContext(metaStore, diagServices);
+      callCtx = new PolarisCallContext(() -> "testRealm", metaStore, 
diagServices);
     }
     return callCtx;
   }
diff --git 
a/polaris-core/src/test/java/org/apache/polaris/core/persistence/cache/InMemoryEntityCacheTest.java
 
b/polaris-core/src/test/java/org/apache/polaris/core/persistence/cache/InMemoryEntityCacheTest.java
index 72b75ad05..1d0564be9 100644
--- 
a/polaris-core/src/test/java/org/apache/polaris/core/persistence/cache/InMemoryEntityCacheTest.java
+++ 
b/polaris-core/src/test/java/org/apache/polaris/core/persistence/cache/InMemoryEntityCacheTest.java
@@ -91,7 +91,7 @@ public class InMemoryEntityCacheTest {
     diagServices = new PolarisDefaultDiagServiceImpl();
     store = new TreeMapMetaStore(diagServices);
     metaStore = new TreeMapTransactionalPersistenceImpl(store, Mockito.mock(), 
RANDOM_SECRETS);
-    callCtx = new PolarisCallContext(metaStore, diagServices);
+    callCtx = new PolarisCallContext(() -> "testRealm", metaStore, 
diagServices);
     metaStoreManager = new TransactionalMetaStoreManagerImpl();
 
     // bootstrap the mata store with our test schema
diff --git 
a/polaris-core/src/test/java/org/apache/polaris/core/storage/InMemoryStorageIntegrationTest.java
 
b/polaris-core/src/test/java/org/apache/polaris/core/storage/InMemoryStorageIntegrationTest.java
index 8d46171b6..b7ddf82ad 100644
--- 
a/polaris-core/src/test/java/org/apache/polaris/core/storage/InMemoryStorageIntegrationTest.java
+++ 
b/polaris-core/src/test/java/org/apache/polaris/core/storage/InMemoryStorageIntegrationTest.java
@@ -96,6 +96,7 @@ class InMemoryStorageIntegrationTest {
     Map<String, Boolean> config = Map.of("ALLOW_WILDCARD_LOCATION", true);
     PolarisCallContext polarisCallContext =
         new PolarisCallContext(
+            () -> "testRealm",
             Mockito.mock(),
             new PolarisDefaultDiagServiceImpl(),
             new PolarisConfigurationStore() {
diff --git 
a/polaris-core/src/test/java/org/apache/polaris/core/storage/cache/StorageCredentialCacheTest.java
 
b/polaris-core/src/test/java/org/apache/polaris/core/storage/cache/StorageCredentialCacheTest.java
index 8856ddfea..b1d1789da 100644
--- 
a/polaris-core/src/test/java/org/apache/polaris/core/storage/cache/StorageCredentialCacheTest.java
+++ 
b/polaris-core/src/test/java/org/apache/polaris/core/storage/cache/StorageCredentialCacheTest.java
@@ -70,7 +70,7 @@ public class StorageCredentialCacheTest {
     // to interact with the metastore
     TransactionalPersistence metaStore =
         new TreeMapTransactionalPersistenceImpl(store, Mockito.mock(), 
RANDOM_SECRETS);
-    callCtx = new PolarisCallContext(metaStore, diagServices);
+    callCtx = new PolarisCallContext(() -> "testRealm", metaStore, 
diagServices);
     metaStoreManager = Mockito.mock(PolarisMetaStoreManager.class);
     storageCredentialCache = new StorageCredentialCache();
   }
diff --git 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/admin/ManagementServiceTest.java
 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/admin/ManagementServiceTest.java
index 181edd62e..1a42e7e35 100644
--- 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/admin/ManagementServiceTest.java
+++ 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/admin/ManagementServiceTest.java
@@ -68,6 +68,7 @@ public class ManagementServiceTest {
             .build();
     PolarisCallContext polarisCallContext =
         new PolarisCallContext(
+            fakeServices.realmContext(),
             fakeServices
                 .metaStoreManagerFactory()
                 .getOrCreateSessionSupplier(fakeServices.realmContext())
@@ -185,6 +186,7 @@ public class ManagementServiceTest {
     MetaStoreManagerFactory metaStoreManagerFactory = 
services.metaStoreManagerFactory();
     RealmContext realmContext = services.realmContext();
     return new PolarisCallContext(
+        realmContext,
         metaStoreManagerFactory.getOrCreateSessionSupplier(realmContext).get(),
         services.polarisDiagnostics());
   }
diff --git 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/admin/PolarisAuthzTestBase.java
 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/admin/PolarisAuthzTestBase.java
index 83c00530b..db1c4ce44 100644
--- 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/admin/PolarisAuthzTestBase.java
+++ 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/admin/PolarisAuthzTestBase.java
@@ -237,6 +237,7 @@ public abstract class PolarisAuthzTestBase {
 
     polarisContext =
         new PolarisCallContext(
+            realmContext,
             managerFactory.getOrCreateSessionSupplier(realmContext).get(),
             diagServices,
             configurationStore,
diff --git 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/auth/JWTRSAKeyPairTest.java
 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/auth/JWTRSAKeyPairTest.java
index 986282c81..46d2950b9 100644
--- 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/auth/JWTRSAKeyPairTest.java
+++ 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/auth/JWTRSAKeyPairTest.java
@@ -61,7 +61,7 @@ public class JWTRSAKeyPairTest {
     final String scope = "PRINCIPAL_ROLE:TEST";
 
     PolarisCallContext polarisCallContext =
-        new PolarisCallContext(null, null, configurationStore, null);
+        new PolarisCallContext(null, null, null, configurationStore, null);
     PolarisMetaStoreManager metastoreManager = 
Mockito.mock(PolarisMetaStoreManager.class);
     String mainSecret = "client-secret";
     PolarisPrincipalSecrets principalSecrets =
diff --git 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/auth/JWTSymmetricKeyGeneratorTest.java
 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/auth/JWTSymmetricKeyGeneratorTest.java
index b7c3ceef4..6b51f6eda 100644
--- 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/auth/JWTSymmetricKeyGeneratorTest.java
+++ 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/auth/JWTSymmetricKeyGeneratorTest.java
@@ -45,7 +45,7 @@ public class JWTSymmetricKeyGeneratorTest {
   /** Sanity test to verify that we can generate a token */
   @Test
   public void testJWTSymmetricKeyGenerator() {
-    PolarisCallContext polarisCallContext = new PolarisCallContext(null, null, 
null, null);
+    PolarisCallContext polarisCallContext = new PolarisCallContext(null, null, 
null, null, null);
     PolarisMetaStoreManager metastoreManager = 
Mockito.mock(PolarisMetaStoreManager.class);
     String mainSecret = "test_secret";
     String clientId = "test_client_id";
diff --git 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/IcebergCatalogTest.java
 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/IcebergCatalogTest.java
index eb01ba683..7ae1b0df7 100644
--- 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/IcebergCatalogTest.java
+++ 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/IcebergCatalogTest.java
@@ -250,6 +250,7 @@ public abstract class IcebergCatalogTest extends 
CatalogTests<IcebergCatalog> {
     userSecretsManager = 
userSecretsManagerFactory.getOrCreateUserSecretsManager(realmContext);
     polarisContext =
         new PolarisCallContext(
+            realmContext,
             managerFactory.getOrCreateSessionSupplier(realmContext).get(),
             diagServices,
             configurationStore,
diff --git 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/IcebergCatalogViewTest.java
 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/IcebergCatalogViewTest.java
index 8b09d243a..36480961c 100644
--- 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/IcebergCatalogViewTest.java
+++ 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/IcebergCatalogViewTest.java
@@ -170,6 +170,7 @@ public class IcebergCatalogViewTest extends 
ViewCatalogTests<IcebergCatalog> {
     userSecretsManager = 
userSecretsManagerFactory.getOrCreateUserSecretsManager(realmContext);
     polarisContext =
         new PolarisCallContext(
+            realmContext,
             managerFactory.getOrCreateSessionSupplier(realmContext).get(),
             diagServices,
             configurationStore,
diff --git 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/PolarisGenericTableCatalogTest.java
 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/PolarisGenericTableCatalogTest.java
index 3082eda6d..ae1d0584f 100644
--- 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/PolarisGenericTableCatalogTest.java
+++ 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/PolarisGenericTableCatalogTest.java
@@ -171,6 +171,7 @@ public class PolarisGenericTableCatalogTest {
     userSecretsManager = 
userSecretsManagerFactory.getOrCreateUserSecretsManager(realmContext);
     polarisContext =
         new PolarisCallContext(
+            realmContext,
             managerFactory.getOrCreateSessionSupplier(realmContext).get(),
             diagServices,
             configurationStore,
diff --git 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/PolicyCatalogTest.java
 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/PolicyCatalogTest.java
index 6e5cebb0d..fa6b35db5 100644
--- 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/PolicyCatalogTest.java
+++ 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/PolicyCatalogTest.java
@@ -195,6 +195,7 @@ public class PolicyCatalogTest {
     userSecretsManager = 
userSecretsManagerFactory.getOrCreateUserSecretsManager(realmContext);
     polarisContext =
         new PolarisCallContext(
+            realmContext,
             managerFactory.getOrCreateSessionSupplier(realmContext).get(),
             diagServices,
             configurationStore,
diff --git 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/config/DefaultConfigurationStoreTest.java
 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/config/DefaultConfigurationStoreTest.java
index e7ad9e6c2..5ee7f65f9 100644
--- 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/config/DefaultConfigurationStoreTest.java
+++ 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/config/DefaultConfigurationStoreTest.java
@@ -91,6 +91,7 @@ public class DefaultConfigurationStoreTest {
     realmContext = () -> realmName;
     polarisContext =
         new PolarisCallContext(
+            realmContext,
             managerFactory.getOrCreateSessionSupplier(realmContext).get(),
             diagServices,
             configurationStore,
diff --git 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/entity/CatalogEntityTest.java
 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/entity/CatalogEntityTest.java
index 8d8caabfd..f1e53b4fe 100644
--- 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/entity/CatalogEntityTest.java
+++ 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/entity/CatalogEntityTest.java
@@ -29,6 +29,7 @@ import 
org.apache.polaris.core.admin.model.GcpStorageConfigInfo;
 import org.apache.polaris.core.admin.model.PolarisCatalog;
 import org.apache.polaris.core.admin.model.StorageConfigInfo;
 import org.apache.polaris.core.context.CallContext;
+import org.apache.polaris.core.context.RealmContext;
 import org.apache.polaris.core.entity.CatalogEntity;
 import org.apache.polaris.core.persistence.MetaStoreManagerFactory;
 import 
org.apache.polaris.service.persistence.InMemoryPolarisMetaStoreManagerFactory;
@@ -43,8 +44,10 @@ public class CatalogEntityTest {
   @BeforeAll
   public static void setup() {
     MetaStoreManagerFactory metaStoreManagerFactory = new 
InMemoryPolarisMetaStoreManagerFactory();
+    RealmContext realmContext = () -> "realm";
     PolarisCallContext polarisCallContext =
         new PolarisCallContext(
+            realmContext,
             metaStoreManagerFactory.getOrCreateSessionSupplier(() -> 
"realm").get(),
             new PolarisDefaultDiagServiceImpl());
     CallContext callContext = CallContext.of(() -> "realm", 
polarisCallContext);
diff --git 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/task/BatchFileCleanupTaskHandlerTest.java
 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/task/BatchFileCleanupTaskHandlerTest.java
index 925991784..5547a5243 100644
--- 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/task/BatchFileCleanupTaskHandlerTest.java
+++ 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/task/BatchFileCleanupTaskHandlerTest.java
@@ -92,6 +92,7 @@ public class BatchFileCleanupTaskHandlerTest {
   public void testMetadataFileCleanup() throws IOException {
     PolarisCallContext polarisCallContext =
         new PolarisCallContext(
+            realmContext,
             
metaStoreManagerFactory.getOrCreateSessionSupplier(realmContext).get(),
             new PolarisDefaultDiagServiceImpl());
     CallContext callCtx = CallContext.of(realmContext, polarisCallContext);
@@ -205,6 +206,7 @@ public class BatchFileCleanupTaskHandlerTest {
   public void testMetadataFileCleanupIfFileNotExist() throws IOException {
     PolarisCallContext polarisCallContext =
         new PolarisCallContext(
+            realmContext,
             
metaStoreManagerFactory.getOrCreateSessionSupplier(realmContext).get(),
             new PolarisDefaultDiagServiceImpl());
     CallContext callCtx = CallContext.of(realmContext, polarisCallContext);
@@ -250,6 +252,7 @@ public class BatchFileCleanupTaskHandlerTest {
   public void testCleanupWithRetries() throws IOException {
     PolarisCallContext polarisCallContext =
         new PolarisCallContext(
+            realmContext,
             
metaStoreManagerFactory.getOrCreateSessionSupplier(realmContext).get(),
             new PolarisDefaultDiagServiceImpl());
     CallContext callCtx = CallContext.of(realmContext, polarisCallContext);
diff --git 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/task/ManifestFileCleanupTaskHandlerTest.java
 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/task/ManifestFileCleanupTaskHandlerTest.java
index 58fa14d7e..15bb122ac 100644
--- 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/task/ManifestFileCleanupTaskHandlerTest.java
+++ 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/task/ManifestFileCleanupTaskHandlerTest.java
@@ -91,6 +91,7 @@ class ManifestFileCleanupTaskHandlerTest {
   public void testCleanupFileNotExists() throws IOException {
     PolarisCallContext polarisCallContext =
         new PolarisCallContext(
+            realmContext,
             
metaStoreManagerFactory.getOrCreateSessionSupplier(realmContext).get(),
             new PolarisDefaultDiagServiceImpl());
     CallContext callCtx = CallContext.of(realmContext, polarisCallContext);
@@ -121,6 +122,7 @@ class ManifestFileCleanupTaskHandlerTest {
   public void testCleanupFileManifestExistsDataFilesDontExist() throws 
IOException {
     PolarisCallContext polarisCallContext =
         new PolarisCallContext(
+            realmContext,
             
metaStoreManagerFactory.getOrCreateSessionSupplier(realmContext).get(),
             new PolarisDefaultDiagServiceImpl());
     CallContext callCtx = CallContext.of(realmContext, polarisCallContext);
@@ -150,6 +152,7 @@ class ManifestFileCleanupTaskHandlerTest {
   public void testCleanupFiles() throws IOException {
     PolarisCallContext polarisCallContext =
         new PolarisCallContext(
+            realmContext,
             
metaStoreManagerFactory.getOrCreateSessionSupplier(realmContext).get(),
             new PolarisDefaultDiagServiceImpl());
     CallContext callCtx = CallContext.of(realmContext, polarisCallContext);
@@ -196,6 +199,7 @@ class ManifestFileCleanupTaskHandlerTest {
   public void testCleanupFilesWithRetries() throws IOException {
     PolarisCallContext polarisCallContext =
         new PolarisCallContext(
+            realmContext,
             
metaStoreManagerFactory.getOrCreateSessionSupplier(realmContext).get(),
             new PolarisDefaultDiagServiceImpl());
     CallContext callCtx = CallContext.of(realmContext, polarisCallContext);
diff --git 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/task/TableCleanupTaskHandlerTest.java
 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/task/TableCleanupTaskHandlerTest.java
index d4147252f..6d39e1ac8 100644
--- 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/task/TableCleanupTaskHandlerTest.java
+++ 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/task/TableCleanupTaskHandlerTest.java
@@ -102,6 +102,7 @@ class TableCleanupTaskHandlerTest {
     QuarkusMock.installMockForType(realmContext, RealmContext.class);
     PolarisCallContext polarisCallContext =
         new PolarisCallContext(
+            realmContext,
             
metaStoreManagerFactory.getOrCreateSessionSupplier(realmContext).get(),
             diagServices,
             configurationStore,
diff --git 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/test/PolarisIntegrationTestFixture.java
 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/test/PolarisIntegrationTestFixture.java
index 2dc0400bc..e9268befb 100644
--- 
a/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/test/PolarisIntegrationTestFixture.java
+++ 
b/quarkus/service/src/test/java/org/apache/polaris/service/quarkus/test/PolarisIntegrationTestFixture.java
@@ -114,7 +114,11 @@ public class PolarisIntegrationTestFixture {
         
helper.metaStoreManagerFactory.getOrCreateSessionSupplier(realmContext).get();
     PolarisCallContext polarisContext =
         new PolarisCallContext(
-            metaStoreSession, helper.diagServices, helper.configurationStore, 
helper.clock);
+            realmContext,
+            metaStoreSession,
+            helper.diagServices,
+            helper.configurationStore,
+            helper.clock);
     try {
       PolarisMetaStoreManager metaStoreManager =
           
helper.metaStoreManagerFactory.getOrCreateMetaStoreManager(realmContext);
diff --git 
a/service/common/src/test/java/org/apache/polaris/service/catalog/io/FileIOFactoryTest.java
 
b/service/common/src/test/java/org/apache/polaris/service/catalog/io/FileIOFactoryTest.java
index 28a181ef8..0303ecb57 100644
--- 
a/service/common/src/test/java/org/apache/polaris/service/catalog/io/FileIOFactoryTest.java
+++ 
b/service/common/src/test/java/org/apache/polaris/service/catalog/io/FileIOFactoryTest.java
@@ -145,6 +145,7 @@ public class FileIOFactoryTest {
           @Override
           public PolarisCallContext getPolarisCallContext() {
             return new PolarisCallContext(
+                realmContext,
                 testServices
                     .metaStoreManagerFactory()
                     .getOrCreateSessionSupplier(realmContext)
diff --git 
a/service/common/src/test/java/org/apache/polaris/service/task/TaskExecutorImplTest.java
 
b/service/common/src/test/java/org/apache/polaris/service/task/TaskExecutorImplTest.java
index 1cc88fc10..bd8b86789 100644
--- 
a/service/common/src/test/java/org/apache/polaris/service/task/TaskExecutorImplTest.java
+++ 
b/service/common/src/test/java/org/apache/polaris/service/task/TaskExecutorImplTest.java
@@ -50,7 +50,7 @@ public class TaskExecutorImplTest {
     BasePersistence bp = 
metaStoreManagerFactory.getOrCreateSessionSupplier(realmContext).get();
 
     PolarisCallContext polarisCallCtx =
-        new PolarisCallContext(bp, testServices.polarisDiagnostics());
+        new PolarisCallContext(realmContext, bp, 
testServices.polarisDiagnostics());
     CallContext callContext = CallContext.of(realmContext, polarisCallCtx);
 
     // This task doesn't have a type so it won't be handle-able by a real 
handler. We register a
diff --git 
a/service/common/src/testFixtures/java/org/apache/polaris/service/TestServices.java
 
b/service/common/src/testFixtures/java/org/apache/polaris/service/TestServices.java
index 72725c39e..3e0bc6d13 100644
--- 
a/service/common/src/testFixtures/java/org/apache/polaris/service/TestServices.java
+++ 
b/service/common/src/testFixtures/java/org/apache/polaris/service/TestServices.java
@@ -172,6 +172,7 @@ public record TestServices(
             @Override
             public PolarisCallContext getPolarisCallContext() {
               return new PolarisCallContext(
+                  realmContext,
                   metaStoreSession,
                   polarisDiagnostics,
                   configurationStore,

Reply via email to