// Let us add group1 and group3 to modify-job-acl. So modifyColleague and
// viewAndModifyColleague will be able to modify the job
conf.set(JobContext.JOB_ACL_MODIFY_JOB, " group1,group3");
final SleepJob sleepJob = new SleepJob();
final JobConf jobConf = new JobConf(conf);
sleepJob.setConf(jobConf);
UserGroupInformation jobSubmitterUGI =
UserGroupInformation.createRemoteUser(jobSubmitter);
RunningJob job =
jobSubmitterUGI.doAs(new PrivilegedExceptionAction<RunningJob>() {
public RunningJob run() throws Exception {
JobClient jobClient = new JobClient(jobConf);
SleepJob sleepJob = new SleepJob();
sleepJob.setConf(jobConf);
JobConf jobConf =
sleepJob.setupJobConf(1, 0, 1000, 1, 1000, 1000);
RunningJob runningJob = jobClient.runJob(jobConf);
return runningJob;
}
});