[
https://issues.apache.org/jira/browse/MAPREDUCE-6160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14223069#comment-14223069
]
Jason Lowe commented on MAPREDUCE-6160:
---------------------------------------
Looking closer, the client service API is already inconsistent. It currently
throws if the task or task attempt ID is unknown, see verifyAndGetTask/Attempt.
However it is really important to not break compatibility for existing APIs
that didn't throw for unknown job IDs, see MAPREDUCE-4007 as one example.
What if we have verifyAndGetJob throw IOException as in the original patch but
have another form of the utility method (either via arg or a separate method
like verifyAndGetJobNoThrow) that won't throw for unknown jobs. getJobReport
and killJob would call the no-throw form, since those currently don't crash for
unknown jobs. All other instances would call the verify form that throws,
since those would currently NPE if the job ID isn't known. Not an ideal setup,
but it would preserve the existing behavior for APIs that currently don't throw
on unknown job IDs.
> Potential NullPointerException in MRClientProtocol interface implementation.
> ----------------------------------------------------------------------------
>
> Key: MAPREDUCE-6160
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-6160
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Reporter: Rohith
> Assignee: Rohith
> Attachments: MAPREDUCE-6160.1.patch, MAPREDUCE-6160.patch,
> MAPREDUCE-6160.patch
>
>
> In the implementation of MRClientProtocol, many methods can throw
> NullPointerExceptions. Instead of NullPointerExceptions, better to throw
> IOException with proper message.
> In the HistoryClientService class and MRClientService class has
> #verifyAndGetJob() method that return job object as null.
> {code}
> getTaskReport(GetTaskReportRequest request) throws IOException;
> getTaskAttemptReport(GetTaskAttemptReportRequest request) throws IOException;
> getCounters(GetCountersRequest request) throws IOException;
> getTaskAttemptCompletionEvents(GetTaskAttemptCompletionEventsRequest request)
> throws IOException;
> getTaskReports(GetTaskReportsRequest request) throws IOException;
> getDiagnostics(GetDiagnosticsRequest request) throws IOException;
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)