Skip to content

Commit 973fb62

Browse files
committed
Remove diagnostics from PolarisCallContext
1 parent 6863efb commit 973fb62

File tree

23 files changed

+25
-53
lines changed

23 files changed

+25
-53
lines changed

persistence/eclipselink/src/test/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreManagerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ protected PolarisTestMetaStoreManager createPolarisTestMetaStoreManager() {
8989
diagServices, store, Mockito.mock(), realmContext, null, "polaris", RANDOM_SECRETS);
9090
TransactionalMetaStoreManagerImpl metaStoreManager =
9191
new TransactionalMetaStoreManagerImpl(clock, diagServices);
92-
PolarisCallContext callCtx = new PolarisCallContext(realmContext, session, diagServices);
92+
PolarisCallContext callCtx = new PolarisCallContext(realmContext, session);
9393
return new PolarisTestMetaStoreManager(metaStoreManager, callCtx);
9494
}
9595

persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public Map<String, BaseResult> purgeRealms(Iterable<String> realms) {
178178
PolarisMetaStoreManager metaStoreManager = getOrCreateMetaStoreManager(realmContext);
179179
BasePersistence session = getOrCreateSession(realmContext);
180180

181-
PolarisCallContext callContext = new PolarisCallContext(realmContext, session, diagnostics);
181+
PolarisCallContext callContext = new PolarisCallContext(realmContext, session);
182182
BaseResult result = metaStoreManager.purge(callContext);
183183
results.put(realm, result);
184184

@@ -234,8 +234,7 @@ private PrincipalSecretsResult bootstrapServiceAndCreatePolarisPrincipalForRealm
234234
PolarisMetaStoreManager metaStoreManager =
235235
metaStoreManagerMap.get(realmContext.getRealmIdentifier());
236236
BasePersistence metaStore = sessionSupplierMap.get(realmContext.getRealmIdentifier()).get();
237-
PolarisCallContext polarisContext =
238-
new PolarisCallContext(realmContext, metaStore, diagnostics);
237+
PolarisCallContext polarisContext = new PolarisCallContext(realmContext, metaStore);
239238

240239
Optional<PrincipalEntity> preliminaryRootPrincipal =
241240
metaStoreManager.findRootPrincipal(polarisContext);
@@ -269,8 +268,7 @@ private void checkPolarisServiceBootstrappedForRealm(RealmContext realmContext)
269268
PolarisMetaStoreManager metaStoreManager =
270269
metaStoreManagerMap.get(realmContext.getRealmIdentifier());
271270
BasePersistence metaStore = sessionSupplierMap.get(realmContext.getRealmIdentifier()).get();
272-
PolarisCallContext polarisContext =
273-
new PolarisCallContext(realmContext, metaStore, diagnostics);
271+
PolarisCallContext polarisContext = new PolarisCallContext(realmContext, metaStore);
274272

275273
Optional<PrincipalEntity> rootPrincipal = metaStoreManager.findRootPrincipal(polarisContext);
276274
if (rootPrincipal.isEmpty()) {

persistence/relational-jdbc/src/test/java/org/apache/polaris/persistence/relational/jdbc/AtomicMetastoreManagerWithJdbcBasePersistenceImplTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ protected PolarisTestMetaStoreManager createPolarisTestMetaStoreManager() {
7272
schemaVersion);
7373
AtomicOperationMetaStoreManager metaStoreManager =
7474
new AtomicOperationMetaStoreManager(clock, diagServices);
75-
PolarisCallContext callCtx =
76-
new PolarisCallContext(realmContext, basePersistence, diagServices);
75+
PolarisCallContext callCtx = new PolarisCallContext(realmContext, basePersistence);
7776
return new PolarisTestMetaStoreManager(metaStoreManager, callCtx);
7877
}
7978

polaris-core/src/main/java/org/apache/polaris/core/PolarisCallContext.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,23 @@ public class PolarisCallContext implements CallContext {
3434

3535
// meta store which is used to persist Polaris entity metadata
3636
private final BasePersistence metaStore;
37-
private final PolarisDiagnostics diagServices;
3837
private final PolarisConfigurationStore configurationStore;
3938
private final RealmContext realmContext;
4039
private final RealmConfig realmConfig;
4140

4241
public PolarisCallContext(
4342
@Nonnull RealmContext realmContext,
4443
@Nonnull BasePersistence metaStore,
45-
@Nonnull PolarisDiagnostics diagServices,
4644
@Nonnull PolarisConfigurationStore configurationStore) {
4745
this.realmContext = realmContext;
4846
this.metaStore = metaStore;
49-
this.diagServices = diagServices;
5047
this.configurationStore = configurationStore;
5148
this.realmConfig = new RealmConfigImpl(this.configurationStore, this.realmContext);
5249
}
5350

5451
public PolarisCallContext(
55-
@Nonnull RealmContext realmContext,
56-
@Nonnull BasePersistence metaStore,
57-
@Nonnull PolarisDiagnostics diagServices) {
58-
this(realmContext, metaStore, diagServices, new PolarisConfigurationStore() {});
52+
@Nonnull RealmContext realmContext, @Nonnull BasePersistence metaStore) {
53+
this(realmContext, metaStore, new PolarisConfigurationStore() {});
5954
}
6055

6156
public BasePersistence getMetaStore() {
@@ -86,7 +81,6 @@ public PolarisCallContext copy() {
8681
// copy of the RealmContext to ensure the access during the task executor.
8782
String realmId = this.realmContext.getRealmIdentifier();
8883
RealmContext realmContext = () -> realmId;
89-
return new PolarisCallContext(
90-
realmContext, this.metaStore, this.diagServices, this.configurationStore);
84+
return new PolarisCallContext(realmContext, this.metaStore, this.configurationStore);
9185
}
9286
}

polaris-core/src/main/java/org/apache/polaris/core/persistence/LocalPolarisMetaStoreManagerFactory.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public Map<String, BaseResult> purgeRealms(Iterable<String> realms) {
131131
PolarisMetaStoreManager metaStoreManager = getOrCreateMetaStoreManager(realmContext);
132132
TransactionalPersistence session = getOrCreateSession(realmContext);
133133

134-
PolarisCallContext callContext = new PolarisCallContext(realmContext, session, diagnostics);
134+
PolarisCallContext callContext = new PolarisCallContext(realmContext, session);
135135
BaseResult result = metaStoreManager.purge(callContext);
136136
results.put(realm, result);
137137

@@ -186,8 +186,7 @@ private PrincipalSecretsResult bootstrapServiceAndCreatePolarisPrincipalForRealm
186186
PolarisMetaStoreManager metaStoreManager =
187187
metaStoreManagerMap.get(realmContext.getRealmIdentifier());
188188
BasePersistence metaStore = sessionSupplierMap.get(realmContext.getRealmIdentifier()).get();
189-
PolarisCallContext polarisContext =
190-
new PolarisCallContext(realmContext, metaStore, diagnostics);
189+
PolarisCallContext polarisContext = new PolarisCallContext(realmContext, metaStore);
191190

192191
Optional<PrincipalEntity> preliminaryRootPrincipal =
193192
metaStoreManager.findRootPrincipal(polarisContext);
@@ -221,8 +220,7 @@ private void checkPolarisServiceBootstrappedForRealm(RealmContext realmContext)
221220
PolarisMetaStoreManager metaStoreManager =
222221
metaStoreManagerMap.get(realmContext.getRealmIdentifier());
223222
BasePersistence metaStore = sessionSupplierMap.get(realmContext.getRealmIdentifier()).get();
224-
PolarisCallContext polarisContext =
225-
new PolarisCallContext(realmContext, metaStore, diagnostics);
223+
PolarisCallContext polarisContext = new PolarisCallContext(realmContext, metaStore);
226224

227225
Optional<PrincipalEntity> rootPrincipal = metaStoreManager.findRootPrincipal(polarisContext);
228226
if (rootPrincipal.isEmpty()) {

polaris-core/src/test/java/org/apache/polaris/core/persistence/PolarisTreeMapAtomicOperationMetaStoreManagerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public PolarisTestMetaStoreManager createPolarisTestMetaStoreManager() {
3838
diagServices, store, Mockito.mock(), RANDOM_SECRETS);
3939
AtomicOperationMetaStoreManager metaStoreManager =
4040
new AtomicOperationMetaStoreManager(clock, diagServices);
41-
PolarisCallContext callCtx = new PolarisCallContext(() -> "testRealm", metaStore, diagServices);
41+
PolarisCallContext callCtx = new PolarisCallContext(() -> "testRealm", metaStore);
4242
return new PolarisTestMetaStoreManager(metaStoreManager, callCtx);
4343
}
4444
}

polaris-core/src/test/java/org/apache/polaris/core/persistence/PolarisTreeMapMetaStoreManagerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public PolarisTestMetaStoreManager createPolarisTestMetaStoreManager() {
3838
diagServices, store, Mockito.mock(), RANDOM_SECRETS);
3939
TransactionalMetaStoreManagerImpl metaStoreManager =
4040
new TransactionalMetaStoreManagerImpl(clock, diagServices);
41-
PolarisCallContext callCtx = new PolarisCallContext(() -> "testRealm", metaStore, diagServices);
41+
PolarisCallContext callCtx = new PolarisCallContext(() -> "testRealm", metaStore);
4242
return new PolarisTestMetaStoreManager(metaStoreManager, callCtx);
4343
}
4444
}

