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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]