-
Notifications
You must be signed in to change notification settings - Fork 367
feat(persistence): Add JDBC persistence layer for Iceberg metrics reporting (#3337) #3385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
af07d42
bceb136
01d8e93
59c907f
9ec22ea
b66a0d6
7ac814e
4a3bc9f
7d4212c
9ac1f46
de341e6
9260dda
472f6f3
b7925c8
6d5f2aa
850b3d1
58563e0
86fe3d7
0a0ffdc
3507365
f73903a
5785fad
b86f670
1488c35
17456d6
95d5e2f
3c17861
e685f40
bf934a0
266fa7e
da125d8
f57ad41
df0d46f
7715acf
e857bbe
efe31c2
1de8bd4
53145ea
2be4d9d
a6a67f0
fd45762
3e4b300
a438cd7
a2c9f5e
c571d29
113aae2
516af0a
f7e5e45
d6b4734
ba3668b
65e8cb4
fe2a7ed
3eb9912
f84d2b5
41bb810
5d831cd
2f46564
4dece9e
68fed86
eabdd15
86789d7
714b614
4d0d395
ebb5bc8
b2396da
2328824
c23b162
4e1a2a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,6 +52,7 @@ | |
| import org.apache.polaris.core.persistence.cache.InMemoryEntityCache; | ||
| import org.apache.polaris.core.persistence.dao.entity.BaseResult; | ||
| import org.apache.polaris.core.persistence.dao.entity.PrincipalSecretsResult; | ||
| import org.apache.polaris.core.persistence.metrics.MetricsSchemaBootstrap; | ||
| import org.apache.polaris.core.storage.PolarisStorageIntegrationProvider; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
@@ -78,6 +79,10 @@ public class JdbcMetaStoreManagerFactory implements MetaStoreManagerFactory { | |
| @Inject RelationalJdbcConfiguration relationalJdbcConfiguration; | ||
| @Inject RealmConfig realmConfig; | ||
|
|
||
| @Inject | ||
| @Identifier("relational-jdbc") | ||
| MetricsSchemaBootstrap metricsSchemaBootstrap; | ||
|
|
||
| protected JdbcMetaStoreManagerFactory() {} | ||
|
|
||
| protected PrincipalSecretsGenerator secretsGenerator( | ||
|
|
@@ -172,6 +177,11 @@ public synchronized Map<String, PrincipalSecretsResult> bootstrapRealms( | |
| datasourceOperations | ||
| .getDatabaseType() | ||
| .openInitScriptResource(effectiveSchemaVersion)); | ||
|
|
||
| // Run the metrics schema bootstrap if requested | ||
| if (JdbcBootstrapUtils.shouldIncludeMetrics(bootstrapOptions)) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to sync up and not forget: I believe it would be nice to have a separate bootstrap handler for the metrics schema, but that can be done as a follow-up PR.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Implemented in commit Also added a new This enables adding metrics persistence support to existing deployments without re-bootstrapping the entity schema. |
||
| metricsSchemaBootstrap.bootstrap(realm); | ||
| } | ||
| } catch (SQLException e) { | ||
| throw new RuntimeException( | ||
| String.format("Error executing sql script: %s", e.getMessage()), e); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.