janhoy commented on code in PR #5063:
URL: https://github.com/apache/solr/pull/5063#discussion_r4224530269
##########
solr/core/src/java/org/apache/solr/cli/ConnectionOptions.java:
##########
@@ -17,141 +17,259 @@
package org.apache.solr.cli;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
import java.util.Map;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.impl.CloudSolrClient;
-import org.apache.solr.common.util.EnvUtils;
import picocli.CommandLine;
/**
- * Picocli ArgGroup for mutually-exclusive Solr URL / ZooKeeper connection
options.
+ * The {@code --solr-connection}, {@code --zk-host} and {@code --solr-url}
options shared by every
+ * picocli command that talks to Solr; add it to a command with {@code
@CommandLine.Mixin}.
*
- * <p>Use as the type of an {@code @ArgGroup(exclusive = true, multiplicity =
"0..1")} field to
- * ensure the user provides at most one of {@code --solr-connection}, {@code
--solr-url} or {@code
- * --zk-host}.
+ * <p>Options not given on the command line are filled from {@code
SOLR_CONNECTION}, {@code ZK_HOST}
+ * and {@code SOLR_URL} by {@link CliDefaultValueProvider}. The resolvers
prefer an option passed
+ * explicitly over those environment values, and reject more than one
explicitly passed option, so
+ * {@code ZK_HOST=... bin/solr create --solr-url ...} targets the URL while
{@code --zk-host a
+ * --solr-url b} is an error.
*/
-class ConnectionOptions {
+public class ConnectionOptions {
Review Comment:
This is perhaps the most important class in this PR. Read the class javadoc
and understand what it does.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]