tags:

views:

62

answers:

1

Hi I want to embed Apache Cassandra in my Java program, how can I start it programmatically?

+3  A: 

http://prettyprint.me/2010/02/14/running-cassandra-as-an-embedded-service/ has written a nice blog post on how to embedd cassandra for unittests

Nikolaus Gradwohl
I know this article. The solution is based on org.apache.cassandra.service.EmbeddedCassandraService which only has only a run method. I wonder how I can cleanly shutdown Cassandra with this solution.
zehrer
There is no such thing as a "clean shutdown" to Cassandra, just let it die and it will take care of any log replay necessary the next time you start it.
jbellis
Sadly is really hard to let it just die. I think I will have to fork another jvm to do this.
zehrer