[ 
https://issues.apache.org/jira/browse/HADOOP-4998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eli Collins updated HADOOP-4998:
--------------------------------

    Attachment: hadoop-4998-1.patch

What do people think of introducing a "platform" class that 
* Provides a uniform API to the rest of Hadoop for accessing host platform 
information (eg du, df, username, etc) 
* The implementation makes a jni call to a host platform interface if the 
native library is available, and falls back to using the shell otherwise.

I've attached a patch that adds a PlatformCall class that provides getUsername 
and modified UnixUserGroupInformation to use it. PlatforCall's getUsername 
method, if the native library is loaded, makes a jni call to a function 
(getUsername in PlatformCall.c) that uses getpwuid_r and geteuid to get the 
effective username, and shells out to whoami otherwise.

If people like this approach I'll flesh out the patch to cover the other uses 
of Shell. The first step would be to refactor the code so that the uses of 
Shell that we want to replace are isolated to PlatformCall and then add 
additional native implementations.

> Implement a native OS runtime for Hadoop
> ----------------------------------------
>
>                 Key: HADOOP-4998
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4998
>             Project: Hadoop Common
>          Issue Type: New Feature
>          Components: native
>            Reporter: Arun C Murthy
>            Assignee: Arun C Murthy
>             Fix For: 0.21.0
>
>         Attachments: hadoop-4998-1.patch
>
>
> It would be useful to implement a JNI-based runtime for Hadoop to get access 
> to the native OS runtime. This would allow us to stop relying on exec'ing 
> bash to get access to information such as user-groups, process limits etc. 
> and for features such as chown/chgrp (org.apache.hadoop.util.Shell).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to