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

snazy 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 fcd47770c Add PolarisDiagnostics field to 
AbstractTransactionalPersistence (#2372)
fcd47770c is described below

commit fcd47770c58e4325c410cefc88ab5bdaffb9f69a
Author: Christopher Lambert <xn...@gmx.de>
AuthorDate: Wed Aug 20 10:25:09 2025 +0200

    Add PolarisDiagnostics field to AbstractTransactionalPersistence (#2372)
    
    The ultimate goal is removing the `PolarisCallContext` parameter from every 
`PolarisMetaStoreManager` interface method, so we make steps towards reducing 
its usage first.
---
 .../EclipseLinkPolarisMetaStoreManagerFactory.java |  1 +
 .../PolarisEclipseLinkMetaStoreSessionImpl.java    | 21 ++++++++---------
 .../PolarisEclipseLinkMetaStoreManagerTest.java    | 10 ++++++--
 .../AbstractTransactionalPersistence.java          | 21 ++++++++++++-----
 .../TreeMapTransactionalPersistenceImpl.java       | 27 ++++++++++------------
 ...TreeMapAtomicOperationMetaStoreManagerTest.java |  9 ++++----
 .../PolarisTreeMapMetaStoreManagerTest.java        |  9 ++++----
 .../polaris/core/persistence/ResolverTest.java     |  3 ++-
 .../persistence/cache/InMemoryEntityCacheTest.java |  3 ++-
 .../storage/cache/StorageCredentialCacheTest.java  |  3 ++-
 .../InMemoryPolarisMetaStoreManagerFactory.java    |  2 +-
 11 files changed, 61 insertions(+), 48 deletions(-)

diff --git 
a/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/EclipseLinkPolarisMetaStoreManagerFactory.java
 
b/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/EclipseLinkPolarisMetaStoreManagerFactory.java
index 16c1bb8f4..de121d856 100644
--- 
a/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/EclipseLinkPolarisMetaStoreManagerFactory.java
+++ 
b/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/EclipseLinkPolarisMetaStoreManagerFactory.java
@@ -68,6 +68,7 @@ public class EclipseLinkPolarisMetaStoreManagerFactory
       @Nullable RootCredentialsSet rootCredentialsSet,
       @Nonnull PolarisDiagnostics diagnostics) {
     return new PolarisEclipseLinkMetaStoreSessionImpl(
+        diagnostics,
         store,
         storageIntegrationProvider,
         realmContext,
diff --git 
a/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java
 
b/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java
index 1d708cce6..9929c2da3 100644
--- 
a/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java
+++ 
b/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java
@@ -39,6 +39,7 @@ import java.util.function.Supplier;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import org.apache.polaris.core.PolarisCallContext;
+import org.apache.polaris.core.PolarisDiagnostics;
 import org.apache.polaris.core.context.RealmContext;
 import org.apache.polaris.core.entity.EntityNameLookupRecord;
 import org.apache.polaris.core.entity.LocationBasedEntity;
@@ -106,12 +107,14 @@ public class PolarisEclipseLinkMetaStoreSessionImpl 
extends AbstractTransactiona
    * @param persistenceUnitName Optional persistence-unit name in confFile. 
Default to 'polaris'.
    */
   public PolarisEclipseLinkMetaStoreSessionImpl(
+      @Nonnull PolarisDiagnostics diagnostics,
       @Nonnull PolarisEclipseLinkStore store,
       @Nonnull PolarisStorageIntegrationProvider storageIntegrationProvider,
       @Nonnull RealmContext realmContext,
       @Nullable String confFile,
       @Nullable String persistenceUnitName,
       @Nonnull PrincipalSecretsGenerator secretsGenerator) {
+    super(diagnostics);
     LOGGER.debug(
         "Creating EclipseLink Meta Store Session for realm {}", 
realmContext.getRealmIdentifier());
     emf = createEntityManagerFactory(realmContext, confFile, 
persistenceUnitName);
@@ -159,7 +162,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl extends 
AbstractTransactiona
   @Override
   public <T> T runInTransaction(
       @Nonnull PolarisCallContext callCtx, @Nonnull Supplier<T> 
transactionCode) {
-    callCtx.getDiagServices().check(localSession.get() == null, "cannot nest 
transaction");
+    getDiagnostics().check(localSession.get() == null, "cannot nest 
transaction");
 
     try (EntityManager session = emf.createEntityManager()) {
       localSession.set(session);
@@ -206,7 +209,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl extends 
AbstractTransactiona
   @Override
   public void runActionInTransaction(
       @Nonnull PolarisCallContext callCtx, @Nonnull Runnable transactionCode) {
-    callCtx.getDiagServices().check(localSession.get() == null, "cannot nest 
transaction");
+    getDiagnostics().check(localSession.get() == null, "cannot nest 
transaction");
 
     try (EntityManager session = emf.createEntityManager()) {
       localSession.set(session);
@@ -560,8 +563,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl extends 
AbstractTransactiona
             this.store.lookupPrincipalSecrets(localSession.get(), clientId));
 
     // should be found
-    callCtx
-        .getDiagServices()
+    getDiagnostics()
         .checkNotNull(
             principalSecrets,
             "cannot_find_secrets",
@@ -570,8 +572,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl extends 
AbstractTransactiona
             principalId);
 
     // ensure principal id is matching
-    callCtx
-        .getDiagServices()
+    getDiagnostics()
         .check(
             principalId == principalSecrets.getPrincipalId(),
             "principal_id_mismatch",
@@ -601,8 +602,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl extends 
AbstractTransactiona
         this.store.lookupPrincipalSecrets(localSession.get(), clientId);
 
     // should be found
-    callCtx
-        .getDiagServices()
+    getDiagnostics()
         .checkNotNull(
             principalSecrets,
             "cannot_find_secrets",
@@ -611,8 +611,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl extends 
AbstractTransactiona
             principalId);
 
     // ensure principal id is matching
-    callCtx
-        .getDiagServices()
+    getDiagnostics()
         .check(
             principalId == principalSecrets.getPrincipalId(),
             "principal_id_mismatch",
@@ -642,7 +641,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl extends 
AbstractTransactiona
       PolarisStorageIntegration<T> loadPolarisStorageIntegrationInCurrentTxn(
           @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity 
entity) {
     PolarisStorageConfigurationInfo storageConfig =
-        
BaseMetaStoreManager.extractStorageConfiguration(callCtx.getDiagServices(), 
entity);
+        BaseMetaStoreManager.extractStorageConfiguration(getDiagnostics(), 
entity);
     return 
storageIntegrationProvider.getStorageIntegrationForConfig(storageConfig);
   }
 
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 d2cb37fec..ab768ba83 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
@@ -86,7 +86,7 @@ public class PolarisEclipseLinkMetaStoreManagerTest extends 
BasePolarisMetaStore
     RealmContext realmContext = () -> "realm";
     PolarisEclipseLinkMetaStoreSessionImpl session =
         new PolarisEclipseLinkMetaStoreSessionImpl(
-            store, Mockito.mock(), realmContext, null, "polaris", 
RANDOM_SECRETS);
+            diagServices, store, Mockito.mock(), realmContext, null, 
"polaris", RANDOM_SECRETS);
     TransactionalMetaStoreManagerImpl metaStoreManager =
         new TransactionalMetaStoreManagerImpl(clock, diagServices);
     PolarisCallContext callCtx = new PolarisCallContext(realmContext, session, 
diagServices);
@@ -104,7 +104,13 @@ public class PolarisEclipseLinkMetaStoreManagerTest 
extends BasePolarisMetaStore
     try {
       var session =
           new PolarisEclipseLinkMetaStoreSessionImpl(
-              store, Mockito.mock(), () -> "realm", confFile, "polaris", 
RANDOM_SECRETS);
+              diagServices,
+              store,
+              Mockito.mock(),
+              () -> "realm",
+              confFile,
+              "polaris",
+              RANDOM_SECRETS);
       assertNotNull(session);
       assertTrue(success);
     } catch (Exception e) {
diff --git 
a/polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/AbstractTransactionalPersistence.java
 
b/polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/AbstractTransactionalPersistence.java
index 774c8e6ae..138b3f4a7 100644
--- 
a/polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/AbstractTransactionalPersistence.java
+++ 
b/polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/AbstractTransactionalPersistence.java
@@ -25,6 +25,7 @@ import java.util.List;
 import java.util.function.Function;
 import java.util.function.Predicate;
 import org.apache.polaris.core.PolarisCallContext;
+import org.apache.polaris.core.PolarisDiagnostics;
 import org.apache.polaris.core.entity.EntityNameLookupRecord;
 import org.apache.polaris.core.entity.PolarisBaseEntity;
 import org.apache.polaris.core.entity.PolarisChangeTrackingVersions;
@@ -51,6 +52,17 @@ import 
org.apache.polaris.core.storage.PolarisStorageIntegration;
  * the BasePersistence methods in terms of lower-level methods that subclasses 
must implement.
  */
 public abstract class AbstractTransactionalPersistence implements 
TransactionalPersistence {
+
+  private final PolarisDiagnostics diagnostics;
+
+  protected AbstractTransactionalPersistence(PolarisDiagnostics diagnostics) {
+    this.diagnostics = diagnostics;
+  }
+
+  protected PolarisDiagnostics getDiagnostics() {
+    return diagnostics;
+  }
+
   //
   // New abstract methods specific to this slice-based transactional 
persistence that subclasses
   // must implement to inherit implementations of lookup/write/delete
@@ -210,8 +222,7 @@ public abstract class AbstractTransactionalPersistence 
implements TransactionalP
       @Nonnull List<PolarisBaseEntity> entities,
       @Nullable List<PolarisBaseEntity> originalEntities) {
     if (originalEntities != null) {
-      callCtx
-          .getDiagServices()
+      getDiagnostics()
           .check(
               entities.size() == originalEntities.size(),
               "mismatched_entities_and_original_entities_size",
@@ -580,8 +591,7 @@ public abstract class AbstractTransactionalPersistence 
implements TransactionalP
       @Nonnull List<PolarisBaseEntity> entities,
       @Nullable List<PolarisBaseEntity> originalEntities) {
     if (originalEntities != null) {
-      callCtx
-          .getDiagServices()
+      getDiagnostics()
           .check(
               entities.size() == originalEntities.size(),
               "mismatched_entities_and_original_entities_size",
@@ -643,8 +653,7 @@ public abstract class AbstractTransactionalPersistence 
implements TransactionalP
             entityActiveRecord.getCatalogId(),
             entityActiveRecord.getId(),
             entityActiveRecord.getTypeCode());
-    callCtx
-        .getDiagServices()
+    getDiagnostics()
         .checkNotNull(
             entity, "unexpected_not_found_entity", "entityActiveRecord={}", 
entityActiveRecord);
 
diff --git 
a/polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/TreeMapTransactionalPersistenceImpl.java
 
b/polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/TreeMapTransactionalPersistenceImpl.java
index cd71a6079..7fdd94b9a 100644
--- 
a/polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/TreeMapTransactionalPersistenceImpl.java
+++ 
b/polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/TreeMapTransactionalPersistenceImpl.java
@@ -29,6 +29,7 @@ import java.util.function.Supplier;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import org.apache.polaris.core.PolarisCallContext;
+import org.apache.polaris.core.PolarisDiagnostics;
 import org.apache.polaris.core.entity.EntityNameLookupRecord;
 import org.apache.polaris.core.entity.LocationBasedEntity;
 import org.apache.polaris.core.entity.PolarisBaseEntity;
@@ -62,11 +63,11 @@ public class TreeMapTransactionalPersistenceImpl extends 
AbstractTransactionalPe
   private final PrincipalSecretsGenerator secretsGenerator;
 
   public TreeMapTransactionalPersistenceImpl(
+      @Nonnull PolarisDiagnostics diagnostics,
       @Nonnull TreeMapMetaStore store,
       @Nonnull PolarisStorageIntegrationProvider storageIntegrationProvider,
       @Nonnull PrincipalSecretsGenerator secretsGenerator) {
-
-    // init store
+    super(diagnostics);
     this.store = store;
     this.storageIntegrationProvider = storageIntegrationProvider;
     this.secretsGenerator = secretsGenerator;
@@ -78,7 +79,7 @@ public class TreeMapTransactionalPersistenceImpl extends 
AbstractTransactionalPe
       @Nonnull PolarisCallContext callCtx, @Nonnull Supplier<T> 
transactionCode) {
 
     // run transaction on our underlying store
-    return store.runInTransaction(callCtx.getDiagServices(), transactionCode);
+    return store.runInTransaction(getDiagnostics(), transactionCode);
   }
 
   /** {@inheritDoc} */
@@ -87,7 +88,7 @@ public class TreeMapTransactionalPersistenceImpl extends 
AbstractTransactionalPe
       @Nonnull PolarisCallContext callCtx, @Nonnull Runnable transactionCode) {
 
     // run transaction on our underlying store
-    store.runActionInTransaction(callCtx.getDiagServices(), transactionCode);
+    store.runActionInTransaction(getDiagnostics(), transactionCode);
   }
 
   /** {@inheritDoc} */
@@ -95,7 +96,7 @@ public class TreeMapTransactionalPersistenceImpl extends 
AbstractTransactionalPe
   public <T> T runInReadTransaction(
       @Nonnull PolarisCallContext callCtx, @Nonnull Supplier<T> 
transactionCode) {
     // run transaction on our underlying store
-    return store.runInReadTransaction(callCtx.getDiagServices(), 
transactionCode);
+    return store.runInReadTransaction(getDiagnostics(), transactionCode);
   }
 
   /** {@inheritDoc} */
@@ -104,7 +105,7 @@ public class TreeMapTransactionalPersistenceImpl extends 
AbstractTransactionalPe
       @Nonnull PolarisCallContext callCtx, @Nonnull Runnable transactionCode) {
 
     // run transaction on our underlying store
-    store.runActionInReadTransaction(callCtx.getDiagServices(), 
transactionCode);
+    store.runActionInReadTransaction(getDiagnostics(), transactionCode);
   }
 
   /**
@@ -462,8 +463,7 @@ public class TreeMapTransactionalPersistenceImpl extends 
AbstractTransactionalPe
     PolarisPrincipalSecrets principalSecrets = 
this.store.getSlicePrincipalSecrets().read(clientId);
 
     // should be found
-    callCtx
-        .getDiagServices()
+    getDiagnostics()
         .checkNotNull(
             principalSecrets,
             "cannot_find_secrets",
@@ -472,8 +472,7 @@ public class TreeMapTransactionalPersistenceImpl extends 
AbstractTransactionalPe
             principalId);
 
     // ensure principal id is matching
-    callCtx
-        .getDiagServices()
+    getDiagnostics()
         .check(
             principalId == principalSecrets.getPrincipalId(),
             "principal_id_mismatch",
@@ -502,8 +501,7 @@ public class TreeMapTransactionalPersistenceImpl extends 
AbstractTransactionalPe
     PolarisPrincipalSecrets principalSecrets = 
this.store.getSlicePrincipalSecrets().read(clientId);
 
     // should be found
-    callCtx
-        .getDiagServices()
+    getDiagnostics()
         .checkNotNull(
             principalSecrets,
             "cannot_find_secrets",
@@ -512,8 +510,7 @@ public class TreeMapTransactionalPersistenceImpl extends 
AbstractTransactionalPe
             principalId);
 
     // ensure principal id is matching
-    callCtx
-        .getDiagServices()
+    getDiagnostics()
         .check(
             principalId == principalSecrets.getPrincipalId(),
             "principal_id_mismatch",
@@ -543,7 +540,7 @@ public class TreeMapTransactionalPersistenceImpl extends 
AbstractTransactionalPe
       PolarisStorageIntegration<T> loadPolarisStorageIntegrationInCurrentTxn(
           @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity 
entity) {
     PolarisStorageConfigurationInfo storageConfig =
-        
BaseMetaStoreManager.extractStorageConfiguration(callCtx.getDiagServices(), 
entity);
+        BaseMetaStoreManager.extractStorageConfiguration(getDiagnostics(), 
entity);
     return 
storageIntegrationProvider.getStorageIntegrationForConfig(storageConfig);
   }
 
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 ee103ab10..0b1035668 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
@@ -33,12 +33,11 @@ public class 
PolarisTreeMapAtomicOperationMetaStoreManagerTest
   public PolarisTestMetaStoreManager createPolarisTestMetaStoreManager() {
     PolarisDiagnostics diagServices = new PolarisDefaultDiagServiceImpl();
     TreeMapMetaStore store = new TreeMapMetaStore(diagServices);
+    TreeMapTransactionalPersistenceImpl metaStore =
+        new TreeMapTransactionalPersistenceImpl(
+            diagServices, store, Mockito.mock(), RANDOM_SECRETS);
     AtomicOperationMetaStoreManager metaStoreManager = new 
AtomicOperationMetaStoreManager(clock);
-    PolarisCallContext callCtx =
-        new PolarisCallContext(
-            () -> "testRealm",
-            new TreeMapTransactionalPersistenceImpl(store, Mockito.mock(), 
RANDOM_SECRETS),
-            diagServices);
+    PolarisCallContext callCtx = new PolarisCallContext(() -> "testRealm", 
metaStore, diagServices);
     return new PolarisTestMetaStoreManager(metaStoreManager, callCtx);
   }
 }
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 d1d3b8de0..a07f7be99 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
@@ -33,13 +33,12 @@ public class PolarisTreeMapMetaStoreManagerTest extends 
BasePolarisMetaStoreMana
   public PolarisTestMetaStoreManager createPolarisTestMetaStoreManager() {
     PolarisDiagnostics diagServices = new PolarisDefaultDiagServiceImpl();
     TreeMapMetaStore store = new TreeMapMetaStore(diagServices);
+    TreeMapTransactionalPersistenceImpl metaStore =
+        new TreeMapTransactionalPersistenceImpl(
+            diagServices, store, Mockito.mock(), RANDOM_SECRETS);
     TransactionalMetaStoreManagerImpl metaStoreManager =
         new TransactionalMetaStoreManagerImpl(clock, diagServices);
-    PolarisCallContext callCtx =
-        new PolarisCallContext(
-            () -> "testRealm",
-            new TreeMapTransactionalPersistenceImpl(store, Mockito.mock(), 
RANDOM_SECRETS),
-            diagServices);
+    PolarisCallContext callCtx = new PolarisCallContext(() -> "testRealm", 
metaStore, diagServices);
     return new PolarisTestMetaStoreManager(metaStoreManager, callCtx);
   }
 }
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 37e66499b..e0add4fea 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
@@ -41,7 +41,8 @@ public class ResolverTest extends BaseResolverTest {
     if (callCtx == null) {
       TreeMapMetaStore store = new TreeMapMetaStore(diagServices);
       TreeMapTransactionalPersistenceImpl metaStore =
-          new TreeMapTransactionalPersistenceImpl(store, Mockito.mock(), 
RANDOM_SECRETS);
+          new TreeMapTransactionalPersistenceImpl(
+              diagServices, store, Mockito.mock(), RANDOM_SECRETS);
       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 628a4b291..fa8437fa0 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
@@ -79,7 +79,8 @@ public class InMemoryEntityCacheTest {
     diagServices = new PolarisDefaultDiagServiceImpl();
     TreeMapMetaStore store = new TreeMapMetaStore(diagServices);
     TransactionalPersistence metaStore =
-        new TreeMapTransactionalPersistenceImpl(store, Mockito.mock(), 
RANDOM_SECRETS);
+        new TreeMapTransactionalPersistenceImpl(
+            diagServices, store, Mockito.mock(), RANDOM_SECRETS);
     metaStoreManager = new 
TransactionalMetaStoreManagerImpl(Clock.systemUTC(), diagServices);
     callCtx = new PolarisCallContext(() -> "testRealm", metaStore, 
diagServices);
 
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 07b233228..a8e97133b 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
@@ -63,7 +63,8 @@ public class StorageCredentialCacheTest {
     TreeMapMetaStore store = new TreeMapMetaStore(diagServices);
     // to interact with the metastore
     TransactionalPersistence metaStore =
-        new TreeMapTransactionalPersistenceImpl(store, Mockito.mock(), 
RANDOM_SECRETS);
+        new TreeMapTransactionalPersistenceImpl(
+            diagServices, store, Mockito.mock(), RANDOM_SECRETS);
     callCtx = new PolarisCallContext(() -> "testRealm", metaStore, 
diagServices);
     storageCredentialCacheConfig = () -> 10_000;
     metaStoreManager = Mockito.mock(PolarisMetaStoreManager.class);
diff --git 
a/runtime/service/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java
 
b/runtime/service/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java
index fb846aef5..3e8b6e538 100644
--- 
a/runtime/service/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java
+++ 
b/runtime/service/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java
@@ -73,7 +73,7 @@ public class InMemoryPolarisMetaStoreManagerFactory
       @Nullable RootCredentialsSet rootCredentialsSet,
       @Nonnull PolarisDiagnostics diagnostics) {
     return new TreeMapTransactionalPersistenceImpl(
-        store, storageIntegration, secretsGenerator(realmContext, 
rootCredentialsSet));
+        diagnostics, store, storageIntegration, secretsGenerator(realmContext, 
rootCredentialsSet));
   }
 
   @Override

Reply via email to