xintongsong commented on a change in pull request #11284:
[FLINK-15911][runtime] Make Flink work with NAT.
URL: https://github.com/apache/flink/pull/11284#discussion_r395430171
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterEntrypoint.java
##########
@@ -248,10 +247,14 @@ protected void initializeServices(Configuration
configuration) throws Exception
LOG.info("Initializing cluster services.");
synchronized (lock) {
- final String bindAddress =
configuration.getString(JobManagerOptions.ADDRESS);
- final String portRange = getRPCPortRange(configuration);
-
- commonRpcService = createRpcService(configuration,
bindAddress, portRange);
+ commonRpcService =
AkkaRpcServiceUtils.createRemoteRpcService(
+ configuration,
+
configuration.getString(JobManagerOptions.ADDRESS),
+ getRPCPortRange(configuration),
+
configuration.getString(JobManagerOptions.BIND_HOST),
+
configuration.contains(JobManagerOptions.RPC_BIND_PORT) ?
+
configuration.getInteger(JobManagerOptions.RPC_BIND_PORT) :
+ null);
Review comment:
Same here. I also think using Optional will express the contract better. The
question is do we need to strictly follow the code style guide.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services