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 2021/08/23 22:06:27 UTC

[GitHub] [ozone] hanishakoneru commented on a change in pull request #2491: HDDS-5534. Verify config is updated on all OMs before proceeding with Bootstrap

hanishakoneru commented on a change in pull request #2491:
URL: https://github.com/apache/ozone/pull/2491#discussion_r694340949



##########
File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OMNodeDetails.java
##########
@@ -164,39 +166,80 @@ public String getOMDBCheckpointEnpointUrl(boolean isHttpPolicy) {
     return null;
   }
 
+  public String getOMPrintInfo() {
+    return getNodeId() + ":" + getHostAddress();
+  }
+
   public static OMNodeDetails getOMNodeDetailsFromConf(OzoneConfiguration conf,
       String omServiceId, String omNodeId) {
+    return getOMNodeDetailsFromConf(conf, omServiceId, omNodeId, true);
+  }
+
+  public static OMNodeDetails getOMNodeDetailsFromConf(OzoneConfiguration conf,
+      String omServiceId, String omNodeId, boolean shouldResolveAddr) {
+
     String rpcAddrKey = ConfUtils.addKeySuffixes(OZONE_OM_ADDRESS_KEY,
         omServiceId, omNodeId);
     String rpcAddrStr = OmUtils.getOmRpcAddress(conf, rpcAddrKey);
     if (rpcAddrStr == null || rpcAddrStr.isEmpty()) {
       return null;
     }
 
+    String hostAddr;
+    InetSocketAddress omRpcAddress = null;
+    int rpcPort = 0;
+    if (shouldResolveAddr) {

Review comment:
       I was trying to avoid creating a socket address when we only need to host and port string. But yes, we can throw an exception too. Though it would be run on all the OMs, the overhead will be minimal.




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