vinothchandar commented on a change in pull request #4355:
URL: https://github.com/apache/hudi/pull/4355#discussion_r771553067
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/util/NetworkUtils.java
##########
@@ -21,32 +21,22 @@
import org.apache.hudi.exception.HoodieException;
import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.Socket;
+import java.net.DatagramSocket;
+import java.net.InetAddress;
/**
* A utility class for network.
*/
public class NetworkUtils {
public static synchronized String getHostname() {
- Socket s = null;
- try {
- s = new Socket();
+ try (DatagramSocket s = new DatagramSocket()) {
// see
https://stackoverflow.com/questions/9481865/getting-the-ip-address-of-the-current-machine-using-java
// for details.
- s.connect(new InetSocketAddress("google.com", 80));
+ s.connect(InetAddress.getByName("8.8.8.8"), 10002);
Review comment:
What's `8.8.8.8` ?
--
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]