When using JobHistoryServer CLI to query a job id that does not exist on the server, it may throw NullPointerException sometimes.
I tried "mapred job -events <some_wrong_jobId> 0 100", and the result was:
Exception in thread "main" java.lang.NullPointerException
Similar symptoms also appear with -list-attempt-ids, but were fine with -status and -set-priority.
I traced back to CLI.listEvents, and line 487 is:
The job object is obtained from JobID.forName(jobid)) (line 316), which will return null if the job does not exist on server.
Maybe we want to have some behaviors consistent with -status here, by simply reporting jobId does not exist?