adoroszlai commented on code in PR #11961:
URL: https://github.com/apache/ozone/pull/11961#discussion_r4493257979
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -1586,7 +1586,9 @@ private RPC.Server getRpcServer(OzoneConfiguration conf)
throws IOException {
ReconfigureProtocolService.newReflectiveBlockingService(
reconfigureServerProtocol);
- return startRpcServer(conf, OmUtils.getOmRpcBindAddress(conf,
omNodeRpcAddr), omService,
+ // Read OmConfig from conf: the config field predates loadOMHAConfig,
which copies the per-node bind host.
+ InetSocketAddress bindAddr =
conf.getObject(OmConfig.class).getRpcBindAddress(omNodeRpcAddr);
Review Comment:
Can you please change the order in `OzoneManager` constructor?
- pass the parameter `conf` instead of the field `configuration` to
`loadOMHAConfig`
- move `setConfiguration` after the `loadOMHAConfig` call
This way we can avoid creating a new instance here.
https://github.com/apache/ozone/blob/45e76a94f4acf32261856af0ae21ebb3f1b6ee93/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java#L568-L574
```java
TracingConfig tracingConfig = conf.getObject(TracingConfig.class);
TracingReconfigurationCallback tracingReconfigurationCallback =
TracingReconfigurationCallback.init("OzoneManager", tracingConfig);
// Load HA related configurations
OMHANodeDetails omhaNodeDetails = OMHANodeDetails.loadOMHAConfig(conf);
setConfiguration(conf);
```
--
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]