dlmarion commented on code in PR #4851:
URL: https://github.com/apache/accumulo/pull/4851#discussion_r1742361256


##########
core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java:
##########
@@ -181,41 +184,90 @@ Map<String,String> 
modifyProperties(Consumer<Map<String,String>> mapMutator)
    *
    * @return a list of locations in <code>hostname:port</code> form.
    * @since 2.1.0
+   * @deprecated see {@link #getServers(ServerTypeName)}
    */
+  @Deprecated(since = "4.0.0")
   List<String> getManagerLocations();
 
   /**
    * Returns the locations of the active compactors
    *
    * @return A set of currently active compactors.
    * @since 2.1.4
+   * @deprecated see {@link #getServers(ServerTypeName)}
    */
+  @Deprecated(since = "4.0.0")
   Set<String> getCompactors();
 
   /**
    * Returns the locations of the active scan servers
    *
    * @return A set of currently active scan servers.
+   * @deprecated see {@link #getServers(ServerTypeName)}
    */
+  @Deprecated(since = "4.0.0")
   Set<String> getScanServers();
 
   /**
    * List the currently active tablet servers participating in the accumulo 
instance
    *
    * @return A list of currently active tablet servers.
+   * @deprecated see {@link #getServers(ServerTypeName)}
    */
+  @Deprecated(since = "4.0.0")
   List<String> getTabletServers();
 
+  /**
+   * Resolve the server of the given type and address to a ServerId
+   *
+   * @param type type of server
+   * @param host host name
+   * @param port host port
+   * @return ServerId if found, else null
+   * @since 4.0.0
+   */
+  ServerId getServer(ServerTypeName type, String host, int port);
+
+  /**
+   * Returns all servers of the given types
+   *
+   * @return set of servers of the supplied types matching the supplied test
+   * @since 4.0.0
+   */
+  Set<ServerId> getServers(ServerTypeName type);
+
+  /**
+   * Returns the servers of a given type that match the given criteria
+   *
+   * @return set of servers of the supplied types matching the supplied test
+   * @since 4.0.0
+   */
+  Set<ServerId> getServers(ServerTypeName type, Predicate<ServerId> test);

Review Comment:
   I think to do this efficiently, the resource group would need to be in the 
zookeeper path for all of the server processes (well, the ones that use them). 
Right now, the resource group is only in the path of the Compactor process. I 
saw your comment that you didn't look too deeply at the ServerIds class, but 
that would show you the different paths in use.
   
   We could modify the TabletServer and ScanServer zookeeper paths in a 
separate PR to align with the Compactor ZK path now that the group is 
mandatory. That would simplify the ServerIds class and allow for your 
suggestion to be implemented efficiently.



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