incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse McConnell <>
Subject Re: How to stop Cassandra running in embeded mode
Date Tue, 20 Jul 2010 13:23:20 GMT
separate jvm is the only mechanism to 'shutdown' in a test scenario
right now....and its unlikely to change in the short term so designing
around forking is your best bet


jesse mcconnell

On Tue, Jul 20, 2010 at 05:47, Bjorn Borud <> wrote:
> Jonathan Ellis <> writes:
>> there's some support for this in 0.7 (see
>> but fundamentally
>> it's not really designed to be started and stopped multiple times
>> within the same process.
> I am currently struggling with some of the same issues (on 0.6.3).
> I think there are very valid reasons for being able to start and stop
> Cassandra within the same JVM. in particular for various testing-related
> scenarios, but also when one wants to experiment with embedding
> Cassandra. (Having a single-node, embedded Cassandra can be great for
> testing Cassandra-based applications without forcing "casual users" to
> go through the ordeal of installing Cassandra).
> Right now I have an ungodly mess that attempts to embed Cassandra by
> wrapping the CassandraDaemon, generating a directory hierarchy for it
> and populating the storage-conf.xml by way of a templating system and
> then fires up Cassandra.
> It *sort of* works, except that I haven't found a way to shut Cassandra
> down reliably. the stop() method doesn't really do anything useful in
> this respect. (I'd prefer some way of being able to ask it to shut down
> and then have some way of blocking until it is down). I think some of
> the errors I am seeing (NPE at at
> org.apache.cassandra.db.commitlog.CommitLog.recover(
> are probably due to some race condition because of this, but I am
> guessing here.
> I'll have another stare at the source.
> -Bjørn

View raw message