CassandraCluster using FailoverOperator

0 views
Skip to first unread message

Nathan McCall

unread,
May 3, 2010, 1:37:02 PM5/3/10
to hecto...@googlegroups.com
I took a stab at plugging in FailoverOperator to CassandraCluster the
other day and got it working. There are a few things I want to clean
up:

The main thing I want to clean up is the operateWithFailover on line
47 of CassandraClusterImpl. I created a typed RuntimeException to wrap
all the possible exceptions coming out of FailoverOperator, pooling
innards, etc.

I did this because I was running out of time, and was getting
frustrated continously adding additional exceptions to the interface
and class and wanted to get this working before I took a day or two
off.

That said, I am of two minds about this:
Against: we should pass through all the cassandra/thrift API stuff
given our previous decisions for just being an API (and we dont do
this anywhere else)

For: I dont want to have to deal with 7 exceptions in my code. I would
prefer a cleaner hierarchy of translated/proxied exceptions with
original causes and messages intact (see how jdbc exceptions are
wrapped in JdbcOperations from SpringFramework for how this can be
done well, particularly through a command pattern:
http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jdbc/core/JdbcOperations.html)

Thoughts?

-Nate

Ran Tavory

unread,
May 4, 2010, 6:08:09 AM5/4/10
to hecto...@googlegroups.com
Yes, we need to make a sweep of exception search and replace particularly to be able to support avro transport.
But I can't find the time for this now...

Nathan McCall

unread,
May 4, 2010, 1:09:35 PM5/4/10
to hecto...@googlegroups.com
I do think having our own exception hierarchy would be valueable, but
I'm with you in that I have no idea when I could get around to
low-hanging fruit like this.

I saw 31 (http://github.com/rantav/hector/issues/#issue/31) do you
mind if I add another for creating a nicer (transport independent)
exception hierarchy?

-Nate

Ran Tavory

unread,
May 4, 2010, 1:25:35 PM5/4/10
to hecto...@googlegroups.com
go ahead
Reply all
Reply to author
Forward
0 new messages