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

dimas 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 2332f63fb Simplify BaseMetaStoreManager.extractStorageConfiguration 
(#2194)
2332f63fb is described below

commit 2332f63fbf6942c016549080f2e445545068eba1
Author: Christopher Lambert <xn...@gmx.de>
AuthorDate: Wed Jul 30 23:34:06 2025 +0200

    Simplify BaseMetaStoreManager.extractStorageConfiguration (#2194)
    
    as a static helper method its strongly preferable to not depend on
    the full `PolarisCallContext` if not necessary.
---
 .../PolarisEclipseLinkMetaStoreSessionImpl.java         |  2 +-
 .../relational/jdbc/JdbcBasePersistenceImpl.java        |  2 +-
 .../persistence/AtomicOperationMetaStoreManager.java    |  3 ++-
 .../polaris/core/persistence/BaseMetaStoreManager.java  | 17 ++++++++---------
 .../TransactionalMetaStoreManagerImpl.java              |  3 ++-
 .../TreeMapTransactionalPersistenceImpl.java            |  2 +-
 6 files changed, 15 insertions(+), 14 deletions(-)

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 0981275fd..cf2e9053b 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
@@ -679,7 +679,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl extends 
AbstractTransactiona
       PolarisStorageIntegration<T> loadPolarisStorageIntegrationInCurrentTxn(
           @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity 
entity) {
     PolarisStorageConfigurationInfo storageConfig =
-        BaseMetaStoreManager.extractStorageConfiguration(callCtx, entity);
+        
BaseMetaStoreManager.extractStorageConfiguration(callCtx.getDiagServices(), 
entity);
     return 
storageIntegrationProvider.getStorageIntegrationForConfig(storageConfig);
   }
 
diff --git 
a/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java
 
b/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java
index c93765c84..8e2f905d6 100644
--- 
a/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java
+++ 
b/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java
@@ -1120,7 +1120,7 @@ public class JdbcBasePersistenceImpl implements 
BasePersistence, IntegrationPers
       PolarisStorageIntegration<T> loadPolarisStorageIntegration(
           @Nonnull PolarisCallContext callContext, @Nonnull PolarisBaseEntity 
entity) {
     PolarisStorageConfigurationInfo storageConfig =
-        BaseMetaStoreManager.extractStorageConfiguration(callContext, entity);
+        
BaseMetaStoreManager.extractStorageConfiguration(callContext.getDiagServices(), 
entity);
     return 
storageIntegrationProvider.getStorageIntegrationForConfig(storageConfig);
   }
 
diff --git 
a/polaris-core/src/main/java/org/apache/polaris/core/persistence/AtomicOperationMetaStoreManager.java
 
b/polaris-core/src/main/java/org/apache/polaris/core/persistence/AtomicOperationMetaStoreManager.java
index 52f1123b9..69e4cebc4 100644
--- 
a/polaris-core/src/main/java/org/apache/polaris/core/persistence/AtomicOperationMetaStoreManager.java
+++ 
b/polaris-core/src/main/java/org/apache/polaris/core/persistence/AtomicOperationMetaStoreManager.java
@@ -1608,7 +1608,8 @@ public class AtomicOperationMetaStoreManager extends 
BaseMetaStoreManager {
             entityId);
 
     PolarisStorageConfigurationInfo storageConfigurationInfo =
-        BaseMetaStoreManager.extractStorageConfiguration(callCtx, 
reloadedEntity.getEntity());
+        BaseMetaStoreManager.extractStorageConfiguration(
+            callCtx.getDiagServices(), reloadedEntity.getEntity());
     try {
       AccessConfig accessConfig =
           storageIntegration.getSubscopedCreds(
diff --git 
a/polaris-core/src/main/java/org/apache/polaris/core/persistence/BaseMetaStoreManager.java
 
b/polaris-core/src/main/java/org/apache/polaris/core/persistence/BaseMetaStoreManager.java
index f166102de..9820d8950 100644
--- 
a/polaris-core/src/main/java/org/apache/polaris/core/persistence/BaseMetaStoreManager.java
+++ 
b/polaris-core/src/main/java/org/apache/polaris/core/persistence/BaseMetaStoreManager.java
@@ -24,6 +24,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import jakarta.annotation.Nonnull;
 import java.util.Map;
 import org.apache.polaris.core.PolarisCallContext;
+import org.apache.polaris.core.PolarisDiagnostics;
 import org.apache.polaris.core.entity.PolarisBaseEntity;
 import org.apache.polaris.core.entity.PolarisEntityConstants;
 import org.apache.polaris.core.entity.PolarisEntitySubType;
@@ -37,20 +38,18 @@ public abstract class BaseMetaStoreManager implements 
PolarisMetaStoreManager {
   private static final ObjectMapper MAPPER = new ObjectMapper();
 
   public static PolarisStorageConfigurationInfo extractStorageConfiguration(
-      @Nonnull PolarisCallContext callCtx, PolarisBaseEntity reloadedEntity) {
+      @Nonnull PolarisDiagnostics diagnostics, PolarisBaseEntity 
reloadedEntity) {
     Map<String, String> propMap =
         
PolarisObjectMapperUtil.deserializeProperties(reloadedEntity.getInternalProperties());
     String storageConfigInfoStr =
         propMap.get(PolarisEntityConstants.getStorageConfigInfoPropertyName());
 
-    callCtx
-        .getDiagServices()
-        .check(
-            storageConfigInfoStr != null,
-            "missing_storage_configuration_info",
-            "catalogId={}, entityId={}",
-            reloadedEntity.getCatalogId(),
-            reloadedEntity.getId());
+    diagnostics.check(
+        storageConfigInfoStr != null,
+        "missing_storage_configuration_info",
+        "catalogId={}, entityId={}",
+        reloadedEntity.getCatalogId(),
+        reloadedEntity.getId());
     return PolarisStorageConfigurationInfo.deserialize(storageConfigInfoStr);
   }
 
diff --git 
a/polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/TransactionalMetaStoreManagerImpl.java
 
b/polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/TransactionalMetaStoreManagerImpl.java
index 6d39df148..836c51804 100644
--- 
a/polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/TransactionalMetaStoreManagerImpl.java
+++ 
b/polaris-core/src/main/java/org/apache/polaris/core/persistence/transactional/TransactionalMetaStoreManagerImpl.java
@@ -2055,7 +2055,8 @@ public class TransactionalMetaStoreManagerImpl extends 
BaseMetaStoreManager {
             entityId);
 
     PolarisStorageConfigurationInfo storageConfigurationInfo =
-        BaseMetaStoreManager.extractStorageConfiguration(callCtx, 
reloadedEntity.getEntity());
+        BaseMetaStoreManager.extractStorageConfiguration(
+            callCtx.getDiagServices(), reloadedEntity.getEntity());
     try {
       AccessConfig accessConfig =
           storageIntegration.getSubscopedCreds(
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 3bc7fd976..5ce0866c3 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
@@ -577,7 +577,7 @@ public class TreeMapTransactionalPersistenceImpl extends 
AbstractTransactionalPe
       PolarisStorageIntegration<T> loadPolarisStorageIntegrationInCurrentTxn(
           @Nonnull PolarisCallContext callCtx, @Nonnull PolarisBaseEntity 
entity) {
     PolarisStorageConfigurationInfo storageConfig =
-        BaseMetaStoreManager.extractStorageConfiguration(callCtx, entity);
+        
BaseMetaStoreManager.extractStorageConfiguration(callCtx.getDiagServices(), 
entity);
     return 
storageIntegrationProvider.getStorageIntegrationForConfig(storageConfig);
   }
 

Reply via email to