beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Yu (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (BEAM-1773) Consider allowing Source#validate() to throw exception
Date Sun, 30 Apr 2017 02:24:04 GMT

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

Ted Yu edited comment on BEAM-1773 at 4/30/17 2:23 AM:
-------------------------------------------------------

w.r.t. ValidationException, I assume you mean creating ValidationException class (subclass
of IOException) which is declared to be thrown by the relevant methods.

w.r.t. InterruptedException, allow me to refer to hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
which has the following:
{code}
      } catch (InterruptedException e) {
        throw (IOException)new InterruptedIOException("Interrupted: action="
            + action + ", retry policy=" + connectionRetryPolicy).initCause(e);
      }
{code}


was (Author: yuzhihong@gmail.com):
w.r.t. ValidationException, I assume you mean creating ValidationException class (subclass
of IOException) which is declared by the relevant methods.

w.r.t. InterruptedException, allow me to refer to hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
which has the following:
{code}
      } catch (InterruptedException e) {
        throw (IOException)new InterruptedIOException("Interrupted: action="
            + action + ", retry policy=" + connectionRetryPolicy).initCause(e);
      }
{code}

> 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: Ted Yu
>         Attachments: beam-1773.v1.patch, beam-1773.v2.patch
>
>
> 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)

Mime
View raw message