[
https://issues.apache.org/jira/browse/HDFS-16710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17601347#comment-17601347
]
ASF GitHub Bot commented on HDFS-16710:
---------------------------------------
ZanderXu commented on PR #4670:
URL: https://github.com/apache/hadoop/pull/4670#issuecomment-1239493082
@goiri @slfan1989 Masters, I have rebased this PR on the latest trunk. Sorry
to ping you to help me merge this to trunk. I think it is helpful for the
simplicity of the code. If you agree it, please help me to merge it into the
trunk. Else let me close this PR. Thanks again.
> Remove redundant throw exceptions in org.apahce.hadoop.hdfs.server.namenode
> package
> -----------------------------------------------------------------------------------
>
> Key: HDFS-16710
> URL: https://issues.apache.org/jira/browse/HDFS-16710
> Project: Hadoop HDFS
> Issue Type: Improvement
> Reporter: ZanderXu
> Assignee: ZanderXu
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> When I read some class about HDFS NameNode, I found there are many redundant
> throw exception in org.apahce.hadoop.hdfs.server.namenode package, such as:
> {code:java}
> public synchronized void transitionToObserver(StateChangeRequestInfo req)
> throws ServiceFailedException, AccessControlException, IOException {
> checkNNStartup();
> nn.checkHaStateChange(req);
> nn.transitionToObserver();
> } {code}
> Because ServiceFailedException and AccessControlException is subClass of
> IOException, so I feel that ServiceFailedException and AccessControlException
> are redundant, so we can remove it to make code clearer, such as:
> {code:java}
> public synchronized void transitionToObserver(StateChangeRequestInfo req)
> throws IOException {
> checkNNStartup();
> nn.checkHaStateChange(req);
> nn.transitionToObserver();
> } {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]