ddanielr commented on code in PR #5633:
URL: https://github.com/apache/accumulo/pull/5633#discussion_r2143562557


##########
minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterControl.java:
##########
@@ -197,9 +197,14 @@ public synchronized void start(ServerType server, String 
hostname) throws IOExce
     start(server, Collections.emptyMap(), Integer.MAX_VALUE);
   }
 
-  @SuppressWarnings(value = {"removal", "unchecked"})
   public synchronized void start(ServerType server, Map<String,String> 
configOverrides, int limit)
       throws IOException {
+    start(server, configOverrides, limit, new String[] {});
+  }
+
+  @SuppressWarnings(value = {"removal"})

Review Comment:
   ```suggestion
     @SuppressWarnings("removal")
   ```
   Match the format of the other suppress annotations uses.



##########
server/monitor/src/main/java/org/apache/accumulo/monitor/EmbeddedWebServer.java:
##########
@@ -51,7 +51,7 @@ public EmbeddedWebServer(Monitor monitor, int port) {
     secure = requireForSecure.stream().map(conf::get).allMatch(s -> s != null 
&& !s.isEmpty());
 
     connector = new ServerConnector(server, getConnectionFactories(conf, 
secure));
-    connector.setHost(monitor.getHostname());
+    connector.setHost(monitor.getAdvertiseAddress().getHost());

Review Comment:
   EmbeddedWebServer is called at the beginning of the run method for the 
Monitor so
   `monitor.getAdvertiseAddress()` will always return null and the 
EmbeddedWebServer will fail to start.
   
   The same hostname lookup logic from the monitor could be added here: 
   ```suggestion
       String hostName = "";
       if (monitor.getAdvertiseAddress() == null) {
         try {
            hostName = InetAddress.getLocalHost().getHostName();
         } catch (UnknownHostException e) {
           LOG.error("Unable to get hostname", e);
         }
       } else {
         hostName = monitor.getAdvertiseAddress().getHost();
       }
       connector.setHost(hostName);
   ```



-- 
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