cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Boudreault (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-8909) Replication Strategy creation errors are lost in try/catch
Date Mon, 09 Mar 2015 14:39:38 GMT

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

Alan Boudreault commented on CASSANDRA-8909:
--------------------------------------------

Ok. I hadn't noticed that since .patch files are viewed the same way in my chrome here. Will
use .txt next time.

I'll also attach the patches for 2.1 and trunk.

> Replication Strategy creation errors are lost in try/catch
> ----------------------------------------------------------
>
>                 Key: CASSANDRA-8909
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8909
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Alan Boudreault
>            Assignee: Alan Boudreault
>            Priority: Trivial
>             Fix For: 2.0.13
>
>         Attachments: replication-strategy-exception-2.0.patch
>
>
> I was initially executing a bad cassandra-stress command  and was getting this error:
> {code}
> Unable to create stress keyspace: Error constructing replication strategy class
> {code}
> with the following command:
> {code}
> cassandra-stress -o insert --replication-strategy NetworkTopologyStrategy --strategy-properties
dc1:1,dc2:1 --replication-factor 1
> {code}
> After digging in the code, I noticed that the error displayed was not the one thrown
by the replication strategy code and that the try/catch block could be improved. Basically,
the Constructor.newInstance can throw an InvocationTargetException, which provide a better
error report.
> I think this improvement can also be done in 2.1 (not tested yet). If my attached patch
is acceptable, I will test and provide the right version for 2.1 and trunk.
> With the patch, I can see the proper error when executing my bad command:
> {code}
> Unable to create stress keyspace: replication_factor is an option for SimpleStrategy,
not NetworkTopologyStrategy
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message