You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Ted Dunning (JIRA)" <ji...@apache.org> on 2008/03/31 07:06:24 UTC

[jira] Updated: (MAHOUT-22) Several matrix exceptions are checked exceptions, but should be unchecked

     [ https://issues.apache.org/jira/browse/MAHOUT-22?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Dunning updated MAHOUT-22:
------------------------------

    Attachment: MAHOUT-22.patch

Here are the trivial changes.

> Several matrix exceptions are checked exceptions, but should be unchecked
> -------------------------------------------------------------------------
>
>                 Key: MAHOUT-22
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-22
>             Project: Mahout
>          Issue Type: Bug
>            Reporter: Ted Dunning
>            Priority: Minor
>         Attachments: MAHOUT-22.patch
>
>
> IndexException and CardinalityException should be unchecked exceptions by analogy to ArrayIndexOutOfBoundsException
> Having them be checked causes lots of try/catches in code that doesn't have a chance of fixing the problem.  It should be understood that these can happen in any matrix manipulation code just like IllegalArgumentException, ArithmeticException or ArrayIndexOutOfBoundsException can happen in any numerical codes. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Updated: (MAHOUT-22) Several matrix exceptions are checked exceptions, but should be unchecked

Posted by Karl Wettin <ka...@gmail.com>.
Ted Dunning (JIRA) skrev:
>      [ https://issues.apache.org/jira/browse/MAHOUT-22?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
> 
> Ted Dunning updated MAHOUT-22:
> ------------------------------
> 
>     Attachment: MAHOUT-22.patch

I don't get contact with the JIRA via SSL right now.

If nobody objects or beats me (calling Jeff, hello?) to it I'll review 
and probably commit this in a few days.


      karl

RE: [jira] Updated: (MAHOUT-22) Several matrix exceptions are checked exceptions, but should be unchecked

Posted by Jeff Eastman <je...@windwardsolutions.com>.
I actually liked their arguments too and concur with your finding on Spring.
I've always been an upwind sailor. I got really into Pascal's strong typing
when everybody else was eschewing it for C, then moved into Lisp and
Smalltalk when everybody else was into C++ and now Java.

Jeff

Jeff Eastman, Ph.D.
Windward Solutions Inc.
+1.415.298.0023
http://windwardsolutions.com
http://jeffeastman.blogspot.com
 

> -----Original Message-----
> From: Ted Dunning [mailto:tdunning@veoh.com]
> Sent: Monday, March 31, 2008 9:02 AM
> To: mahout-dev@lucene.apache.org
> Subject: Re: [jira] Updated: (MAHOUT-22) Several matrix exceptions are
> checked exceptions, but should be unchecked
> 
> 
> My history is that I was once strongly in the "declare it" camp.
> 
> The example of Spring's JDBC support completely won me over to the other
> side.  The arguments didn't convince me, but using their code did.  If you
> don't expect the programmer to be able to do anything, and you expect them
> to live in a framework (like the servlet or map/reduce) that doesn't
> declare
> these exceptions, then you are just making code really complex when it
> doesn't need to be.
> 
> 
> On 3/31/08 8:50 AM, "Jeff Eastman" <je...@windwardsolutions.com> wrote:
> 
> > I think there is some value in requiring users to handle them
> explicitly,
> > but can see both arguments. I do not feel strongly about this one.




Re: [jira] Updated: (MAHOUT-22) Several matrix exceptions are checked exceptions, but should be unchecked

Posted by Ted Dunning <td...@veoh.com>.
My history is that I was once strongly in the "declare it" camp.

The example of Spring's JDBC support completely won me over to the other
side.  The arguments didn't convince me, but using their code did.  If you
don't expect the programmer to be able to do anything, and you expect them
to live in a framework (like the servlet or map/reduce) that doesn't declare
these exceptions, then you are just making code really complex when it
doesn't need to be.


On 3/31/08 8:50 AM, "Jeff Eastman" <je...@windwardsolutions.com> wrote:

> I think there is some value in requiring users to handle them explicitly,
> but can see both arguments. I do not feel strongly about this one.


RE: [jira] Updated: (MAHOUT-22) Several matrix exceptions are checked exceptions, but should be unchecked

Posted by Jeff Eastman <je...@windwardsolutions.com>.
The current package requires a try-catch block in every mapper, combiner and
reducer to handle those exceptions. I've seen them get thrown in the mapper
by the occasional bad input data records - since they are coming from
outside our world - and just ignore them so as not to abort the whole job. 

As I noted in MAHOUT-6 earlier, I made the exceptions checked so that users
would need to think about this use case and decide what to do. I agree with
Ted that there is little in terms of corrective action that is possible,
except to ignore the records. His patch only changes the superclass of the
exceptions and leaves them in the interfaces and implementations. This
retains their documentation value but removes the requirement to explicitly
handle them.

I think there is some value in requiring users to handle them explicitly,
but can see both arguments. I do not feel strongly about this one.

+-0

Jeff

Jeff Eastman, Ph.D.
Windward Solutions Inc.
+1.415.298.0023
http://windwardsolutions.com
http://jeffeastman.blogspot.com
 

> -----Original Message-----
> From: Karl Wettin [mailto:karl.wettin@gmail.com]
> Sent: Monday, March 31, 2008 6:51 AM
> To: mahout-dev@lucene.apache.org
> Subject: Re: [jira] Updated: (MAHOUT-22) Several matrix exceptions are
> checked exceptions, but should be unchecked
> 
> Ted Dunning (JIRA) skrev:
> >      [ https://issues.apache.org/jira/browse/MAHOUT-
> 22?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
> >
> > Ted Dunning updated MAHOUT-22:
> > ------------------------------
> >
> >     Attachment: MAHOUT-22.patch
> 
> I don't get contact with the JIRA via SSL right now.
> 
> If nobody objects or beats me (calling Jeff, hello?) to it I'll review
> and probably commit this in a few days.
> 
> 
>       karl



Re: [jira] Updated: (MAHOUT-22) Several matrix exceptions are checked exceptions, but should be unchecked

Posted by Karl Wettin <ka...@gmail.com>.
Ted Dunning (JIRA) skrev:
>      [ https://issues.apache.org/jira/browse/MAHOUT-22?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
> 
> Ted Dunning updated MAHOUT-22:
> ------------------------------
> 
>     Attachment: MAHOUT-22.patch

I don't get contact with the JIRA via SSL right now.

If nobody objects or beats me (calling Jeff, hello?) to it I'll review 
and probably commit this in a few days.


      karl