incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ran Tavory <ran...@gmail.com>
Subject Re: 'Tearing down' a test database
Date Wed, 24 Mar 2010 17:51:54 GMT
actually in 0.6.0 I committed this to trunk:
http://svn.apache.org/repos/asf/cassandra/trunk/contrib/javautils/src/main/java/org/apache/cassandra/contrib/utils/service/CassandraServiceDataCleaner.java
So it's quite similar to what I you have in hector.

A few words of warning though:
- this wipes out the entire data directory, all CFs
- assumes you're using a local and embedded service; great for unit testing,
but I don't know if this is your case
- if indeed in unit-testing, make sure you run each test in a new jvm as the
embedded server needs to be completely killed before a new one can be
started (in ant, just fork)

On Wed, Mar 24, 2010 at 7:18 PM, Nathan McCall <nate@vervewireless.com>wrote:

> Take a look at EmbeddedServerHelper in the hector client for an
> example of how this is managed through a test case:
>
> http://github.com/rantav/hector/blob/master/src/test/java/me/prettyprint/cassandra/testutils/EmbeddedServerHelper.java
>
> -Nate
>
> On Wed, Mar 24, 2010 at 5:10 AM, Philip Jackson <phil@shellarchive.co.uk>
> wrote:
> > Hi,
> >
> > Just trying out Cassandra (0.5), looks great so far but I've got a
> > question about removing data:
> >
> > For my test suite I would like to be able to build-up data in the
> > database and then have the test framework tear it all back down
> > again. Trouble is, if I do a batch_insert, remove, batch_insert (of
> > the same data) the second insert doesn't seem to work (though there's
> > no exception). It's very possibly me doing something foolish, but does
> > anyone else work with this sort of setup? Perhaps my problem sounds
> > familiar?
> >
> > Cheers,
> > Phil
> >
> > P.S The test instances will only ever be on one node and the data in
> > them unimportant.
> >
>

Mime
View raw message