Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,9 @@ public class JdbcMetaStoreManagerFactory implements MetaStoreManagerFactory {
protected JdbcMetaStoreManagerFactory() {}

protected PrincipalSecretsGenerator secretsGenerator(
RealmContext realmContext, @Nullable RootCredentialsSet rootCredentialsSet) {
String realmId, @Nullable RootCredentialsSet rootCredentialsSet) {
if (rootCredentialsSet != null) {
return PrincipalSecretsGenerator.bootstrap(
realmContext.getRealmIdentifier(), rootCredentialsSet);
return PrincipalSecretsGenerator.bootstrap(realmId, rootCredentialsSet);
} else {
return PrincipalSecretsGenerator.RANDOM_SECRETS;
}
Expand All @@ -100,17 +99,20 @@ private void initializeForRealm(
DatasourceOperations datasourceOperations,
RealmContext realmContext,
RootCredentialsSet rootCredentialsSet) {
// Materialize realmId so that background tasks that don't have an active
// RealmContext (request-scoped bean) can still create a JdbcBasePersistenceImpl
String realmId = realmContext.getRealmIdentifier();
sessionSupplierMap.put(
realmContext.getRealmIdentifier(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I do not really see any major runtime difference before/after this change. Could you add comments or clarify what the change is supposed to do in the PR description? It has a link to another PR, but the linked page has a rather long discussion thread... It would be nice to describe specifically what this PR fixes, please.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added more details to the PR description and added a comment as well!

realmId,
() ->
new JdbcBasePersistenceImpl(
datasourceOperations,
secretsGenerator(realmContext, rootCredentialsSet),
secretsGenerator(realmId, rootCredentialsSet),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding a comment for this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added!

storageIntegrationProvider,
realmContext.getRealmIdentifier()));
realmId));

PolarisMetaStoreManager metaStoreManager = createNewMetaStoreManager();
metaStoreManagerMap.put(realmContext.getRealmIdentifier(), metaStoreManager);
metaStoreManagerMap.put(realmId, metaStoreManager);
}

public DatasourceOperations getDatasourceOperations() {
Expand Down
Loading