crunch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Wills (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CRUNCH-279) Allow DoFn.process to throw exceptions
Date Thu, 10 Oct 2013 16:55:45 GMT

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

Josh Wills commented on CRUNCH-279:
-----------------------------------

My experience was that I usually wanted to increment a counter in response to a checked exception
and then continue on my merry way. What are the pros/cons of throwable exceptions vs. being
able to call a fail() method or some other mechanism for killing a running job?

> Allow DoFn.process to throw exceptions
> --------------------------------------
>
>                 Key: CRUNCH-279
>                 URL: https://issues.apache.org/jira/browse/CRUNCH-279
>             Project: Crunch
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 0.7.0
>            Reporter: Joseph Adler
>            Assignee: Josh Wills
>
> Currently, the DoFn process method doesn't throw any exceptions. This forces me to (a)
catch all exceptions internally (which is good), but then (b) do something unnatural (like
a deliberate null pointer exception) to stop processing and cause the job to fail.
> If only we could just throw an exception from DoFn (like, say, an IOException, which
both Mapper.map and Reducer.reduce can throw), we could have a better way to cause a task
to fail on error.
> If other people think this is useful, I'll submit a patch.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message