ctubbsii commented on a change in pull request #1803:
URL: https://github.com/apache/accumulo/pull/1803#discussion_r567992140



##########
File path: 
server/manager/src/main/java/org/apache/accumulo/master/recovery/RecoveryManager.java
##########
@@ -148,6 +149,18 @@ private boolean exists(final Path path) throws IOException 
{
     }
   }
 
+  public String getHostPort() {
+
+    String hostPort = "";
+    Set<TServerInstance> tserverInstances = master.onlineTabletServers();
+
+    if (tserverInstances.isEmpty() && tserverInstances.size() < 0) {
+      return hostPort = null;
+
+    } else
+      return hostPort = tserverInstances.stream().findFirst().get().toString();
+  }
+

Review comment:
       Size can't be less than 0.
   
   ```suggestion
     public String getHostPort() {
       Set<TServerInstance> tserverInstances = master.onlineTabletServers();
       return tserverInstances.isEmpty() ? null : 
tserverInstances.stream().findFirst().get().toString();
     }
   
   ```
   
   However, this won't work either, because this doesn't return the current 
tserver's host and port, it returns whichever the master.onlineTabletServers() 
returns first.




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

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


Reply via email to