Commit 25509f2
authored
Core persistence refactor phase 1 - extract BasePersistence and BaseMetaStoreManager to isolate all "transaction" behaviors (#1070)
* Restructure persistence class hierarchy and remove vestigial interfaces
Extract a basic abstract base class BaseMetaStoreManager which can
hold shared logic between implementations of PolarisMetaStoreManager
* Remove all "entitiesDropped" members; these were vestigial from trying to implement UNDROP
but for now are entirely unused. We can reintroduce it with a better design against multiple
backends when/if we want to implement UNDROP.
* Extract BasePersistence interface as parent interface of PolarisMetaStoreSession;
only leave the transaction-specific methods in PolarisMetaStoreSession
* Push all evidence of the two-phase lookupEntityByName into only the transactional-style
PolarisMetaStoreSession, so that BasePersistence properly exposes a lookupEntityByName
method where impls that use secondary indexes can easily just lookup an entity by name
instead of doing two lookups.
* Turn PolarisMetaStoreSession into an abstract class and make lookupEntityActive
protected-visibility; remove all callsites where PolarisMetaStoreManagerImpl
calls it. Technically, while in the same package this doesn't prevent
it from leaking, but we could reposition PolarisMetaStoreSession into
a separate transaction-specific package to help protect it from leaking
the lower-level abstractions.
* Pushdown all calls to writeToEntities into PolarisMetaStoreSession, and add
writeEntity method to BasePersistence, with a default impl in PolarisMetaStoreSession
containing what was previously in PolarisMetaStoreManagerImpl. This now protects
all writes in PolarisMetaStoreManagerImpl from dealing with the three-table
implementation detail. Technically slightly changes the ordering of updates
within a transaction for renameEntity, but is arguably a more correct ordering,
and the ordering doesn't interleave reads anyways.
* Add originalEntity to the writeEntity method to enable compare-and-swap behavior
from the underlying BasePersistence.
Pushdown all the deleteFromEntities* methods into PolarisMetaStoreSession and
add deleteEntity to BasePersistence which encapsulates handling the separate slices.
* Break out external-integration related methods from BasePersistence into a new
IntegrationPersistence interface; these methods encapsulate certain type-specific
behaviors that are indirectly tied to persistence entities, such as principal
secrets, storage integrations, etc.
* Improve javadoc comments, rename PolarisEntityActiveRecord to EntityNameLookupRecord,
remove unused method
* Rename PolarisMetaStoreSession to TransactionalPersistence and move into a new package "transactional".
* Also move the PolarisTreeMap* classes into the transactional package
* Move PolarisMetaStoreManagerImpl into the "transactional" package per PR suggestion1 parent 09ee269 commit 25509f2
File tree
38 files changed
+1120
-1223
lines changed- extension/persistence
- eclipselink/src
- main/java/org/apache/polaris/extension/persistence/impl/eclipselink
- test/java/org/apache/polaris/extension/persistence/impl/eclipselink
- jpa-model/src/main/java/org/apache/polaris/jpa/models
- polaris-core/src
- main/java/org/apache/polaris/core
- entity
- persistence
- transactional
- testFixtures/java/org/apache/polaris/core/persistence
- test/java/org/apache/polaris/core
- persistence
- storage/cache
- quarkus/service/src
- main/java/org/apache/polaris/service/quarkus/config
- test/java/org/apache/polaris/service/quarkus
- admin
- catalog
- task
- test
- service/common/src
- main/java/org/apache/polaris/service
- catalog
- io
- context
- persistence
- testFixtures/java/org/apache/polaris/service
38 files changed
+1120
-1223
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
Lines changed: 13 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
| 52 | + | |
54 | 53 | | |
55 | 54 | | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | 274 | | |
283 | 275 | | |
284 | 276 | | |
| |||
312 | 304 | | |
313 | 305 | | |
314 | 306 | | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | 307 | | |
324 | 308 | | |
325 | 309 | | |
| |||
371 | 355 | | |
372 | 356 | | |
373 | 357 | | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | 358 | | |
383 | 359 | | |
384 | 360 | | |
| |||
404 | 380 | | |
405 | 381 | | |
406 | 382 | | |
407 | | - | |
| 383 | + | |
408 | 384 | | |
409 | 385 | | |
410 | 386 | | |
| |||
414 | 390 | | |
415 | 391 | | |
416 | 392 | | |
417 | | - | |
| 393 | + | |
418 | 394 | | |
419 | 395 | | |
420 | 396 | | |
| |||
425 | 401 | | |
426 | 402 | | |
427 | 403 | | |
428 | | - | |
| 404 | + | |
429 | 405 | | |
430 | 406 | | |
431 | 407 | | |
432 | 408 | | |
433 | | - | |
| 409 | + | |
434 | 410 | | |
435 | 411 | | |
436 | 412 | | |
437 | | - | |
| 413 | + | |
438 | 414 | | |
439 | 415 | | |
440 | 416 | | |
441 | 417 | | |
442 | 418 | | |
443 | 419 | | |
444 | | - | |
| 420 | + | |
445 | 421 | | |
446 | 422 | | |
447 | 423 | | |
448 | 424 | | |
449 | 425 | | |
450 | 426 | | |
451 | 427 | | |
452 | | - | |
| 428 | + | |
453 | 429 | | |
454 | 430 | | |
455 | 431 | | |
| |||
459 | 435 | | |
460 | 436 | | |
461 | 437 | | |
462 | | - | |
| 438 | + | |
463 | 439 | | |
464 | 440 | | |
465 | 441 | | |
| |||
674 | 650 | | |
675 | 651 | | |
676 | 652 | | |
677 | | - | |
| 653 | + | |
678 | 654 | | |
679 | 655 | | |
680 | 656 | | |
| |||
Lines changed: 2 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| |||
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 102 | + | |
115 | 103 | | |
116 | 104 | | |
117 | 105 | | |
| |||
158 | 146 | | |
159 | 147 | | |
160 | 148 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | 149 | | |
172 | 150 | | |
173 | 151 | | |
| |||
216 | 194 | | |
217 | 195 | | |
218 | 196 | | |
219 | | - | |
220 | 197 | | |
221 | 198 | | |
222 | 199 | | |
| |||
319 | 296 | | |
320 | 297 | | |
321 | 298 | | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | 299 | | |
338 | 300 | | |
339 | 301 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | 44 | | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
extension/persistence/jpa-model/src/main/java/org/apache/polaris/jpa/models/ModelEntityActive.java
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
0 commit comments