ctubbsii commented on code in PR #5599:
URL: https://github.com/apache/accumulo/pull/5599#discussion_r2133306634


##########
server/base/src/main/java/org/apache/accumulo/server/AbstractServer.java:
##########
@@ -65,8 +64,30 @@ protected AbstractServer(String appName, ServerOpts opts, 
String[] args) {
     this.log = LoggerFactory.getLogger(getClass().getName());
     this.applicationName = appName;
     opts.parseArgs(appName, args);
-    this.hostname = Objects.requireNonNull(opts.getAddress());
     var siteConfig = opts.getSiteConfiguration();
+    boolean oldBindParameterSpecifiedOnCmdLine = false;
+    boolean newBindParmeterSpecifiedOnCmdLine = false;
+    for (String arg : args) {
+      if (arg.equals("-a") || arg.equals("--address")) {
+        oldBindParameterSpecifiedOnCmdLine = true;
+      } else if (arg.startsWith(Property.RPC_PROCESS_BIND_ADDRESS.getKey() + 
"=")) {
+        newBindParmeterSpecifiedOnCmdLine = true;

Review Comment:
   It's not just if the option was specified on the command-line... it's a 
problem if they are being mixed if the parameter is present in the 
SiteConfiguration, whether or not it was added on the command-line or present 
in the config file.
   
   For example, consider the case where the user specifies:
   `-a <address> 
-Daccumulo.properties=file://path/to/config/with/rpc.bind.addr/config.properties`.
 There's still a conflict in this case, in a way that makes it wholly unclear 
what the user's intention was.
   
   But, we already have `isPropertySet` we can use to check if it was set on 
the SiteConfiguration by either mechanism. So, this only needs to handle 
detection of whether the old method was used on the command line (which is the 
only place it can be used). For the rpc.bind.addr property, you can continue to 
use `SiteConfiguration.isPropertySet`, as before.



-- 
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: notifications-unsubscr...@accumulo.apache.org

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

Reply via email to