You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by "kishore gopalakrishna (JIRA)" <ji...@apache.org> on 2013/03/29 19:39:16 UTC

[jira] [Commented] (HELIX-75) ZKHelixManager declares throws Exception

    [ https://issues.apache.org/jira/browse/HELIX-75?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13617597#comment-13617597 ] 

kishore gopalakrishna commented on HELIX-75:
--------------------------------------------

Good point Max, in earlier versions we were doing connect in constructor but we moved connect to a separate method so we can remove the exception. 

Overall we have two kinds of interactions, 

1) user code calling helix - example creating helix manager and connecting to cluster
2) Helix calling user code- state transitions

We dint spend much time on classifying exceptions for 1), no particular reason for doing so. We should file another jira to review exceptions and convert them to checkedExceptions. 

For 2) we will continue to catch all exceptions including runtime from user code. 




                
> ZKHelixManager declares throws Exception
> ----------------------------------------
>
>                 Key: HELIX-75
>                 URL: https://issues.apache.org/jira/browse/HELIX-75
>             Project: Apache Helix
>          Issue Type: Bug
>          Components: helix-core
>    Affects Versions: 0.6.0-incubating
>            Reporter: Max Calderoni
>            Priority: Minor
>
> I noticed that in the signature of ZKHelixManager's constructor (and consequently, in HelixManagerFactory.getZKHelixManager()) there is a throws Exception clause.
> Two questions:
> 1. that constructor does not really throw any Exception so that throws clause can be removed.
> 2. even if you wanted to keep that throws clause for some reason, did you really mean to throw 'Exception' or something more specific than that in the API?
> Because that forces client code to catch runtime exceptions, which you normally don't really want to catch, nor want to be forced to carry along 'throws Exception'.
> In general, i noticed in code that there are other parts where things declare 'throws Exception'.
> If that is a choice for the internal code, fine, but again, if it is API, would be best if users were not forced by that practice.
> If all that was meant, could you please explain the arguments for this particular choice of throwing 'Exception'.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira