You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/07/25 11:14:52 UTC

[GitHub] [ozone] adoroszlai commented on a diff in pull request #3366: HDDS-6453. Ozone start/stop script cannot resolve OM nodes in HA

adoroszlai commented on code in PR #3366:
URL: https://github.com/apache/ozone/pull/3366#discussion_r928763096


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java:
##########
@@ -113,9 +113,10 @@ public static InetSocketAddress getOmAddress(ConfigurationSource conf) {
    * @param conf {@link ConfigurationSource}
    * @return {service.id -> [{@link InetSocketAddress}]}
    */
-  public static Map<String, List<InetSocketAddress>> getOmHAAddressesById(
+  public static Collection<InetSocketAddress> getOmHAAddressesById(

Review Comment:
   We would like to add structured output later (item 3 from the Jira issue).  So please keep `getOmHAAddressesById()` (and `testGetOmHAAddressesById()`) unchanged, and add a new method that flattens the map to a list.
   
   One way to implement that, but you can also use loops:
   
   ```java
     public static Collection<InetSocketAddress> getOmAddresses(
         ConfigurationSource conf) {
       return getOmHAAddressesById(conf).values().stream()
           .flatMap(Collection::stream)
           .collect(toList());
     }
   ```
   
   This should be called from `OzoneManagersCommandHandler`, and a new test method in `TestOmUtils`.



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org