You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "Yikf (via GitHub)" <gi...@apache.org> on 2023/03/07 12:48:08 UTC

[GitHub] [ranger] Yikf opened a new pull request, #231: Simplifies the dependency of `gethostname4j` for the ranger client

Yikf opened a new pull request, #231:
URL: https://github.com/apache/ranger/pull/231

   Currently, `ranger-plugin-commons` module relies on `gethostname4j`, `jna ` and `jna-platform` to get the native hostname, which is for `AuthzAuditEvent` only.
   
   `gethostname4j`, `jna ` and `jna-platform` is too onerous, it doesn't seem worthwhile to maintain the three jars to get the hostname, and `gethostname4j`, `jna ` and `jna-platform` relies on the native lib, which prevents users from doing shade.


-- 
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: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ranger] pan3793 commented on pull request #231: RANGER-4125: Simplifies the dependency of `gethostname4j` for the ranger client

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on PR #231:
URL: https://github.com/apache/ranger/pull/231#issuecomment-1632042270

   @mneethiraj @kumaab could you guys give some background on why should use `gethostname4j`?
   
   Based on https://stackoverflow.com/questions/7348711/recommended-way-to-get-hostname-in-java
   
   I suppose it could be replaced with `org.apache.commons.lang3.SystemUtils#getHostName`
   
   ```
      /**
        * Gets the host name from an environment variable
        * (COMPUTERNAME on Windows, HOSTNAME elsewhere).
        *
        * <p>
        * If you want to know what the network stack says is the host name, you should use {@code InetAddress.getLocalHost().getHostName()}.
        * </p>
        *
        * @return the host name. Will be {@code null} if the environment variable is not defined.
        * @since 3.6
        */
       public static String getHostName() {
           return IS_OS_WINDOWS ? System.getenv("COMPUTERNAME") : System.getenv("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.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ranger] Yikf commented on pull request #231: Simplifies the dependency of `gethostname4j` for the ranger client

Posted by "Yikf (via GitHub)" <gi...@apache.org>.
Yikf commented on PR #231:
URL: https://github.com/apache/ranger/pull/231#issuecomment-1458115130

   Could you please take a look if you find a moments, thanks @kumaab


-- 
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: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org