private String queueAsUser(UserGroupInformation ugi, final List<String> args)
throws IOException, InterruptedException {
String id = ugi.doAs(new PrivilegedExceptionAction<String>() {
public String run() throws Exception {
String[] array = new String[args.size()];
TempletonControllerJob ctrl = new TempletonControllerJob();
ToolRunner.run(ctrl, args.toArray(array));
return ctrl.getSubmittedId();
}
});
return id;
}