vjagadish1989 commented on code in PR #2452:
URL: https://github.com/apache/helix/pull/2452#discussion_r1170709953
##########
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkServer.java:
##########
@@ -83,55 +80,25 @@ public int getPort() {
@PostConstruct
public void start() {
- final String[] localHostNames = NetworkUtil.getLocalHostNames();
- String names = "";
- for (int i = 0; i < localHostNames.length; i++) {
- final String name = localHostNames[i];
- names += " " + name;
- if (i + 1 != localHostNames.length) {
- names += ",";
- }
- }
- LOG.info("Starting ZkServer on: [" + names + "] port " + _port +
"...");
startZooKeeperServer();
_zkClient = new ZkClient(new ZkConnection("localhost:" + _port),
10000, -1, new BasicZkSerializer(new SerializableSerializer()), null, null,
null, false);
_defaultNameSpace.createDefaultNameSpace(_zkClient);
}
private void startZooKeeperServer() {
- final String[] localhostHostNames = NetworkUtil.getLocalHostNames();
Review Comment:
seems like `getLocalHostNames` is merely used for validation/logging. - both
of which seem wasteful when starting a local ZK server,
curious how much time each call takes - it appears to enumerate interfaces
etc.? a quick micro benchmark can tell us.
--
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]