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

Ted Yu commented on BEAM-1773:
------------------------------

Unchecked (runtime) exception: Should indicate a coding error.  To fix it 
someone needs to go change something in the source.
    E.g. Passing null into a method when that's invalid.

Checked exception: Indicates an error that can reasonably occur during program 
execution and is generally fixed without changing the code.
    E.g. Running out of disk space, network error when sending data over the 
wire, invalid user input

Using checked exception(s) would give us more flexibility.


> Consider allowing Source#validate() to throw exception
> ------------------------------------------------------
>
>                 Key: BEAM-1773
>                 URL: https://issues.apache.org/jira/browse/BEAM-1773
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-java-core
>            Reporter: Ted Yu
>            Assignee: Jean-Baptiste Onofré
>
> In HDFSFileSource.java :
> {code}
>   @Override
>   public void validate() {
> ...
>       } catch (IOException | InterruptedException e) {
>         throw new RuntimeException(e);
>       }
> {code}
> Source#validate() should be allowed to throw exception so that we don't 
> resort to using RuntimeException.
> Here was related thread on mailing list:
> http://search-hadoop.com/m/Beam/gfKHFOwE0uETxae?subj=Re+why+Source+validate+is+not+declared+to+throw+any+exception



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to