AnsweredAssumed Answered

Simple Impersonation of FileSystem

Question asked by subroto on Aug 3, 2015
Latest reply on Aug 5, 2015 by keysbotzum

I am using MapR-4.0.2-mr2 and trying to create a FileSystem object from my Java Code. The FileSystem creation logic is wrapped in *UserGroupInformation.doAs()* , so that I get a FileSystem object with a desired user. While debugging my application I found the following info in the fileSystem object:
![alt text][1]

When I use this file system object to create folders or file, the user and group information doesn't match the FileSystem user information, instead the files/folders get created with User Info of the user with which my application has started(in this case *mapr*):

>[mapr@ip-10-101-21-157 Subroto]$ hadoop dfs -ls /user/mapr/subroto/sample/temp/

>DEPRECATED: Use of this script to execute hdfs command is deprecated.

>Instead use the hdfs command for it.

>Found 1 items

>drwxrwx--x   - mapr mapr          0 2015-08-03 05:06 /user/mapr/subroto/sample/temp/job-7

I have verified the code in plain vanilla apache-hadoop-2.6.0 and it works as desired.
Please let me know if I am missing something in the configuration or something in the code?

  [1]: /storage/temp/280-impersonated-filesystem.png