* Return the count of jobs, broken down by status, for a given user.
*/
public ThriftUserJobCounts getUserJobCounts(RequestContext ctx, final String user) {
return assumeUserContextAndExecute(ctx, new PrivilegedAction<ThriftUserJobCounts>() {
public ThriftUserJobCounts run() {
ThriftUserJobCounts ret = new ThriftUserJobCounts(0, 0, 0, 0, 0);
JobStatus[] allJobs = jobTracker.getAllJobs();
for (JobStatus js : allJobs) {
if (!js.getUsername().equals(user))
continue;