adutra commented on code in PR #889:
URL: https://github.com/apache/polaris/pull/889#discussion_r1931241311


##########
service/common/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java:
##########
@@ -95,25 +95,25 @@ public synchronized PolarisMetaStoreManager 
getOrCreateMetaStoreManager(RealmId
   public synchronized Supplier<PolarisMetaStoreSession> 
getOrCreateSessionSupplier(
       RealmId realmId) {
     if (!bootstrappedRealms.contains(realmId.id())) {
-      bootstrapRealmsAndPrintCredentials(List.of(realmId.id()));
+      bootstrapRealmsAndPrintCredentials(List.of(realmId));
     }
     return super.getOrCreateSessionSupplier(realmId);
   }
 
-  private void bootstrapRealmsAndPrintCredentials(List<String> realms) {
+  private void bootstrapRealmsAndPrintCredentials(List<RealmId> realms) {
     PolarisCredentialsBootstrap credentialsBootstrap =
         PolarisCredentialsBootstrap.fromEnvironment();
-    Map<String, PrincipalSecretsResult> results =
+    Map<RealmId, PrincipalSecretsResult> results =
         this.bootstrapRealms(realms, credentialsBootstrap);
-    bootstrappedRealms.addAll(realms);
 
-    for (String realmId : realms) {
-      PrincipalSecretsResult principalSecrets = results.get(realmId);
+    for (RealmId realm : results.keySet()) {
+      bootstrappedRealms.add(realm.id());

Review Comment:
   See my previous comment: CDI beans as map keys or set elements would have 
surprising effects here, notably containsKey() and addAll() wouldn't work as 
expected. We would need to copy the RealmId each time to be sure. In the end I 
think it's not worth it since these maps and collections are not public. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to