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