polaris-core/src/test/java/org/apache/polaris/core/persistence/ResolverTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected PolarisCallContext callCtx() {
4141
TreeMapTransactionalPersistenceImpl metaStore =
4242
new TreeMapTransactionalPersistenceImpl(
4343
diagServices, store, Mockito.mock(), RANDOM_SECRETS);
44-
callCtx = new PolarisCallContext(() -> "testRealm", metaStore, diagServices);
44+
callCtx = new PolarisCallContext(() -> "testRealm", metaStore);
4545
}
4646
return callCtx;
4747
}

polaris-core/src/test/java/org/apache/polaris/core/persistence/cache/InMemoryEntityCacheTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public InMemoryEntityCacheTest() {
8282
new TreeMapTransactionalPersistenceImpl(
8383
diagServices, store, Mockito.mock(), RANDOM_SECRETS);
8484
metaStoreManager = new TransactionalMetaStoreManagerImpl(Clock.systemUTC(), diagServices);
85-
callCtx = new PolarisCallContext(() -> "testRealm", metaStore, diagServices);
85+
callCtx = new PolarisCallContext(() -> "testRealm", metaStore);
8686

8787
// bootstrap the meta store with our test schema
8888
tm = new PolarisTestMetaStoreManager(metaStoreManager, callCtx);

polaris-core/src/test/java/org/apache/polaris/core/storage/cache/StorageCredentialCacheTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public StorageCredentialCacheTest() {
6464
TransactionalPersistence metaStore =
6565
new TreeMapTransactionalPersistenceImpl(
6666
diagServices, store, Mockito.mock(), RANDOM_SECRETS);
67-
callCtx = new PolarisCallContext(() -> "testRealm", metaStore, diagServices);
67+
callCtx = new PolarisCallContext(() -> "testRealm", metaStore);
6868
storageCredentialCacheConfig = () -> 10_000;
6969
metaStoreManager = Mockito.mock(PolarisMetaStoreManager.class);
7070
storageCredentialCache = newStorageCredentialCache();

0 commit comments

Comments
 (0)