Hi Benoit,
You can do so by providing the Hadoop FileSystem instance to the
HDFSLocationFactory and pass that factory to the
YarnTwillRunnerService. Something like this:
String hdfsUser = System.getProperty("user.name");
YarnConfiguration conf = new YarnConfiguration();
FileSystem fs = FileSystem.get(FileSystem.getDefaultUri(conf), conf, hdfsUser);
LocationFactory lf = new HDFSLocationFactory(fs);
TwillRunnerService runner = new YarnTwillRunnerService(conf, zkConnectStr, lf);
Terence
On Thu, Jul 30, 2015 at 6:21 AM, Benoit Perroud <[email protected]> wrote:
> Hi All,
>
> I'm struggling with the following use case: running a twill application and
> writing into HDFS, the created files are owned by yarn user. not that
> surprising as the TwillRunnable are run by the NodeManager as this user,
> but I'd like to propagate the user launching the twill application (say,
> bperroud in my case).
>
> I tried a few combinations of doAs etc, but didn't succeed to change the
> ownership of the HDFS files.
>
> Any advise or pointers?
>
> Thanks in advance,
>
> Benoit