Skip to content

Commit 8e5e66d

Browse files
authored
Rename classes in transactional persistence package (#1197)
1 parent c731b27 commit 8e5e66d

File tree

11 files changed

+55
-54
lines changed

11 files changed

+55
-54
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
import org.apache.polaris.core.entity.PolarisPrincipalSecrets;
4343
import org.apache.polaris.core.persistence.BasePolarisMetaStoreManagerTest;
4444
import org.apache.polaris.core.persistence.PolarisTestMetaStoreManager;
45-
import org.apache.polaris.core.persistence.transactional.PolarisMetaStoreManagerImpl;
45+
import org.apache.polaris.core.persistence.transactional.TransactionalMetaStoreManagerImpl;
4646
import org.apache.polaris.jpa.models.ModelPrincipalSecrets;
4747
import org.junit.jupiter.api.AfterAll;
4848
import org.junit.jupiter.api.Assertions;
@@ -104,7 +104,7 @@ protected PolarisTestMetaStoreManager createPolarisTestMetaStoreManager() {
104104
new PolarisEclipseLinkMetaStoreSessionImpl(
105105
store, Mockito.mock(), () -> "realm", null, "polaris", RANDOM_SECRETS);
106106
return new PolarisTestMetaStoreManager(
107-
new PolarisMetaStoreManagerImpl(),
107+
new TransactionalMetaStoreManagerImpl(),
108108
new PolarisCallContext(
109109
session,
110110
diagServices,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import org.apache.polaris.core.persistence.dao.entity.BaseResult;
3939
import org.apache.polaris.core.persistence.dao.entity.EntityResult;
4040
import org.apache.polaris.core.persistence.dao.entity.PrincipalSecretsResult;
41-
import org.apache.polaris.core.persistence.transactional.PolarisMetaStoreManagerImpl;
41+
import org.apache.polaris.core.persistence.transactional.TransactionalMetaStoreManagerImpl;
4242
import org.apache.polaris.core.persistence.transactional.TransactionalPersistence;
4343
import org.apache.polaris.core.storage.cache.StorageCredentialCache;
4444
import org.slf4j.Logger;
@@ -92,7 +92,7 @@ protected PrincipalSecretsGenerator secretsGenerator(
9292
* into the existing realm-based setup flow.
9393
*/
9494
protected PolarisMetaStoreManager createNewMetaStoreManager() {
95-
return new PolarisMetaStoreManagerImpl();
95+
return new TransactionalMetaStoreManagerImpl();
9696
}
9797

9898
private void initializeForRealm(
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@
7474
* and retrieve all Polaris metadata
7575
*/
7676
@SuppressFBWarnings("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE")
77-
public class PolarisMetaStoreManagerImpl extends BaseMetaStoreManager {
78-
private static final Logger LOGGER = LoggerFactory.getLogger(PolarisMetaStoreManagerImpl.class);
77+
public class TransactionalMetaStoreManagerImpl extends BaseMetaStoreManager {
78+
private static final Logger LOGGER =
79+
LoggerFactory.getLogger(TransactionalMetaStoreManagerImpl.class);
7980

8081
/**
8182
* A version of BaseMetaStoreManager::persistNewEntity but instead of calling the one-shot
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import org.apache.polaris.core.entity.PolarisPrincipalSecrets;
3434

3535
/** Implements a simple in-memory store for Polaris, using tree-map */
36-
public class PolarisTreeMapStore {
36+
public class TreeMapMetaStore {
3737

3838
/** Slice of data, simple KV store. */
3939
public class Slice<T> {
@@ -68,7 +68,7 @@ public String buildKey(T value) {
6868
* @param key key for that value
6969
*/
7070
public T read(String key) {
71-
PolarisTreeMapStore.this.ensureReadTr();
71+
TreeMapMetaStore.this.ensureReadTr();
7272
T value = this.slice.getOrDefault(key, null);
7373
return (value != null) ? this.copyRecord.apply(value) : null;
7474
}
@@ -79,7 +79,7 @@ public T read(String key) {
7979
* @param prefix key prefix
8080
*/
8181
public List<T> readRange(String prefix) {
82-
PolarisTreeMapStore.this.ensureReadTr();
82+
TreeMapMetaStore.this.ensureReadTr();
8383
// end of the key
8484
String endKey =
8585
prefix.substring(0, prefix.length() - 1)
@@ -95,7 +95,7 @@ public List<T> readRange(String prefix) {
9595
* @param value value to write
9696
*/
9797
public void write(T value) {
98-
PolarisTreeMapStore.this.ensureReadWriteTr();
98+
TreeMapMetaStore.this.ensureReadWriteTr();
9999
T valueToWrite = (value != null) ? this.copyRecord.apply(value) : null;
100100
String key = this.buildKey(valueToWrite);
101101
// write undo if needs be
@@ -111,7 +111,7 @@ public void write(T value) {
111111
* @param key key for the record to remove
112112
*/
113113
public void delete(String key) {
114-
PolarisTreeMapStore.this.ensureReadWriteTr();
114+
TreeMapMetaStore.this.ensureReadWriteTr();
115115
if (slice.containsKey(key)) {
116116
// write undo if needs be
117117
if (!this.undoSlice.containsKey(key)) {
@@ -127,15 +127,15 @@ public void delete(String key) {
127127
* @param prefix key prefix for the record to remove
128128
*/
129129
public void deleteRange(String prefix) {
130-
PolarisTreeMapStore.this.ensureReadWriteTr();
130+
TreeMapMetaStore.this.ensureReadWriteTr();
131131
List<T> elements = this.readRange(prefix);
132132
for (T element : elements) {
133133
this.delete(element);
134134
}
135135
}
136136

137137
void deleteAll() {
138-
PolarisTreeMapStore.this.ensureReadWriteTr();
138+
TreeMapMetaStore.this.ensureReadWriteTr();
139139
slice.clear();
140140
undoSlice.clear();
141141
}
@@ -151,7 +151,7 @@ public void delete(T value) {
151151

152152
/** Rollback all changes made to this slice since transaction started */
153153
private void rollback() {
154-
PolarisTreeMapStore.this.ensureReadWriteTr();
154+
TreeMapMetaStore.this.ensureReadWriteTr();
155155
undoSlice.forEach(
156156
(key, value) -> {
157157
if (value == null) {
@@ -217,7 +217,7 @@ public boolean isWrite() {
217217
*
218218
* @param diagnostics diagnostic services
219219
*/
220-
public PolarisTreeMapStore(@Nonnull PolarisDiagnostics diagnostics) {
220+
public TreeMapMetaStore(@Nonnull PolarisDiagnostics diagnostics) {
221221

222222
// the entities slice
223223
this.sliceEntities =
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@
4242
import org.apache.polaris.core.storage.PolarisStorageIntegration;
4343
import org.apache.polaris.core.storage.PolarisStorageIntegrationProvider;
4444

45-
public class PolarisTreeMapMetaStoreSessionImpl extends AbstractTransactionalPersistence {
45+
public class TreeMapTransactionalPersistenceImpl extends AbstractTransactionalPersistence {
4646

4747
// the TreeMap store to use
48-
private final PolarisTreeMapStore store;
48+
private final TreeMapMetaStore store;
4949
private final PolarisStorageIntegrationProvider storageIntegrationProvider;
5050
private final PrincipalSecretsGenerator secretsGenerator;
5151

52-
public PolarisTreeMapMetaStoreSessionImpl(
53-
@Nonnull PolarisTreeMapStore store,
52+
public TreeMapTransactionalPersistenceImpl(
53+
@Nonnull TreeMapMetaStore store,
5454
@Nonnull PolarisStorageIntegrationProvider storageIntegrationProvider,
5555
@Nonnull PrincipalSecretsGenerator secretsGenerator) {
5656

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
import org.apache.polaris.core.persistence.cache.EntityCache;
3434
import org.apache.polaris.core.persistence.cache.EntityCacheByNameKey;
3535
import org.apache.polaris.core.persistence.cache.EntityCacheLookupResult;
36-
import org.apache.polaris.core.persistence.transactional.PolarisMetaStoreManagerImpl;
37-
import org.apache.polaris.core.persistence.transactional.PolarisTreeMapMetaStoreSessionImpl;
38-
import org.apache.polaris.core.persistence.transactional.PolarisTreeMapStore;
36+
import org.apache.polaris.core.persistence.transactional.TransactionalMetaStoreManagerImpl;
3937
import org.apache.polaris.core.persistence.transactional.TransactionalPersistence;
38+
import org.apache.polaris.core.persistence.transactional.TreeMapMetaStore;
39+
import org.apache.polaris.core.persistence.transactional.TreeMapTransactionalPersistenceImpl;
4040
import org.assertj.core.api.Assertions;
4141
import org.junit.jupiter.api.Test;
4242
import org.mockito.Mockito;
@@ -48,7 +48,7 @@ public class EntityCacheTest {
4848
private final PolarisDiagnostics diagServices;
4949

5050
// the entity store, use treemap implementation
51-
private final PolarisTreeMapStore store;
51+
private final TreeMapMetaStore store;
5252

5353
// to interact with the metastore
5454
private final TransactionalPersistence metaStore;
@@ -86,10 +86,10 @@ public class EntityCacheTest {
8686
*/
8787
public EntityCacheTest() {
8888
diagServices = new PolarisDefaultDiagServiceImpl();
89-
store = new PolarisTreeMapStore(diagServices);
90-
metaStore = new PolarisTreeMapMetaStoreSessionImpl(store, Mockito.mock(), RANDOM_SECRETS);
89+
store = new TreeMapMetaStore(diagServices);
90+
metaStore = new TreeMapTransactionalPersistenceImpl(store, Mockito.mock(), RANDOM_SECRETS);
9191
callCtx = new PolarisCallContext(metaStore, diagServices);
92-
metaStoreManager = new PolarisMetaStoreManagerImpl();
92+
metaStoreManager = new TransactionalMetaStoreManagerImpl();
9393

9494
// bootstrap the mata store with our test schema
9595
tm = new PolarisTestMetaStoreManager(metaStoreManager, callCtx);

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@
2525
import org.apache.polaris.core.PolarisDefaultDiagServiceImpl;
2626
import org.apache.polaris.core.PolarisDiagnostics;
2727
import org.apache.polaris.core.config.PolarisConfigurationStore;
28-
import org.apache.polaris.core.persistence.transactional.PolarisTreeMapMetaStoreSessionImpl;
29-
import org.apache.polaris.core.persistence.transactional.PolarisTreeMapStore;
28+
import org.apache.polaris.core.persistence.transactional.TreeMapMetaStore;
29+
import org.apache.polaris.core.persistence.transactional.TreeMapTransactionalPersistenceImpl;
3030
import org.mockito.Mockito;
3131

3232
public class PolarisTreeMapAtomicOperationMetaStoreManagerTest
3333
extends BasePolarisMetaStoreManagerTest {
3434
@Override
3535
public PolarisTestMetaStoreManager createPolarisTestMetaStoreManager() {
3636
PolarisDiagnostics diagServices = new PolarisDefaultDiagServiceImpl();
37-
PolarisTreeMapStore store = new PolarisTreeMapStore(diagServices);
37+
TreeMapMetaStore store = new TreeMapMetaStore(diagServices);
3838
PolarisCallContext callCtx =
3939
new PolarisCallContext(
40-
new PolarisTreeMapMetaStoreSessionImpl(store, Mockito.mock(), RANDOM_SECRETS),
40+
new TreeMapTransactionalPersistenceImpl(store, Mockito.mock(), RANDOM_SECRETS),
4141
diagServices,
4242
new PolarisConfigurationStore() {},
4343
timeSource.withZone(ZoneId.systemDefault()));

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@
2525
import org.apache.polaris.core.PolarisDefaultDiagServiceImpl;
2626
import org.apache.polaris.core.PolarisDiagnostics;
2727
import org.apache.polaris.core.config.PolarisConfigurationStore;
28-
import org.apache.polaris.core.persistence.transactional.PolarisMetaStoreManagerImpl;
29-
import org.apache.polaris.core.persistence.transactional.PolarisTreeMapMetaStoreSessionImpl;
30-
import org.apache.polaris.core.persistence.transactional.PolarisTreeMapStore;
28+
import org.apache.polaris.core.persistence.transactional.TransactionalMetaStoreManagerImpl;
29+
import org.apache.polaris.core.persistence.transactional.TreeMapMetaStore;
30+
import org.apache.polaris.core.persistence.transactional.TreeMapTransactionalPersistenceImpl;
3131
import org.mockito.Mockito;
3232

3333
public class PolarisTreeMapMetaStoreManagerTest extends BasePolarisMetaStoreManagerTest {
3434
@Override
3535
public PolarisTestMetaStoreManager createPolarisTestMetaStoreManager() {
3636
PolarisDiagnostics diagServices = new PolarisDefaultDiagServiceImpl();
37-
PolarisTreeMapStore store = new PolarisTreeMapStore(diagServices);
37+
TreeMapMetaStore store = new TreeMapMetaStore(diagServices);
3838
PolarisCallContext callCtx =
3939
new PolarisCallContext(
40-
new PolarisTreeMapMetaStoreSessionImpl(store, Mockito.mock(), RANDOM_SECRETS),
40+
new TreeMapTransactionalPersistenceImpl(store, Mockito.mock(), RANDOM_SECRETS),
4141
diagServices,
4242
new PolarisConfigurationStore() {},
4343
timeSource.withZone(ZoneId.systemDefault()));
4444

45-
return new PolarisTestMetaStoreManager(new PolarisMetaStoreManagerImpl(), callCtx);
45+
return new PolarisTestMetaStoreManager(new TransactionalMetaStoreManagerImpl(), callCtx);
4646
}
4747
}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@
5050
import org.apache.polaris.core.persistence.resolver.Resolver;
5151
import org.apache.polaris.core.persistence.resolver.ResolverPath;
5252
import org.apache.polaris.core.persistence.resolver.ResolverStatus;
53-
import org.apache.polaris.core.persistence.transactional.PolarisMetaStoreManagerImpl;
54-
import org.apache.polaris.core.persistence.transactional.PolarisTreeMapMetaStoreSessionImpl;
55-
import org.apache.polaris.core.persistence.transactional.PolarisTreeMapStore;
53+
import org.apache.polaris.core.persistence.transactional.TransactionalMetaStoreManagerImpl;
5654
import org.apache.polaris.core.persistence.transactional.TransactionalPersistence;
55+
import org.apache.polaris.core.persistence.transactional.TreeMapMetaStore;
56+
import org.apache.polaris.core.persistence.transactional.TreeMapTransactionalPersistenceImpl;
5757
import org.assertj.core.api.Assertions;
5858
import org.junit.jupiter.params.ParameterizedTest;
5959
import org.junit.jupiter.params.provider.ValueSource;
@@ -65,7 +65,7 @@ public class ResolverTest {
6565
private final PolarisDiagnostics diagServices;
6666

6767
// the entity store, use treemap implementation
68-
private final PolarisTreeMapStore store;
68+
private final TreeMapMetaStore store;
6969

7070
// to interact with the metastore
7171
private final TransactionalPersistence metaStore;
@@ -118,10 +118,10 @@ public class ResolverTest {
118118
*/
119119
public ResolverTest() {
120120
diagServices = new PolarisDefaultDiagServiceImpl();
121-
store = new PolarisTreeMapStore(diagServices);
122-
metaStore = new PolarisTreeMapMetaStoreSessionImpl(store, Mockito.mock(), RANDOM_SECRETS);
121+
store = new TreeMapMetaStore(diagServices);
122+
metaStore = new TreeMapTransactionalPersistenceImpl(store, Mockito.mock(), RANDOM_SECRETS);
123123
callCtx = new PolarisCallContext(metaStore, diagServices);
124-
metaStoreManager = new PolarisMetaStoreManagerImpl();
124+
metaStoreManager = new TransactionalMetaStoreManagerImpl();
125125

126126
// bootstrap the mata store with our test schema
127127
tm = new PolarisTestMetaStoreManager(metaStoreManager, callCtx);

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
import org.apache.polaris.core.persistence.PolarisObjectMapperUtil;
4242
import org.apache.polaris.core.persistence.dao.entity.BaseResult;
4343
import org.apache.polaris.core.persistence.dao.entity.ScopedCredentialsResult;
44-
import org.apache.polaris.core.persistence.transactional.PolarisTreeMapMetaStoreSessionImpl;
45-
import org.apache.polaris.core.persistence.transactional.PolarisTreeMapStore;
4644
import org.apache.polaris.core.persistence.transactional.TransactionalPersistence;
45+
import org.apache.polaris.core.persistence.transactional.TreeMapMetaStore;
46+
import org.apache.polaris.core.persistence.transactional.TreeMapTransactionalPersistenceImpl;
4747
import org.apache.polaris.core.storage.PolarisCredentialProperty;
4848
import org.assertj.core.api.Assertions;
4949
import org.junit.jupiter.api.RepeatedTest;
@@ -64,10 +64,10 @@ public StorageCredentialCacheTest() {
6464
// diag services
6565
PolarisDiagnostics diagServices = new PolarisDefaultDiagServiceImpl();
6666
// the entity store, use treemap implementation
67-
PolarisTreeMapStore store = new PolarisTreeMapStore(diagServices);
67+
TreeMapMetaStore store = new TreeMapMetaStore(diagServices);
6868
// to interact with the metastore
6969
TransactionalPersistence metaStore =
70-
new PolarisTreeMapMetaStoreSessionImpl(store, Mockito.mock(), RANDOM_SECRETS);
70+
new TreeMapTransactionalPersistenceImpl(store, Mockito.mock(), RANDOM_SECRETS);
7171
callCtx = new PolarisCallContext(metaStore, diagServices);
7272
metaStoreManager = Mockito.mock(PolarisMetaStoreManager.class);
7373
storageCredentialCache = new StorageCredentialCache();

0 commit comments

Comments
 (0)