You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/06/01 15:49:00 UTC

[jira] [Work logged] (HIVE-24875) Unify InetAddress.getLocalHost()

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

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

                Author: ASF GitHub Bot
            Created on: 01/Jun/21 15:48
            Start Date: 01/Jun/21 15:48
    Worklog Time Spent: 10m 
      Work Description: belugabehr commented on a change in pull request #2314:
URL: https://github.com/apache/hive/pull/2314#discussion_r643230520



##########
File path: standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/InetUtils.java
##########
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.metastore.utils;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.Objects;
+import java.util.Optional;
+
+/**
+ * Utility functions around the Java InetAddress class.
+ */
+public class InetUtils {
+
+  /**
+   * @return name of current host
+   */
+  public static String hostname() {
+    return hostname(Optional.empty());
+  }
+
+  /**
+   * @return name of current host
+   */
+  public static String hostname(Optional<String> defaultValue) {

Review comment:
       @kgyrtkirk Thanks so much for looking at this and thanks for pointing out some silly mistakes on my part.  I must not have had my head on straight that day.
   
   I think we make a functional change as you have proposed in a stand-alone ticket.  Thanks!




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


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

    Worklog Id:     (was: 604570)
    Time Spent: 40m  (was: 0.5h)

> 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: 40m
>  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)