[Feature-2574][Server]Specify Network Interface#3186
[Feature-2574][Server]Specify Network Interface#3186qiaozhanwei merged 8 commits intoapache:devfrom CalvinKirs:#2574
Conversation
| public static boolean isSpecifyNetworkInterface(NetworkInterface networkInterface) { | ||
| String preferredNetworkInterface = System.getProperty(DOLPHIN_SCHEDULER_PREFERRED_NETWORK_INTERFACE); | ||
| return Objects.equals(networkInterface.getDisplayName(), preferredNetworkInterface); | ||
| } |
There was a problem hiding this comment.
Hi,
Good job,
Utils should be used as a tool class and it is better not to involve business process.
Is it better to implement this part in the business process class?
There was a problem hiding this comment.
- Hello, this is exclusive to net, other business is not involved, so I think it is better to achieve here,how do you think?
There was a problem hiding this comment.
- Hello, this is exclusive to net, other business is not involved, so I think it is better to achieve here,how do you think?
Hi,
I think it is better not to add the isSpecifyNetworkInterface in findNetworkInterface of utils, but I find there is only one call of findNetworkInterface, so I don't think of a better place to add this at present.
I think we can think about the implement scheme again later.
There was a problem hiding this comment.
I think this modify like this, the name is more better.
private static boolean isSpecifyNetworkInterface(NetworkInterface networkInterface) { String preferredNetworkInterface = PropertyUtils.getString(DOLPHIN_SCHEDULER_PREFERRED_NETWORK_INTERFACE); logger.info("config name:{}, net work interface: {}, addrs: {}", preferredNetworkInterface, networkInterface, networkInterface.getInterfaceAddresses()); return Objects.equals(networkInterface.getName(), preferredNetworkInterface) || Objects.equals(networkInterface.getDisplayName(), preferredNetworkInterface); }common.properties add interface config
# Network Interface name #dolphin.scheduler.network.interface.preferred=eth0
| private static String DOLPHIN_SCHEDULER_PREFERRED_NETWORK_INTERFACE = "dolphin.scheduler.network.interface.preferred"; | ||
|
|
There was a problem hiding this comment.
Hi,
Is it better to move DOLPHIN_SCHEDULER_PREFERRED_NETWORK_INTERFACE to Constants.java?
There was a problem hiding this comment.
Thanks for your suggestions, I have completed the changes.
|
Hi, I find you use the function of |
There will be no impact here |
|
done. |
|
Kudos, SonarCloud Quality Gate passed!
|
|
This is mail discuss before,please refer The conclusion at the time ,InetAddress.getLocalHost().getHostAddress() not support docker host mode your PR can solve this problem ? |
What is the purpose of the pull request
This closes #2574
Verify this pull request
This pull request is already covered by existing tests, such as (please describe tests).
This change added tests and can be verified as follows: