You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/05/11 23:23:16 UTC

[GitHub] [solr] laminelam commented on a diff in pull request #857: SOLR-16192: Add ZK credentials injectors support

laminelam commented on code in PR #857:
URL: https://github.com/apache/solr/pull/857#discussion_r870826325


##########
solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java:
##########
@@ -256,18 +265,43 @@ protected ZkACLProvider createZkACLProvider() {
     if (!StringUtils.isEmpty(zkACLProviderClassName)) {
       try {
         log.info("Using ZkACLProvider: {}", zkACLProviderClassName);
-        return (ZkACLProvider) Class.forName(zkACLProviderClassName).getConstructor().newInstance();
+        ZkACLProvider zkACLProvider =
+            (ZkACLProvider) Class.forName(zkACLProviderClassName).getConstructor().newInstance();
+        zkACLProvider.setZkCredentialsInjector(zkCredentialsInjector);
+        return zkACLProvider;
       } catch (Throwable t) {
         // just ignore - go default
         log.warn(
             "VM param zkACLProvider does not point to a class implementing ZkACLProvider and with a non-arg constructor",
             t);
       }
     }
-    log.debug("Using default ZkACLProvider");
+    log.warn("Using default ZkACLProvider");
     return new DefaultZkACLProvider();
   }
 
+  public static final String ZK_CREDENTIALS_INJECTOR_CLASS_NAME_VM_PARAM_NAME =

Review Comment:
   Followed the same existing logic as for _ZK_ACL_PROVIDER_CLASS_NAME_VM_PARAM_NAME_ and _ZK_CRED_PROVIDER_CLASS_NAME_VM_PARAM_NAME_.
   
   Plus, I like keeping instance variables used only once close to the code where they are used.



-- 
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: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org