bharatviswa504 commented on a change in pull request #2491:
URL: https://github.com/apache/ozone/pull/2491#discussion_r696446556
##########
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:
With this If any mistake it would be caught during last step validation
of rpcAddr check in checkOMexistsInRemoteOMConfig.
With out check it would be caught early.
With this kind of user errors, any approach can work. Feel free to do what
you feel best here
--
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]