[ 
https://issues.apache.org/jira/browse/HIVE-24875?focusedWorklogId=601768&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-601768
 ]

ASF GitHub Bot logged work on HIVE-24875:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/May/21 14:46
            Start Date: 25/May/21 14:46
    Worklog Time Spent: 10m 
      Work Description: kgyrtkirk commented on a change in pull request #2314:
URL: https://github.com/apache/hive/pull/2314#discussion_r638858915



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/lockmgr/zookeeper/ZooKeeperHiveLockManager.java
##########
@@ -65,16 +66,7 @@
   private int numRetriesForLock;
   private int numRetriesForUnLock;
 
-  private static String clientIp;
-
-  static {
-    clientIp = "UNKNOWN";
-    try {
-      InetAddress clientAddr = InetAddress.getLocalHost();
-      clientIp = clientAddr.getHostAddress();
-    } catch (Exception e1) {
-    }
-  }
+  private static String clientIp = 
ServerUtils.hostname(Optional.of("UNKNOWN"));

Review comment:
       old implementation was resolving an IP while this will be a hostname...




-- 
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 601768)
    Time Spent: 20m  (was: 10m)

> Unify InetAddress.getLocalHost()
> --------------------------------
>
>                 Key: HIVE-24875
>                 URL: https://issues.apache.org/jira/browse/HIVE-24875
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: David Mollitor
>            Priority: Minor
>              Labels: newbie, noob, pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Lots of calls in the Hive code to {{InetAddress.getLocalHost()}}.  This 
> should be standardized onto hive-common {{ServerUtils.hostname()}}, which 
> includes removing (deprecating) a similar method in {{HiveStringUtils}}.
> Open to anyone to improve.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to