Gora Cassandra Tests & Hector EmbeddedServerHelper

62 views
Skip to first unread message

Lewis John Mcgibbney

unread,
Feb 2, 2012, 4:10:45 PM2/2/12
to hector...@googlegroups.com
Hi Guys,

During my spare time, I've been hacking away at these tests for the gora-cassandra module. I'm at a stage where 'most' of the work is done but I'm struggling slightly with the latter stage.

The patch I've produced is attached to the issue here its v5 [1]. I'm getting InvocationTargetExceptions so somewhere I'm wrapping some underlying exception with one of my own. Looking deeper into it, its when we're trying DataStoreFactory.createDataStore() @ lines 90, 124 & 116 [2] it looks like my config is not correct, this is probably because when the gora-cassandra module was written it was not anticipated that we were going to rely upon cassandra.yaml files, instead writing the module to deal with properties specified in a gora.properties file [3]

I know this might be a stab in the dark, but any advice for writing the cassandra.yaml logic into the module as this looks like the way forward...

There's also the problem of creating a tmp directory in the gora-cassandra directory which doesn't get deleted but this is of secondary importance to the issue described above!

I know you guys are spinning a release just now, so sorry to drop this @ this time... any suggestions would be greatly appreciated.

Ta

Lewis

[1] https://issues.apache.org/jira/browse/GORA-53
[2] http://svn.apache.org/viewvc/gora/trunk/gora-cassandra/src/test/conf/gora.properties?view=markup
[3] http://svn.apache.org/viewvc/gora/trunk/gora-core/src/main/java/org/apache/gora/store/DataStoreFactory.java?view=markup

Nate McCall

unread,
Feb 2, 2012, 6:40:24 PM2/2/12
to hector...@googlegroups.com
Hi Lewis,
I've never actually tried running cassandra with only programatic
configuration (w/o a yaml file) - is this what you mean?

I'm wondering if it is even possible given the amount of static
initializer stuff in DatabaseDescriptor particularly. My curiosity is
a bit tickled by this, but I'm not going to get a chance to look at
this until the weekend, unfortunately.

Several other folks here have some deep experience with init-ing
cassandra in-process for testing (and other stuff) as well though.

lewismc

unread,
Feb 3, 2012, 6:14:14 AM2/3/12
to hector-users
Hi Nate

On Feb 2, 11:40 pm, Nate McCall <n...@datastax.com> wrote:
> Hi Lewis,
> I've never actually tried running cassandra with only programatic
> configuration (w/o a yaml file) - is this what you mean?#

Yeah, I think it is. The module was originally written for a rather
dated version
Cassandra and didn't aim to support a yaml file. The aim was to
provide
all configuration in a type of *-site.xml similar to Hadoop and HBase.
The
DataStoreFactory would then pull this out when createStore() was
called.
The proposed resolution is to move away from this, instead opting for
all
the Cassandra config to be pulled from .yaml instead. It would appear
that
this is a more popular way people are working... for obvious reasons.

> I'm wondering if it is even possible given the amount of static
> initializer stuff in DatabaseDescriptor particularly. My curiosity is
> a bit tickled by this, but I'm not going to get a chance to look at
> this until the weekend, unfortunately.

Do you mean whether it is possible to utilise Hector's
DatabaseDescriptor
to read from the cassandra-site.xml? On first hearing, it sounds like
a nasty
case of using something which is good at it's job (reading config from
yaml) to
do something different (read from *-site.xml) Although I'm curious
with this
as well I'm sceptical about continuing with the cassandra-site.xml, it
just
seems pretty dated to me.

> Several other folks here have some deep experience with init-ing
> cassandra in-process for testing (and other stuff) as well though.
Thanks. Well hopefully my comments above have caused some ripples
which merit feedback.
Thanks again
Lewis

Nate McCall

unread,
Feb 3, 2012, 11:29:52 AM2/3/12
to hector...@googlegroups.com
Sticking with the yaml file is the best bet - per the message on gora-dev as well. 

(I meant DatabaseDescriptor class in apache-cassandra src tree - avoid going that route if at all possible!). 

There is some cleanup I've wanted to do on our EmbeddedServerHelper and SchemaLoader, but you can use these right now for unit testing. Another option is the cassandra-maven-plugin - that actually forks a process though and hooks it into the maven lifecycle so that may not be what you want. 

I'll do some poking this weekend and reply again.
Reply all
Reply to author
Forward
0 new messages