Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I start Apache Cassandra programmatically

Tags:

java

cassandra

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

like image 222
zehrer Avatar asked Aug 02 '10 14:08

zehrer


Video Answer


2 Answers

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

like image 196
Nikolaus Gradwohl Avatar answered Sep 29 '22 07:09

Nikolaus Gradwohl


We do this in our test utils module now (which also has no dependency on hector-core)

https://github.com/rantav/hector/tree/master/test/src/main/java/me/prettyprint/hector/testutils

As mentioned in the comments, there is no clean shutdown state. It is safe to just kill.

like image 23
zznate Avatar answered Sep 29 '22 06:09

zznate